OpenGL Blit

I saw into testgl.c test file that SDL_OPENGLBLIT is obsolete. But I do
not think the way used in this file is the better way: the memory used
to keep the image is too hight (original width and height expanded to
powers of 2). Then, when glTexCoord2f() is called, the parameters are
1/(original width) and 1/(original height). Why all this?

And why SDL_OPENGLBLIT is obsolete? I’ve got 92.63 FPS with “./testgl
-logo” and 95.56 FPS with “./testgl -logoblit”.

Thanks.–
Lucas Clemente Vella
@Lucas_Clemente_Vella

I saw into testgl.c test file that SDL_OPENGLBLIT is obsolete. But I
do not think the way used in this file is the better way: the memory
used to keep the image is too hight (original width and height
expanded to powers of 2). Then, when glTexCoord2f() is called, the
parameters are
1/(original width) and 1/(original height). Why all this?

OpenGL only supports texture maps with dimensions that are powers of 2
by default. As I understand it there are OpenGL extensions that allow
arbitrary texture map dimensions. That explains the powers of 2
increase, and the “reciprocated” image dimensions.

And why SDL_OPENGLBLIT is obsolete? I’ve got 92.63 FPS with “./testgl
-logo” and 95.56 FPS with “./testgl -logoblit”.

I can’t answer this part of your question, I do not know.On Sep 11, 2004, at 4:25 PM, Lucas Clemente Vella wrote:

Thanks.


Lucas Clemente Vella
lvella at uai.com.br


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

You should try GL_TEXTURE_RECTANGLE_NV (or GL_TEXTURE_RECTANGLE_ARB)
to use non power of 2 textures. It is good for 2D.

This will help you:
http://oss.sgi.com/projects/ogl-sample/registry/NV/texture_rectangle.txt
http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_rectangle.txt---
Evgeny Bronnikov

Lucas Clemente Vella wrote:

I saw into testgl.c test file that SDL_OPENGLBLIT is obsolete. But I
do not think the way used in this file is the better way: the memory
used to keep the image is too hight (original width and height
expanded to powers of 2). Then, when glTexCoord2f() is called, the
parameters are
1/(original width) and 1/(original height). Why all this?

And why SDL_OPENGLBLIT is obsolete? I’ve got 92.63 FPS with “./testgl
-logo” and 95.56 FPS with “./testgl -logoblit”.

That thing has been obsolete for some time but people keep wanting to
use it. See this post :
http://twomix.devolution.com/pipermail/sdl/2001-November/039852.html
I’d like add a reason :

  • it messes with your OpenGL state (or the other way : if you mess with
    the OpenGL state it won’t work).

Stephane

Evgeny Bronikov wrote:

You should try GL_TEXTURE_RECTANGLE_NV (or GL_TEXTURE_RECTANGLE_ARB)
to use non power of 2 textures. It is good for 2D.

This will help you:
http://oss.sgi.com/projects/ogl-sample/registry/NV/texture_rectangle.txt
http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_rectangle.txt


Evgeny Bronnikov

How can I use this?
How can I see my OpenGL version on Linux (from XFree86-Mesa-libGL RedHat
RPM package)?–
Lucas Clemente Vella
@Lucas_Clemente_Vella