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:
parent
c84f7085ca
commit
14906d2293
1 changed files with 11 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue