1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added flag JUCE_OPENGL_ALLOW_NON_POWER_OF_TWO_TEXTURES

This commit is contained in:
jules 2014-02-12 10:27:43 +00:00
parent c84f7085ca
commit 14906d2293

View file

@ -22,6 +22,15 @@
==============================================================================
*/
static int getAllowedTextureSize (int x)
{
#if JUCE_OPENGL_ALLOW_NON_POWER_OF_TWO_TEXTURES
return x;
#else
return nextPowerOfTwo (x);
#endif
}
OpenGLTexture::OpenGLTexture()
: textureID (0), width (0), height (0), ownerContext (nullptr)
{
@ -65,8 +74,8 @@ void OpenGLTexture::create (const int w, const int h, const void* pixels, GLenum
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
JUCE_CHECK_OPENGL_ERROR
width = nextPowerOfTwo (w);
height = nextPowerOfTwo (h);
width = getAllowedTextureSize (w);
height = getAllowedTextureSize (h);
const GLint internalformat = type == GL_ALPHA ? GL_ALPHA : GL_RGBA;