<s> from glad . lang . common . loader import BaseLoader <EOL> from glad . lang . c . loader import LOAD_OPENGL_DLL , LOAD_OPENGL_DLL_H , LOAD_OPENGL_GLAPI_H <EOL> _OPENGL_LOADER = LOAD_OPENGL_DLL % { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } + '''<STR_LIT>''' <EOL> _OPENGL_HAS_EXT = '''<STR_LIT>''' <EOL> _OPENGL_HEADER_START = '''<STR_LIT>''' <EOL> _OPENGL_HEADER_INCLUDE_ERROR = '''<STR_LIT>''' <EOL> _OPENGL_HEADER = '''<STR_LIT>''' + LOAD_OPENGL_GLAPI_H + '''<STR_LIT>''' <EOL> _OPENGL_HEADER_LOADER = '''<STR_LIT>''' + LOAD_OPENGL_DLL_H <EOL> _OPENGL_HEADER_END = '''<STR_LIT>''' <EOL> _FIND_VERSION = '''<STR_LIT>''' <EOL> class OpenGLCLoader ( BaseLoader ) : <EOL> def write ( self , fobj ) : <EOL> if not self . disabled and '<STR_LIT>' in self . apis : <EOL> fobj . write ( _OPENGL_LOADER ) <EOL> def write_begin_load ( self , fobj ) : <EOL> fobj . write ( '<STR_LIT>' ) <EOL> fobj . write ( '<STR_LIT>' ) <EOL> fobj . write ( '<STR_LIT>' ) <EOL> fobj . write ( '<STR_LIT>' ) <EOL> def write_end_load ( self , fobj ) : <EOL> fobj . write ( '<STR_LIT>' ) <EOL> def write_find_core ( self , fobj ) : <EOL> fobj . write ( _FIND_VERSION ) <EOL> def write_find_core_end ( self , fobj ) : <EOL> fobj . write ( _FIND_VERSION ) <EOL> def write_has_ext ( self , fobj ) : <EOL> fobj . write ( _OPENGL_HAS_EXT ) <EOL> def write_header ( self , fobj ) : <EOL> fobj . write ( _OPENGL_HEADER_START ) <EOL> written = set ( ) <EOL> for api , hname , name in [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> ] : <EOL> if api in self . apis and hname not in written : <EOL> fobj . write ( _OPENGL_HEADER_INCLUDE_ERROR . format ( hname , name ) ) <EOL> written . add ( hname ) <EOL> fobj . write ( _OPENGL_HEADER ) <EOL> if not self . disabled and '<STR_LIT>' in self . apis : <EOL> fobj . write ( _OPENGL_HEADER_LOADER ) <EOL> def write_header_end ( self , fobj ) : <EOL> fobj . write ( _OPENGL_HEADER_END ) </s>
