GLAF
OpenGL Advanced Functionality
Context management
GLint glaf_InitializeContext(void) Allocates and initializes GLAF internal data for the current OpenGL context, and returns an unique ID which can be used for restoring this context's data with glaf_ReadyForContext(), or for freeing it with glaf_FreeContext(). Also calls glaf_ReadyForContext() for the new context, so GLAF is prepared for beginning using the new context. This function must be called once for each context the user plans to
use GLAF in. Each context must be created and
void glaf_ReadyForContext(GLint id) Makes GLAF ready for rendering into the context 'id'. The 'id' value should be the one that was returned when glaf_InitializeContext() was used to initialize the context that you want GLAF to be ready for rendering in. Note that you don't need to use this function if your application has just one context, since glaf_InitializeContext() will call this function for you when you initialize the context. However, using glaf_ReadyForContext() is mandatory for applications with several contexts, and must be called after you make each context current and before you do any call to GLAF functions in the context.
void glaf_FreeContext(GLint id) Free the context 'id'. The 'id' value should be the one that was returned when glaf_InitializeContext() was used to initialize the context that you want to free. After calling this function, the context 'id' is no longer usable, but note that the 'id' value can be reused by glaf_InitializeContext() if you create new contexts. This function is necessary for applications that create and destroy contexts dynamically. On the other hand, applications which create a fixed number of contexts at start-up don't need to use this function at all.
void glaf_SetVerbose(void funcptr(char *)) Sets a user-defined function for getting verbose messages when glaf_InitializeContext() is called. GLAF generates verbose message when calling glaf_InitializeContext() only. Your callback function should expect to get null-terminated strings without new-line characters. So, your callback should add the new-line character after printing the message. Otherwise, you'll print all the initialization messages in a single line. If 'funcptr' is NULL, no verbose messages will be generated, and any previously registered callback will be unregistered. Initially 'funcptr' is NULL, so if you want verbose messages, you need to call glaf_SetVerbose() before glaf_InitializeContext(). |
Copyright (C) 2001 César Blecua Udías