From bf8976b1775d0766c37ec918af9e4c69acf78b15 Mon Sep 17 00:00:00 2001 From: ikits Date: Wed, 24 Mar 2004 04:56:20 +0000 Subject: [PATCH] updated glew mx doc git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@252 783a27ee-832a-0410-bc00-9f386506c6dd --- doc/README.html | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/README.html b/doc/README.html index b8bd66b..e11b576 100644 --- a/doc/README.html +++ b/doc/README.html @@ -472,15 +472,26 @@ versions. To include multi-context support, you have to do the following:
    -
  1. Compile and use GLEW with the GLEW_MX preprocessor token defined.
  2. -
  3. Replace the global glewInit() call with glewContextInit(GLEWContext* ctx). Note, that ctx has to reside in global or thread-local memory.
  4. -
  5. Define the glewGetContext() macro or function that retrieves the GLEW context for the thread from which the OpenGL/WGL/GLX call is issued. The dispatch mechanism is primitive, but generic.
  6. +
  7. Compile and use GLEW with the GLEW_MX preprocessor token +defined.
  8. +
  9. For each rendering context, create a GLEWContext object +that will be available as long as the rendering context exists.
  10. +
  11. Define a macro or function called glewGetContext() that +returns a pointer to the GLEWContext object associated with +the rendering context from which OpenGL/WGL/GLX calls are +issued. (This dispatch mechanism is primitive, but generic.) +
  12. Replace the global glewInit() call with +glewContextInit(glewGetContext()). Note, that the +GLEWContext pointer returned by glewGetContext() has +to reside in global or thread-local memory. Also, remember to call +glewContextInit after creating the GLEWContext object +in each rendering context.
-

Note that according to Note that according to WGL documentation, you have to initialize the entry points for every -rendering context you create using pixel formats with different +rendering context you create that use pixel formats with different capabilities (for example the pixel formats provided by the generic software OpenGL implementation by Microsoft vs. the hardware accelerated pixel formats). GLEW by default ignores this @@ -492,7 +503,7 @@ same entry points and capabilities (and why would anyone want to use the software renderer when hardware acceleration is available?). This means that unless you use the multi-context version of GLEW, you need to call glewInit() only once in your program, or more -precisely, once per process. +precisely, once per process.