Wrapper for platform dependent creation of OpenGL rendering context, and conversions from
to OpenGL buffers.
|
Defines |
#define | GL_GLEXT_PROTOTYPES |
#define | GL_TEXTURE_RECTANGLE_EXT GL_TEXTURE_RECTANGLE_NV |
#define | GL_TESSCALLBACKPARAMS |
#define | GMLGL_CHECK_ERROR |
Typedefs |
typedef gmlGL_TContext_ * | gmlGL_TContext |
Functions |
GML_EXTERN_C gml_TError | gmlGL_Initialize () |
| Initialized gml_GL_Base error numbers. Users of gml_GL_Base function need not call this function as it will be called automatically.
|
GML_EXTERN_C void | gmlGL_ColorRGBAtoGL4usv (gml_TRGBColor *color, float alpha, GLushort *glColor) |
| Converts a gml_TRGBColor color and its transparency value alpha into a GL color encoded on an array of 4 unsigned short glColor (for use with glColor4usv).
|
GML_EXTERN_C void | gmlGL_ColorRGBAtoGL4fv (gml_TRGBColor *color, float alpha, GLfloat *glColor) |
| Converts a gml_TRGBColor color and its transparency value alpha into a GL color encoded on an array of 4 floats glColor (for use with glColor4fv).
|
GML_EXTERN_C gml_TBoolean | gmlGL_HasExtension (char *extension) |
| Check whether the current OpenGL context supports the argument extension, e.g. "GL_EXT_texture_rectangle".
|
GML_EXTERN_C gml_TError | gmlGL_GetTextureParamsFromEncoding (gml_TPixelEncoding enc, GLint *internal, GLenum *format, GLenum *type) |
GML_EXTERN_C gml_TError | gmlGL_SaveToBitmap (gml_TBitmap *bm) |
| Copy the current OpenGL context draw buffer to the bitmap bm with "glReadPixels". bm must have compatible specifications.
|
GML_EXTERN_C void | gmlGL_PlatformInitialize () |
| Perform platform-specific setup. This is called automatically by gmlGL_Initialize. In particular, create the sharing context (context 0).
|
GML_EXTERN_C gml_TError | gmlGL_FindVisual (gml_TDisplay display, gml_TVisual *visual) |
| Find a visual appropriate for an OpenGL context.
|
GML_EXTERN_C gml_TError | gmlGL_CreateContext (gml_TDisplay display, gml_TVisual visual, gml_TDrawable drawable, gmlGL_TContext *context) |
| Creates an OpenGL rendering context and attach it to the drawable drawable. Return the context handle in context. If drawable is NULL, the context may still be used for off-screen rendering. Note that all context share data (textures, display lists, etc.).
|
GML_EXTERN_C void | gmlGL_DeleteContext (gmlGL_TContext context) |
| Deletes an OpenGL rendering context. After the call, the sharing context is active.
|
GML_EXTERN_C gmlGL_TContext | gmlGL_GetCurrentContext () |
| Return the current OpenGL rendering context.
|
GML_EXTERN_C gml_TError | gmlGL_SetCurrentContext (gmlGL_TContext context) |
| Sets context as the current OpenGL rendering context. If context is NULL, the sharing context is used.
|
GML_EXTERN_C gml_TError | gmlGL_SwapBuffers (gmlGL_TContext context) |
| Swaps front and back buffer (double buffering). Note: gmlGL_SwapBuffer performs an implicit glFlush before it returns.
|
GML_EXTERN_C gml_TError | gmlGL_DrawableChanged (gmlGL_TContext context) |
| Update an Open GL rendering context after its drawable changed (resizing, window exposure...).
|
GML_EXTERN_C gml_TError | gmlGL_SetDrawableRect (gmlGL_TContext context, GLint top, GLint bottom, GLint width, GLint height) |
| Restricts OpenGL rendering in the context's drawable to a rectangle specified by its bottomleft corner and size.
|
Variables |
gml_TError | gmlGL_gErrCantChoosePixelFormat |
gml_TError | gmlGL_gErrCantCreateContext |
gml_TError | gmlGL_gErrCantAttachDrawable |
gml_TError | gmlGL_gErrCantSetCurrentContext |
gml_TError | gmlGL_gErrCantSwapBuffers |
gml_TError | gmlGL_gErrCantUpdateContextDrawable |
gml_TError | gmlGL_gErrWrongBMsize |
gml_TError | gmlGL_gErrUnsupportedBMencoding |
gml_TError | gmlGL_gErrUnknownContext |
gml_TError | gmlGL_gUnsupportedExtension |