Home >Backend Development >C++ >Is the current OpenGL initialization and exit code suitable for Intel HD 3000, and are there better ways to manage multiple OpenGL contexts?
Problem:
On an Intel HD 3000 graphics card, creating multiple OpenGL contexts in a single application leads to unpredictable behavior:
Current Initialization and Exit Code:
<code class="c++">// Initialization code int OpenGLscreen::init(void *f, int textures) { // ... hrc = wglCreateContext(hdc); // ... if(wglMakeCurrent(hdc, hrc) == false) { // ... } // ... } // Exit code void OpenGLscreen::exit() { if (!_init) return; wglMakeCurrent(hdc,hrc); // use this context if multiple OpenGLs are used // ... wglMakeCurrent(NULL, NULL); // release current rendering context wglDeleteContext(hrc); // destroy rendering context hrc=NULL; _init=0; }</code>
Questions:
Answer:
The above is the detailed content of Is the current OpenGL initialization and exit code suitable for Intel HD 3000, and are there better ways to manage multiple OpenGL contexts?. For more information, please follow other related articles on the PHP Chinese website!