Opengl screenshot

ok, it’s me again :wink:

i tried taking screenshots using the method from the manual (which is a little outdated -
SDL_CreateRGBSurface didn’t have the alpha parameter then) - anyway, the method
works, except that the image turns out to be upside down. I tried glPixelStorei with the
GL_PACK_LSB_FIRST flag in an attempt to correct things, but that didn’t help …

any ideas?--------------------------------------------------------------
Christian Zander ** N?ckersberg 76 ** 45257 Essen ** Germany
email: mbox at minion.de ** www: www.minion.de ** icq#: 5322926

phoenix at minion.de schrieb:

GL_PACK_LSB_FIRST flag in an attempt to correct things, but that didn’t help

OpenGL (as any math dude) puts the origin in the lower left corner as
opposed to the upper left one every graphics programmer assumes (it also
assumes 1.0 to be fully opaque…). There are some GL commands that
switch this behaviour (glViewport might help but I am not sure).

Daniel

In article <38C41660.BF5CBF50 at grafzahl.de>, Jonas wrote:

OpenGL (as any math dude) puts the origin in the lower left corner as
opposed to the upper left one every graphics programmer assumes (it also
assumes 1.0 to be fully opaque…). There are some GL commands that
switch this behaviour (glViewport might help but I am not sure).

Yes, I know that, and that’s why i tried modifying that behaviour with glPixelStorei, but
that function doesn’t really do what i need it to …--------------------------------------------------------------
Christian Zander ** N?ckersberg 76 ** 45257 Essen ** Germany
email: mbox at minion.de ** www: www.minion.de ** icq#: 5322926

phoenix at minion.de wrote:

Yes, I know that, and that’s why i tried modifying that behaviour with glPixelStorei, but
that function doesn’t really do what i need it to …

Aye, I’ve always just flipped my images manually, for
instance during texture loading. If you figure out how
to flip em with glPixelStorei, I’d like to know about it.

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

switch this behaviour (glViewport might help but I am not sure).

glOrtho() will allow you to do the mapping.

m.On Mon, Mar 06, 2000 at 09:34:40PM +0100, Jonas wrote:


Programmer "I wrote a song about dental floss,
Loki Entertainment Software but did anyone’s teeth get cleaner?"
http://lokigames.com/~briareos/ - Frank Zappa, re: the PMRC

Newsgroups: loki.open-source.sdl

ok, it’s me again :wink:

i tried taking screenshots using the method from the manual (which is a
little outdated -
SDL_CreateRGBSurface didn’t have the alpha parameter then) - anyway, the
method
works, except that the image turns out to be upside down. I tried
glPixelStorei with the
GL_PACK_LSB_FIRST flag in an attempt to correct things, but that didn’t
help …

any ideas?

It’s because of how GL handles its coordinate transforms… the most obvious
kludge is to read the things in with 480 (or so) glReadPixels calls
backwards… I just flip the screenshots. :slight_smile:

An update will be made… I have a few other things to correct too while
I’m at it…

Christian Zander ** N?ckersberg 76 ** 45257 Essen ** Germany

Nicholas

Nicholas Vining “While you’re out there struggling
vining at pacificcoast.net with your computer, I’m naked,
icq: 20872003 clueless, and feeling good!”
- Ratbert

----- Original Message -----
From: phoenix at minion.de (phoenix@minion.de)
To: sdl at lokigames.com
Date: Monday, March 06, 2000 11:58 AM
Subject: [SDL] opengl screenshot

In article <20000306142040.L4617 at namaste.lokigames-lan.com>, Michael Vance wrote:> On Mon, Mar 06, 2000 at 09:34:40PM +0100, Jonas wrote:

switch this behaviour (glViewport might help but I am not sure).

glOrtho() will allow you to do the mapping.

He he, thanks - that’s what I love about the internet - people who know their
business are just a click away :wink:


Christian Zander ** N?ckersberg 76 ** 45257 Essen ** Germany
email: mbox at minion.de ** www: www.minion.de ** icq#: 5322926

In article <20000306142040.L4617 at namaste.lokigames-lan.com>, Michael Vance
wrote:>> On Mon, Mar 06, 2000 at 09:34:40PM +0100, Jonas wrote:

switch this behaviour (glViewport might help but I am not sure).

glOrtho() will allow you to do the mapping.

He he, thanks - that’s what I love about the internet - people who know their
business are just a click away :wink:

Isn’t he great? Michael’s just my special hero. :slight_smile:

On a more relevant technical note, just remember to only convert the matrix
during the screenshot and to restore it… Michael’s not very clear on this.
Otherwise, all hell will break loose and you will be stuck trying to figure out
what’s going on.

Nichola

In article <8a2m8i$qkv$1 at ftp.lokigames.com>, @Christian_Zander wrote:

In article <20000306142040.L4617 at namaste.lokigames-lan.com>, Michael Vance wrote:

switch this behaviour (glViewport might help but I am not sure).

glOrtho() will allow you to do the mapping.

Since I’m doing 3d stuff, i figured using glFrustum could do the trick - it does.

Now i will only have to figure out a way to replace glXUseXFont to make the thing
more portable and allow the descriptive text to be flipped as well …

I guess i’ll go with flipped screens for now …>> On Mon, Mar 06, 2000 at 09:34:40PM +0100, Jonas wrote:


Christian Zander ** N?ckersberg 76 ** 45257 Essen ** Germany
email: mbox at minion.de ** www: www.minion.de ** icq#: 5322926