GLBasic forum

Main forum => Off Topic => Topic started by: Schranz0r on 2014-Jul-18

Title: OpenGL set a texture with non power of two
Post by: Schranz0r on 2014-Jul-18
Hey my friends,

i have a question about OpenGL:
If i try to set a texture (100x100 pixel) to  GL_QUADS it works fine.
But if i try to draw only 1/4 of the texture (25x25 pixel) it doesen't work anymore...

If i try a texture in Power of Two it works fine.

My head begins to explode :D

texturecoords are:

0, 0
0.25, 0
0.25, 0.25
0, 0.25


any ideas?
Title: Re: OpenGL set a texture with non power of two
Post by: MrTAToad on 2014-Jul-18
Perhaps there is a minimum size when a non-power-of-two graphic is used...
Title: Re: OpenGL set a texture with non power of two
Post by: kanonet on 2014-Jul-19
Yes there is a minimum texture size. When texturing something you should always use power of two size.
BTW I recommend to use GL_STRIP instead if GL_QUADS, since quads are not supported on mobiles and are generally considered outdated.
Title: Re: OpenGL set a texture with non power of two
Post by: Schranz0r on 2014-Jul-19
THX, i think i stay on power of 2 textures