doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
read.py
Go to the documentation of this file.
1 # utility module to process incoming GL description
2 
3 import sys, string
4 
5 def read_gl(f_in):
6  buffer = f_in.read()
7  lines = string.split(buffer, '\n')
8 
9  gl = []
10  wgl = []
11  glX = []
12 
13  for line in lines:
14  if ( len(line) ): # drop empty lines
15  tokens = string.split(line, ';')
16  if ( tokens[1] == 'qgl' ):
17  gl.append(tokens)
18  elif ( tokens[1] == 'qwgl' ):
19  wgl.append(tokens)
20  elif ( tokens[1] == 'qglX' ):
21  glX.append(tokens)
22  else:
23  sys.stderr.write('ERROR: unknown type %s\n' % tokens[1])
24  raise "abort"
25 
26  return (gl, wgl, glX)
def read_gl
Definition: read.py:5