1 #ifndef GL_H
    2 #define GL_H
    3 
    4 #include <clib/tinygl_protos.h>
    5 
    6 #include <stddef.h>
    7 #include <inttypes.h>
    8 
    9 struct Library;
   10 
   11 #ifdef __cplusplus
   12 extern "C" {
   13 #endif
   14 
   15 /* Constants to pass to TGLSetContextVersion(). Note that passing a higher
   16  * version than the running tinygl.library supports will cause the value to
   17  * be ignored, so you have to check the version of tinygl.library before
   18  * deciding on which context version to use.
   19  *
   20  * libgl.a contains a function, TGLSetAutomaticContextVersion(), which will
   21  * choose the newest context version supported by both the SDK and the running
   22  * tinygl.library. Using this function is the preferred way to handle TinyGL
   23  * context versions.
   24  *
   25  * Calling TGLSetContextVersion() or TGLSetAutomaticContextVersion() is only
   26  * required if you open tinygl.library manually. When tinygl.library is being
   27  * automatically opened, then TGLSetAutomaticContextVersion() is also called
   28  * automatically. */
   29 #define TGL_CONTEXT_VERSION_53_0                                          0
   30 #define TGL_CONTEXT_VERSION_53_1                                          1
   31 #define TGL_CONTEXT_VERSION_53_9                                          2
   32 #define TGL_CONTEXT_VERSION_53_11                                         3
   33 
   34 #define TGL_CORRECT_NORMALS_HINT                                          0x1105
   35 #define TGL_LOWQUALITY_TEXTURES_HINT                                      0x1104
   36 
   37 
   38 #include <tgl/types.h>
   39 
   40 #define GL_RGB565                                                       0x8D62
   41 
   42 /* Some defines that some software depends on */
   43 #define GL_VERSION_1_0    1
   44 #define GL_VERSION_1_1    1
   45 #define GL_VERSION_1_2    1
   46 #define GL_VERSION_1_2_1  1
   47 #define GL_VERSION_1_3    1
   48 #define GL_VERSION_1_4    1
   49 #define GL_VERSION_1_5    1
   50 #define GL_VERSION_2_0    1
   51 #define GL_VERSION_2_1    1
   52 
   53 /* functions */
   54 
   55 unsigned int TGLGetMaximumContextVersion(struct Library *TinyGLBase);
   56 void TGLSetAutomaticContextVersion(struct Library *TinyGLBase, void *__tglContext);
   57 
   58 
   59 #ifndef _NO_PPCINLINE
   60 
   61 /*
   62  Real interface functions.
   63 */
   64 
   65 extern GLContext *__tglContext;
   66 
   67 
   68 #define glAInitializeContextWindowed(w) GLAInitializeContextWindowed(__tglContext, w)
   69 #define glADestroyContextWindowed() GLADestroyContextWindowed(__tglContext)
   70 #define glAInitializeContextScreen(w) GLAInitializeContextScreen(__tglContext, w)
   71 #define glADestroyContextScreen() GLADestroyContextScreen(__tglContext)
   72 #define glAInitializeContextBitMap(w) GLAInitializeContextBitMap(__tglContext, w)
   73 #define glADestroyContextBitMap() GLADestroyContextBitMap(__tglContext)
   74 #define glASwapBuffers() GLASwapBuffers(__tglContext)
   75 #define tglEnableNewExtensions(contextversion) TGLEnableNewExtensions(__tglContext, contextversion)
   76 #define tglGetProcAddress(name) TGLGetProcAddress(&__tglContext, name)
   77 
   78 #endif /* _NO_PPCINLINE */
   79 
   80 #ifdef __cplusplus
   81 }
   82 #endif
   83 
   84 #include <tgl/glstd.h>
   85 
   86 #endif /* GL_H */
   87