mrkubax10
mrkubax10

Reputation: 1

How to use SDL2 software render with OpenGL?

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

Answers (1)

genpfault
genpfault

Reputation: 52162

I am taking about updating window surface via SDL_UpdateWindowSurface on SDL_Window created with SDL_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

Related Questions