Is SDL_CreateRenderer() necessary for GL code in SDL 1.3?

I’m working with SDL 1.3 on iPhone and practically speaking, it looks like GL isn’t initialized properly unless I call SDL_CreateRenderer(). I would have thought that since I’m not using the renderer, just calling SDL_CreateWindow() with the SDL_WINDOW_OPENGL flag would be sufficient, but in practice this isn’t enough, I have to also create the renderer.

Is this on purpose or is this just a quirk of the iPhone backend?

What do you mean, you’re not using the renderer? If you want to draw anything
into the window you’re creating, it involves using the renderer. The
SDL_WINDOW_OPENGL flag simply sets the window up so that it can work with the GL

renderer, and I think that’s actually optional in SDL 1.3. Not certain, but
IIRC if you create the renderer for a window without the GL flag, it checks for
that and sets it up for you.>________________________________

From: jlunderville
Subject: [SDL] Is SDL_CreateRenderer() necessary for GL code in SDL 1.3?

I’m working with SDL 1.3 on iPhone and practically speaking, it looks like GL
isn’t initialized properly unless I call SDL_CreateRenderer(). I would have
thought that since I’m not using the renderer, just calling SDL_CreateWindow()
with the SDL_WINDOW_OPENGL flag would be sufficient, but in practice this isn’t

enough, I have to also create the renderer.

Is this on purpose or is this just a quirk of the iPhone backend?

Mason Wheeler wrote:

What do you mean, you’re not using the renderer?

Well, this is what I’m uncertain about – there isn’t really any documentation that I could find explaining the design of SDL 1.3.

As I understand it, the job of the renderer is to handle the 2D SDL draw calls, but the codebase I’m working on doesn’t use that at all, it does all its rendering by making calls to gl* directly. When I’m done drawing, it calls SDL_GL_SwapWindow(), which AFAIK doesn’t actually flush the renderer. The SDL is only used to initialize the window and GL (and handle sound and input and etc., of course).

Hmm, I think I may have been missing a call to SDL_GL_CreateContext(). I added one and now the queries for GL extensions etc. aren’t failing, but I’m still seeing a blank screen… ?