Tweak to commit related to non-power-of-two textures, some cards claim to
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 31 Jul 2012 15:05:14 +0000 (15:05 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 31 Jul 2012 15:05:14 +0000 (15:05 +0000)
support this but actually don't, so use the function that checks for that.

source/blender/gpu/intern/gpu_draw.c
source/gameengine/Ketsji/BL_Texture.cpp

index 456e14c8401ddd1628e173e8b1e49a5dca924a7c..0ad271e90bd0e7161d8a00ef37b28296ee7f8c8c 100644 (file)
@@ -640,7 +640,7 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *pix, float * frect, int
        /* scale if not a power of two. this is not strictly necessary for newer
         * GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures 
         * Then don't bother scaling for hardware that supports NPOT textures! */
-       if (!GLEW_ARB_texture_non_power_of_two && (!is_pow2_limit(rectw) || !is_pow2_limit(recth))) {
+       if (!GPU_non_power_of_two_support() && (!is_pow2_limit(rectw) || !is_pow2_limit(recth))) {
                rectw= smaller_pow2_limit(rectw);
                recth= smaller_pow2_limit(recth);
                
index fee8047642d5533e55d91cf9a0938b5216ec78b4..e4e3fb95543d2e4f121c39eef41af60739095b8e 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "MEM_guardedalloc.h"
 #include "GPU_draw.h"
+#include "GPU_extensions.h"
 
 extern "C" {
        // envmaps
@@ -170,7 +171,7 @@ bool BL_Texture::InitFromImage(int unit,  Image *img, bool mipmap)
 
 void BL_Texture::InitGLTex(unsigned int *pix,int x,int y,bool mipmap)
 {
-       if (!GLEW_ARB_texture_non_power_of_two && (!is_power_of_2_i(x) || !is_power_of_2_i(y)) ) {
+       if (!GPU_non_power_of_two_support() && (!is_power_of_2_i(x) || !is_power_of_2_i(y)) ) {
                InitNonPow2Tex(pix, x,y,mipmap);
                return;
        }