Hi everyone,
In the testgl program distributed with SDL 1.1, the spinning cube is blitted
using SDL_GL_SwapBuffers( ). On my system running X Windows, this
function is invoked using X11_GL_SwapBuffers, which in
turn calls glXSwapBuffers, which seems to be part of Mesa3D.
What I would like to do, instead of treating the entire video surface
as an OpenGL buffer, is to have a small SDL surface (say 64x64 pixels).
On this surface, I could then place a textured, spinning OpenGL cube
against a black background; then by treating black as the key color
I could blit this spinning OpenGL cube onto my main SDL surface; the effect
would be a textured spinning cube moving around as any sprite would
do.
The example included in SDL 1.1 doesn’t address this. Does anyone
know of any sample code or tutorials that explain the proper method to
use to accomplish this?–
Steve Madsen
H2Eye Ltd.
24-28 Hatton Wall
London EC1N 8JH
United Kingdom (UK)
Tel: +44 (0) 207 404 9600
Fax: +44 (0) 207 404 9490
Email: @Steve_Madsen
hi`
Nicholas Vining wrote:
What you would need to do is use Mesa 3D’s offscreen rendering context
generator. Basically, you’d end up bypassing all of SDL’s GL implementation
code. You’d set up an OSMesa context yourself, render to it, then dump data
from that into the SDL surface and then blit it. My advice to you is that
Very ugly. a) it is slow and b) only works with Mesa. If you want to use
OpenGL and 2D blitting do it as I wrote in a mail before. Preblit stuff
to one surface and then blit the final image using OpenGL (using
glTexSubImage2D or glDrawImage (if you are on a SGI ;)))
you should either pre-render the cube and then just blit it as a normal sort
of sprite, or to go 100% OpenGL. The two systems – SDL and OpenGL – do not
blend very well; if you try to make them blend, you will get into nasty
kludges and piles of smoking code. You could also just write your own
rotation and blitting engine.
Nope. I guess I should write a little demo showing this stuff with SDL
and ClanLib. Well, I will do so once carneval is over.
OpenGL and 2D games don’t mix. This has been proven time and time again…
Wrong - all that is proven is that glDrawPixel seriously sucks on
consumer HW and drivers.–
Daniel Vogel My opinions may have changed,
666 @ http://grafzahl.de but not the fact that I am right
hi`
Nicholas Vining wrote:
What you would need to do is use Mesa 3D’s offscreen rendering context
generator. Basically, you’d end up bypassing all of SDL’s GL implementation
code. You’d set up an OSMesa context yourself, render to it, then dump data
from that into the SDL surface and then blit it. My advice to you is that
Very ugly. a) it is slow and b) only works with Mesa. If you want to use
OpenGL and 2D blitting do it as I wrote in a mail before. Preblit stuff
to one surface and then blit the final image using OpenGL (using
glTexSubImage2D or glDrawImage (if you are on a SGI ;)))
He said he wanted to use SDL_Surfaces, not glTexSubImage2D. My understanding
was that he wanted to use a SDL video mode, but then render GL primitives into
a buffer that he could then use with SDL_Blitwhatever.
And I wish I was working on an SGI.
OpenGL and 2D games don’t mix. This has been proven time and time again…
Wrong - all that is proven is that glDrawPixel seriously sucks on
consumer HW and drivers.
Possibly that should be “2D surfaces”. Let’s face it, though – OpenGL is a 3D
API. Note the “3D”. Anytime I want to use 3D primitives in a 2D game, IMHO I
am better off (as far as speed and anti-kludginess are concerned) to simply
sit down for five hours in front of NASM and bash myself out some simple matrix
rotation/translation/perspective correction routines and triangle blitters.
Faster, better, nicer, less kludgey.
Apparantely Sam has a 3D graphics library for SDL that he built and never
released.
Daniel Vogel My opinions may have changed,
Nich
Apparantely Sam has a 3D graphics library for SDL that he built and never
released.
What?
-Sam Lantinga (slouken at devolution.com)
Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec
Apparantely Sam has a 3D graphics library for SDL that he built and never
released.
What?
It’s somewhere in my mail archives. You said that you had written a 3D
library for SDL with gouraud shaded polygons and Z buffering that you were
going to release sometime soon. That was about a month ago.
Nope, not me.
-Sam Lantinga (slouken at devolution.com)
Lead Programmer, Loki Entertainment Software> -----Original Message-----
From: Sam Lantinga
To: sdl at lokigames.com
Date: Thursday, March 02, 2000 1:15 PM
Subject: Re: [SDL] OpenGL sprites?
–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec
vining at pacificcoast.net schrieb am 02 Mar 2000:
Possibly that should be “2D surfaces”. Let’s face it, though – OpenGL is a 3D
API. Note the “3D”. Anytime I want to use 3D primitives in a 2D game, IMHO I
am better off (as far as speed and anti-kludginess are concerned) to simply
sit down for five hours in front of NASM and bash myself out some simple matrix
rotation/translation/perspective correction routines and triangle blitters.
Faster, better, nicer, less kludgey.
Anyone interested in this should check out http://www.tutok.sk/fastgl/
No need to reinvent the wheel. Just help to integrate this baby into
SDL.
- Andreas–
Probably one of the smallest 3D-Games in the world: http://www.gltron.org
More than 50’000 Downloads of the latest version (0.53)
vining at pacificcoast.net wrote:
He said he wanted to use SDL_Surfaces, not glTexSubImage2D. My understanding
was that he wanted to use a SDL video mode, but then render GL primitives into
a buffer that he could then use with SDL_Blitwhatever.
glReadPixels… it is as slow as that OSMesa stuff.
And I wish I was working on an SGI.
bzflag runs very nice on them ;—)
Wrong - all that is proven is that glDrawPixel seriously sucks on
consumer HW and drivers.
Possibly that should be “2D surfaces”. Let’s face it, though – OpenGL is a 3D
API. Note the “3D”. Anytime I want to use 3D primitives in a 2D game, IMHO I
Did you ever have a look at how much 2D is in the OpenGL API?
am better off (as far as speed and anti-kludginess are concerned) to simply
sit down for five hours in front of NASM and bash myself out some simple matrix
rotation/translation/perspective correction routines and triangle blitters.
I doubt that.
Faster, better, nicer, less kludgey.
Okay, I should simply sit down and write some code which I will do next
week to demonstrate what I think (oh, oh, another promise/ deadline ;)).
Should work as a nice tutorial/ demonstration for both SDL and ClanLib.
2D done right can be quite cool with OpenGL.–
Daniel Vogel My opinions may have changed,
666 @ http://grafzahl.de but not the fact that I am right
(sorry it is carnevel season and I am rather drunk)
Okay, I should simply sit down and write some code which I will do next
week to demonstrate what I think (oh, oh, another promise/ deadline ;)).
Should work as a nice tutorial/ demonstration for both SDL and ClanLib.
2D done right can be quite cool with OpenGL.
Sounds great!
-Sam Lantinga (slouken at devolution.com)
Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec
“Andreas Umbach” wrote in message
news:20000303010434.A3297 at tulpe.ards.dataway.ch…
vining at pacificcoast.net schrieb am 02 Mar 2000:
Possibly that should be “2D surfaces”. Let’s face it, though – OpenGL
is a _3D
API_. Note the “3D”. Anytime I want to use 3D primitives in a 2D game,
IMHO I
am better off (as far as speed and anti-kludginess are concerned) to
simply
sit down for five hours in front of NASM and bash myself out some simple
matrix
rotation/translation/perspective correction routines and triangle
blitters.
Faster, better, nicer, less kludgey.
Anyone interested in this should check out http://www.tutok.sk/fastgl/
No need to reinvent the wheel. Just help to integrate this baby into
SDL.
No. That is strict GPL, so it cannot be integrated with SDL.
Regards
Amedeo
Anyone interested in this should check out http://www.tutok.sk/fastgl/
No need to reinvent the wheel. Just help to integrate this baby into
SDL.
No. That is strict GPL, so it cannot be integrated with SDL.
Regards
Amedeo
NO! IT IS LGPL!!! (see license.txt in the OpenGUI root directory)