[SDL] RE: Re: [SDL] OpenGL Textures

Bille2 bille2 at free.fr
Fri Aug 17 13:11:01 PDT 2001


So what is your solution if it is slow ... ??

"npguy Last Name" <npguy at my-deja.com> a écrit dans le message news:
mailman.997883044.11391.sdl at libsdl.org...
> ...slow!
>
> > Jacek iso-8859-2?Q?Pop=B3awski <jpopl at interia.pl> sdl at libsdl.org Re:
[SDL] OpenGL TexturesReply-To: sdl at libsdl.org
> >Date: Tue, 14 Aug 2001 05:22:11 +0200
> >
> >On Mon, Aug 13, 2001 at 02:10:21PM +1000, Adam Gates wrote:
> >> What is the best way to load image files into OpenGL textures?
> >> Should I use SDL_image to load it and then convert to an OpenGL
texture?
> >> (Anybody have code for that?)
> >
> > texture=IMG_Load("../deracer-data/road.png");
> > assert(texture!=NULL);
> >
> > glBindTexture(GL_TEXTURE_2D,textures[TextureRoad]);
> > glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
> > glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
> >
glTexImage2D(GL_TEXTURE_2D,0,3,texture->w,texture->h,0,GL_RGB,GL_UNSIGNED_BY
TE,texture->pixels);
> >
> > SDL_FreeSurface(texture);
> >
> >--
> >Turn round slowly
> >Tell us what you see
> >Oh no - The fly got the spider
> >And now he's chasing me                        "Otherworld" - Ronnie
James Dio
> >
> >_______________________________________________
> >SDL mailing list
> >SDL at libsdl.org
> >http://www.libsdl.org/mailman/listinfo/sdl
>
>
>
>
> ------------------------------------------------------------
> --== Sent via Deja.com ==--
> http://www.deja.com/
>





More information about the SDL mailing list