summaryrefslogtreecommitdiffstats
path: root/opengl/libs/GLES2_dbg/generate_GLFunction_java.py
blob: 07bbf14583d5099088558962ca47819f4db18e34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os

if __name__ == "__main__":
	externs = []
	lines = open("gl2_api.in").readlines()
	i = 0
	print "// auto generated by generate_GLFunction_java.py"
	print """package GLESv2Debugger;

public enum GLFunction
{"""
	
	index = 0
	for line in lines:
		if line.find("API_ENTRY(") >= 0: # a function prototype
			returnType = line[0: line.find(" API_ENTRY(")]
			functionName = line[line.find("(") + 1: line.find(")")] #extract GL function name
			print "\t%s(%d, DebuggerMessage.Message.Function.%s)," % (functionName, index, functionName)
			index += 1
	print """\t;

\tpublic final int index;
\tpublic final DebuggerMessage.Message.Function function;
\tGLFunction(final int index, final DebuggerMessage.Message.Function function)
\t{
\t\tthis.index = index;
\t\tthis.function = function;
\t}
}"""