parameters: ()
docstring: Generate the extras needed by the QtOpenGL module (i.e. the .sip file
      defining the correct typedefs for the OpenGL data types.
docstring_summary: Generate the extras needed by the QtOpenGL module (i.e. the .sip file
      defining the correct typedefs for the OpenGL data types.
docstring_tokens: Generate the extras needed by the QtOpenGL module ( i . e . the . sip file defining the correct typedefs for the OpenGL data types .
function: def generate_OpenGL_extras():
      """Generate the extras needed by the QtOpenGL module (i.e. the .sip file
      defining the correct typedefs for the OpenGL data types.
      """
      sipconfig.inform("Determining the OpenGL data types...")
  
      src = "opengl_extras.cpp"
  
      f = open(src, "w")
  
      f.write(
  """#include <QFile>
  #include <QTextStream>
  #include <qgl.h>
  
  int main(int, char **)
  {
      QFile outf("./sip/QtOpenGL/opengl_types.sip");
  
      if (!outf.open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Text))
          return 1;
  
      QTextStream out(&outf);
  
      if (sizeof (long) == sizeof (GLint))
          out << "typedef long GLint;\\n";
      else
          out << "typedef int GLint;\\n";
  
      if (sizeof (unsigned long) == sizeof (GLuint))
          out << "typedef unsigned long GLuint;\\n";
      else
          out << "typedef unsigned GLuint;\\n";
  
      if (sizeof (unsigned long) == sizeof (GLenum))
          out << "typedef unsigned long GLenum;\\n";
      else
          out << "typedef unsigned GLenum;\\n";
  
      if (sizeof (unsigned long) == sizeof (GLbitfield))
          out << "typedef unsigned long GLbitfield;\\n";
      else
          out << "typedef unsigned GLbitfield;\\n";
  
      out << "typedef float GLfloat;\\n";
  
      return 0;
  }
  """)
  
      f.close()
  
      cmd = compile_qt_program(src, "QtOpenGL")
  
      if cmd is None:
          sipconfig.error("Unable to determine the OpenGL data types.")
  
      # SIP's build system (specifically ProgramMakefile.build_command()) assumes
      # that an executable can be created by running a single command.  In the
      # case of MSVC this is incorrect.  As a quick hack we do the extra step
      # here if it looks like it is needed.
      if os.access("opengl_extras.manifest", os.F_OK):
          run_command("mt -nologo -manifest opengl_extras.manifest -outputresource:opengl_extras.exe;1")
  
      run_command(cmd)
function_tokens: def generate_OpenGL_extras ( ) : sipconfig . inform ( "Determining the OpenGL data types..." ) src = "opengl_extras.cpp" f = open ( src , "w" ) f . write ( """#include <QFile>
  #include <QTextStream>
  #include <qgl.h>
  
  int main(int, char **)
  {
      QFile outf("./sip/QtOpenGL/opengl_types.sip");
  
      if (!outf.open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Text))
          return 1;
  
      QTextStream out(&outf);
  
      if (sizeof (long) == sizeof (GLint))
          out << "typedef long GLint;\\n";
      else
          out << "typedef int GLint;\\n";
  
      if (sizeof (unsigned long) == sizeof (GLuint))
          out << "typedef unsigned long GLuint;\\n";
      else
          out << "typedef unsigned GLuint;\\n";
  
      if (sizeof (unsigned long) == sizeof (GLenum))
          out << "typedef unsigned long GLenum;\\n";
      else
          out << "typedef unsigned GLenum;\\n";
  
      if (sizeof (unsigned long) == sizeof (GLbitfield))
          out << "typedef unsigned long GLbitfield;\\n";
      else
          out << "typedef unsigned GLbitfield;\\n";
  
      out << "typedef float GLfloat;\\n";
  
      return 0;
  }
  """ ) f . close ( ) cmd = compile_qt_program ( src , "QtOpenGL" ) if cmd is None : sipconfig . error ( "Unable to determine the OpenGL data types." ) # SIP's build system (specifically ProgramMakefile.build_command()) assumes # that an executable can be created by running a single command.  In the # case of MSVC this is incorrect.  As a quick hack we do the extra step # here if it looks like it is needed. if os . access ( "opengl_extras.manifest" , os . F_OK ) : run_command ( "mt -nologo -manifest opengl_extras.manifest -outputresource:opengl_extras.exe;1" ) run_command ( cmd )