Merged changes in the trunk up to revision 42116.
[blender.git] / source / gameengine / VideoTexture / Texture.cpp
index e1ddd7fce1e2c5342ceadd46c5695383130c5a6e..40e9f899ef098a95e573cb863681eccf619d9aef 100644 (file)
@@ -329,7 +329,17 @@ PyObject * Texture_refresh (Texture * self, PyObject * args)
                                        // get texture size
                                        short * orgSize = self->m_source->m_image->getSize();
                                        // calc scaled sizes
-                                       short size[] = {ImageBase::calcSize(orgSize[0]), ImageBase::calcSize(orgSize[1])};
+                                       short size[2];
+                                       if (GLEW_ARB_texture_non_power_of_two)
+                                       {
+                                               size[0] = orgSize[0];
+                                               size[1] = orgSize[1];
+                                       }
+                                       else
+                                       {
+                                               size[0] = ImageBase::calcSize(orgSize[0]);
+                                               size[1] = ImageBase::calcSize(orgSize[1]);
+                                       }
                                        // scale texture if needed
                                        if (size[0] != orgSize[0] || size[1] != orgSize[1])
                                        {