Reputation: 1
I'm creating a 3D game and I'm wondering about how to mix SDL2 software (surface) render and OpenGL. I tried to render simple text using this code but it doesn't work.
glClearColor(0,0,1,1);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
SDL_BlitSurface(surf,0,dest,0);
SDL_GL_SwapWindow(win);
What is the issue?
Upvotes: 0
Views: 789
Reputation: 52162
I am taking about updating window surface via
SDL_UpdateWindowSurface
onSDL_Window
created withSDL_WINDOW_OPENGL
flag
That's specifically prohibited by the API:
You may not combine this [SDL_GetWindowSurface] with 3D or the rendering API on this window.
Upvotes: 4