Non power of 2 texture woes...

Started by
13 comments, last by PnP Bios 19 years, 4 months ago
glDrawPixels(MyNonPowerOfTwoImage);
-- I waz here --
Advertisement
Take a look at the SDL_ttf/OpenGL demo I put in the AGL forum. It deals with making a nonpower-of-2 image into a power of two one, and rendering it correctly. SDL_ttf OpenGL
Or :)

	// Check for some extensions.	Extensions = strdup((char*)glGetString(GL_EXTENSIONS));	if (strstr("GL_ARB_texture_rectangle", Extensions) == 0)	{		TextureType = GL_TEXTURE_RECTANGLE_ARB;	}        else        {                TextureType = GL_TEXTURE_2D;                DoYourPowerOf2FunctionThingHere();        }


Should do it I guess :P ( Works fine for me )
http://sourceforge.net/projects/pingux/ <-- you know you wanna see my 2D Engine which supports DirectX and OpenGL or insert your renderer here :)
Thanks everybody for the feedback. Like I have said, and what is fairly obvious from my post, I am realy kinda new to OpenGL. I have played with it in the past, but I never even got as far as lighting. I did some texture stuff, but that was about it for 3d. I will look into loading and checking for the extension.

Again, thanks.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
Quote:Original post by PinguinDude
Or :)

*** Source Snippet Removed ***

Should do it I guess :P ( Works fine for me )

So, PenguinDude, I have to do that for everywhere that needs GL_TEXTURE_2D, or just bind?
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One

This topic is closed to new replies.

Advertisement