Changeset 674 for trunk/src/lolgl.h


Ignore:
Timestamp:
Feb 21, 2011, 1:08:46 AM (9 years ago)
Author:
sam
Message:

The engine now builds for GL and GL ES 1.x and 2.x, and runs for each
one except GL ES 2.x for now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lolgl.h

    r673 r674  
    1717#define __DH_LOLGL_H__
    1818
     19#define GL_GLEXT_PROTOTYPES
     20
     21/* Only define one GL platform */
    1922#if defined HAVE_GL_1X
     23#   undef HAVE_GLES_1X
     24#endif
     25#if defined HAVE_GLES_2X
     26#   undef HAVE_GL_1X
     27#   undef HAVE_GLES_1X
     28#endif
     29#if defined HAVE_GL_2X
     30#   undef HAVE_GL_1X
     31#   undef HAVE_GLES_1X
     32#   undef HAVE_GLES_2X
     33#endif
     34
     35/* Include GL */
     36#if defined HAVE_GL_1X || defined HAVE_GL_2X
    2037#   if defined __APPLE__ && defined __MACH__
    2138#       include <OpenGL/gl.h>
     
    2643#elif defined HAVE_GLES_1X
    2744#   include <GLES/gl.h>
     45#   include <GLES/glext.h>
    2846#elif defined HAVE_GLES_2X
    29 #   include <GLES2/gl.h>
     47#   include <GLES2/gl2.h>
     48#   include <GLES2/gl2ext.h>
     49#endif
     50
     51/* Redefine some function names */
     52#if defined HAVE_GL_1X
     53#   define glClearDepthf glClearDepth
     54#elif defined HAVE_GL_2X
     55#   define glClearDepthf glClearDepth
     56#elif defined HAVE_GLES_1X
     57#   define glGenVertexArrays glGenVertexArraysOES
     58#   define glDeleteVertexArrays glDeleteVertexArraysOES
     59#elif defined HAVE_GLES_2X
     60#   define glGenVertexArrays glGenVertexArraysOES
     61#   define glDeleteVertexArrays glDeleteVertexArraysOES
     62#   define glBindVertexArray glBindVertexArrayOES
    3063#endif
    3164
Note: See TracChangeset for help on using the changeset viewer.