Find out which extensions are available for this renderer.
| 58 | |
| 59 | // Find out which extensions are available for this renderer. |
| 60 | void getGLCapabilities( ) |
| 61 | { |
| 62 | AssertFatal(platState.engine, "getGLCapabilities() was called before a monitor was chosen!"); |
| 63 | |
| 64 | // silently create an opengl context on the current display, |
| 65 | // so that we can get valid renderer and capability info. |
| 66 | // we save off the current context so that we can silently restore it. |
| 67 | // the user should not be aware of this little shuffle. |
| 68 | //CGLContextObj curr_ctx = CGLGetCurrentContext (); |
| 69 | //CGLContextObj temp_ctx = getContextForCapsCheck(); |
| 70 | /* |
| 71 | if(!temp_ctx) |
| 72 | { |
| 73 | Con::errorf("OpenGL may not be set up correctly!"); |
| 74 | return; |
| 75 | } |
| 76 | */ |
| 77 | //CGLSetCurrentContext(temp_ctx); |
| 78 | |
| 79 | // Get the OpenGL info strings we'll need |
| 80 | const char* pVendString = (const char*) glGetString( GL_VENDOR ); |
| 81 | const char* pRendString = (const char*) glGetString( GL_RENDERER ); |
| 82 | const char* pVersString = (const char*) glGetString( GL_VERSION ); |
| 83 | const char* pExtString = (const char*) glGetString( GL_EXTENSIONS ); |
| 84 | |
| 85 | // Output some driver info to the console: |
| 86 | Con::printf( "OpenGL driver information:" ); |
| 87 | if ( pVendString ) |
| 88 | Con::printf( " Vendor: %s", pVendString ); |
| 89 | if ( pRendString ) |
| 90 | Con::printf( " Renderer: %s", pRendString ); |
| 91 | if ( pVersString ) |
| 92 | Con::printf( " Version: %s", pVersString ); |
| 93 | |
| 94 | // pre-clear the structure |
| 95 | dMemset(&gGLState, 0, sizeof(gGLState)); |
| 96 | |
| 97 | if(pExtString) |
| 98 | { |
| 99 | // EXT_paletted_texture ======================================== |
| 100 | if (dStrstr(pExtString, (const char*)"GL_EXT_paletted_texture") != NULL) |
| 101 | gGLState.suppPalettedTexture = true; |
| 102 | |
| 103 | // EXT_compiled_vertex_array ======================================== |
| 104 | gGLState.suppLockedArrays = false; |
| 105 | if (dStrstr(pExtString, (const char*)"GL_EXT_compiled_vertex_array") != NULL) |
| 106 | gGLState.suppLockedArrays = true; |
| 107 | |
| 108 | // ARB_multitexture ======================================== |
| 109 | if (dStrstr(pExtString, (const char*)"GL_ARB_multitexture") != NULL) |
| 110 | gGLState.suppARBMultitexture = true; |
| 111 | |
| 112 | // EXT_blend_color |
| 113 | if(dStrstr(pExtString, (const char*)"GL_EXT_blend_color") != NULL) |
| 114 | gGLState.suppEXTblendcolor = true; |
| 115 | |
| 116 | // EXT_blend_minmax |
| 117 | if(dStrstr(pExtString, (const char*)"GL_EXT_blend_minmax") != NULL) |
no test coverage detected