OpenGL and SDL mixture?

I would like to draw my game-GUI with the blit-functions of SDL and
display a 3d-view (OpenGL) in a rectangular area within. Is this
prossible? Can you mix the output of SDL and OpenGL calls?

+Beosil

— Geosil, an open-source WorldForge client – www.worldforge.org

Beosil wrote:

I would like to draw my game-GUI with the blit-functions of SDL and
display a 3d-view (OpenGL) in a rectangular area within. Is this
prossible? Can you mix the output of SDL and OpenGL calls?

Unfortunately, no. I rolled my own widget set in OpenGL which
displays the various widgets using an orthographic projection.

My 3d views are simply widgets whos paint methods use a perspective
projection.

I notice from your screenshots that you’ve already done a good
bit of GUI work. How are you currently rendering your GUI elements?

JW–
// John Watson
// Software Engineer – STScI Archive Team

I notice from your screenshots that you’ve already done a good
bit of GUI work. How are you currently rendering your GUI elements?

The GUI (like everything else) is rendered with OpenGL, but I have some
problems implementing window-skins in my GUI-system. Well, not really
problems, but the 2^n pixel texture-size and the unflexible
texture-repeat functionality in OpenGL gives me some headache :wink:

+Beosil

— Geosil, an open-source WorldForge client – www.worldforge.org

I would like to draw my game-GUI with the blit-functions of SDL and
display a 3d-view (OpenGL) in a rectangular area within. Is this
prossible? Can you mix the output of SDL and OpenGL calls?

+Beosil

Nope. However, really, there is no real reason to mix and match. Here’s why:

OpenGL’s texture system works, as I’m sure that you know, by uploading
textures from system memory to texture memory. SDL’s surfaces have no
locking function, ergo if we were to write an OpenGL blitter, we have no way
of really knowing if they’ve changed or not since the last blit, so we end
up re-uploading them each time. There are other issues related to having to
do mass quantities of matrix pushing/popping (the projection matrix, in
particular, would need to be pushed, calculated, and then popped each sprite
blit, since you can’t guarantee that it hasn’t changed), nastiness involving
blend modes, etc. Just manage it yourself. It’s simple and a lot less of a
headache.

Nicholas

----- Original Message -----
From: beosil@swileys.com (Beosil)
To: sdl at lokigames.com
Date: Friday, May 19, 2000 1:04 PM
Subject: [SDL] OpenGL and SDL mixture?