GL Texture mapping + SDL

Hello,
I was wondering if it is possible to use SDL_LoadBMP() to load an
image for gl texture mapping? If so how do i send the info to
glGenTextures()? It seems like it should be possible… I am trying to
avoid using GL/glaux if I can :slight_smile: Thanks in advance for your help.
Sam Reynolds
cloudboi

Sam Reynolds wrote:

Hello,
I was wondering if it is possible to use SDL_LoadBMP() to load an
image for gl texture mapping? If so how do i send the info to
glGenTextures()? It seems like it should be possible… I am trying to
avoid using GL/glaux if I can :slight_smile: Thanks in advance for your help.
Sam Reynolds
cloudboi

Yes, it’s possible. Just load a bitmap file, convert the surface to the
desired pixel format, and grab the raw pixel data from the
surface.pixels member. Then set it up like any other GL texture.

-John

Look in the OGL tutorials on the SDL site, you have to convert the image
a bit after you load it. So you can’t just use SDL_LoadBMP()

At 03:01 PM 7/16/00 -0500, you wrote:

Hello,
I was wondering if it is possible to use SDL_LoadBMP() to load an
image for gl texture mapping? If so how do i send the info to
glGenTextures()? It seems like it should be possible… I am trying to
avoid using GL/glaux if I can :slight_smile: Thanks in advance for your help.
Sam Reynolds
cloudboi

-Garrett, http://www.wpi.edu/~mongoose/
“Do not go where the path may lead, go instead where there is no path and
leave a trail.”
-Ralph Waldo Emerson

Garrett Banuk schrieb am 16 Jul 2000:

Look in the OGL tutorials on the SDL site, you have to convert the image
a bit after you load it. So you can’t just use SDL_LoadBMP()

At 03:01 PM 7/16/00 -0500, you wrote:

Hello,
I was wondering if it is possible to use SDL_LoadBMP() to load an
image for gl texture mapping? If so how do i send the info to
glGenTextures()? It seems like it should be possible… I am trying to
avoid using GL/glaux if I can :slight_smile: Thanks in advance for your help.

A simple example can be found at
http://www.ards.net/Andreas/sdl_textures.html

  • Andreas–
    Check out my 3D lightcycle game: http://www.gltron.org
    More than 60’000 Downloads of the latest version (0.59)

You actually can pass it directly if you fiddle with the source format
flags a bit. OpenGL 1.2 is more flexible in this regard.On Sun, Jul 16, 2000 at 05:03:06PM -0400, Garrett Banuk wrote:

Look in the OGL tutorials on the SDL site, you have to convert the image
a bit after you load it. So you can’t just use SDL_LoadBMP()

–
Daniel Vogel
Programmer
Loki Entertainment Software

Many thanks to all who replied!
Sam Reynolds
cloudboiOn Mon, 17 Jul 2000, Andreas Umbach wrote:

Garrett Banuk schrieb am 16 Jul 2000:

Look in the OGL tutorials on the SDL site, you have to convert the image
a bit after you load it. So you can’t just use SDL_LoadBMP()

At 03:01 PM 7/16/00 -0500, you wrote:

Hello,
I was wondering if it is possible to use SDL_LoadBMP() to load an
image for gl texture mapping? If so how do i send the info to
glGenTextures()? It seems like it should be possible… I am trying to
avoid using GL/glaux if I can :slight_smile: Thanks in advance for your help.

A simple example can be found at
http://www.ards.net/Andreas/sdl_textures.html

  • Andreas
    –
    Check out my 3D lightcycle game: http://www.gltron.org
    More than 60’000 Downloads of the latest version (0.59)