我正在创建一个 3D 游戏,我想知道如何混合使用 SDL2 软件(表面)渲染和 OpenGL。我尝试使用此代码呈现简单文本,但它不起作用。
glClearColor(0,0,1,1);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
SDL_BlitSurface(surf,0,dest,0);
SDL_GL_SwapWindow(win);
问题是什么?
最佳答案
I am taking about updating window surface via
SDL_UpdateWindowSurface
onSDL_Window
created withSDL_WINDOW_OPENGL
flag
那是 specifically prohibited by the API :
You may not combine this [SDL_GetWindowSurface] with 3D or the rendering API on this window.
关于c++ - 如何在 OpenGL 中使用 SDL2 软件渲染?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58732911/