pike.git / src / post_modules / GL / top.c

version» Context lines:

pike.git/src/post_modules/GL/top.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information.   */      #include "global.h" -  +    #include "config.h"      #ifdef HAVE_GL      /* INT64, INT32, INT16 and INT8 conflict with some GL headerfiles.    * eg on AIX 4.2.    */   #ifdef INT64   #undef INT64   #endif   #undef INT32   #undef INT16   #undef INT8    - #ifdef HAVE_WINDEF_H - #include <windows.h> - #endif /* HAVE_WINDEF_H */ + /* OpenGL/gl.h, a MacOSX-ism, precludes GL/gl.h and GL/glx.h */ + #ifdef HAVE_OPENGL_GL_H + #include <OpenGL/gl.h> + #ifdef HAVE_OPENGL_GLEXT_H + #include <OpenGL/glext.h> + #endif + #else   #ifdef HAVE_GL_GL_H   #include <GL/gl.h>   #endif /* HAVE_GL_GL_H */ - #ifdef HAVE_OPENGL_GL_H - #include <OpenGL/gl.h> - #endif /* HAVE_OPENGL_GL_H */ +    #ifdef HAVE_GL_GLX_H   #include <GL/glx.h>   #endif /* HAVE_GL_GLX_H */ -  + #ifdef HAVE_GL_GLEXT_H + #include <GL/glext.h> + #endif + #endif /* HAVE_OPENGL_GL_H */    -  +  +    /* Restore INT64, INT32, INT16 and INT8. */   #include "pike_int_types.h"      #endif /* HAVE_GL */      #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "interpret.h"
pike.git/src/post_modules/GL/top.c:50: Inside #if defined(HAVE_GL)
     #ifdef HAVE_GL      static void f_glGet(INT32 args)   {    INT32 arg1;    GLint i, i2[4];    GLboolean b[4];    GLfloat f[16];    -  check_all_args("glGet", args, BIT_INT, 0); +  check_all_args(NULL, args, BIT_INT, 0);       arg1=Pike_sp[0-args].u.integer;       pop_n_elems(args);       switch(arg1) {    case GL_ACCUM_ALPHA_BITS:    case GL_ACCUM_BLUE_BITS:    case GL_ACCUM_GREEN_BITS:    case GL_ACCUM_RED_BITS:
pike.git/src/post_modules/GL/top.c:384:      PIKE_MODULE_INIT   {   #ifdef HAVE_GL    extern void GL_add_auto_funcs(void);       add_function_constant("glGet", f_glGet,    "function(int:int|float|array(int)|array(float))",    OPT_SIDE_EFFECT);    GL_add_auto_funcs(); +  + #ifdef HAVE_GLSL +  { +  struct program *glsl; +  struct object *glsl_module; +  start_new_program(); +  init_pike_GLSL(); +  glsl = end_program(); +  glsl_module = clone_object(glsl, 0); +  add_object_constant("GLSL", glsl_module, 0); +  free_object(glsl_module); +  free_program(glsl); +  } + #endif /* HAVE_GLSL */ + #else /* !HAVE_GL */ +  HIDE_MODULE();   #endif /* HAVE_GL */   }         PIKE_MODULE_EXIT   { -  + #ifdef HAVE_GLSL +  exit_pike_GLSL(); + #endif /* HAVE_GLSL */   }