我正在主线程中初始化我的OpenGL上下文(SDL/GLEW),但渲染是在不同的线程中完成的(例如
问题是,如果我调用
这可能是问题吗?
SDL_GL_SwapWindow
或glDrawElements
)。问题是,如果我调用
SDL_GL_SwapWindow
,什么都不会发生。我试图在每次交换后简单地改变清除颜色,但什么都没有发生。void render(){
// Rendering...
}
int main(){
// Initialization...
thread rendering(render);
}
这可能是问题吗?
wglMakeCurrent(...)
,glXMakeCurrent(...)
,aglMakeCurrent(...)
)。为此,即使像Qt这样包装OpenGL的框架也有makeCurrent(...)
方法。 - Andon M. Coleman