瀏覽代碼

Fix quads on computers supporting npot textures

Bart van Strien 14 年之前
父節點
當前提交
60128e1b06
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      src/modules/graphics/opengl/Quad.cpp

+ 8 - 2
src/modules/graphics/opengl/Quad.cpp

@@ -21,6 +21,9 @@
 #include "Quad.h"
 #include <common/Matrix.h>
 
+// GLee
+#include "GLee.h"
+
 // STD
 #include <cstring> // For memcpy
 
@@ -43,8 +46,11 @@ namespace opengl
 
 	void Quad::refresh(const Viewport & v, int sw, int sh)
 	{
-		sw = next_p2(sw);
-		sh = next_p2(sh);
+		if (GLEE_ARB_texture_non_power_of_two)
+		{
+			sw = next_p2(sw);
+			sh = next_p2(sh);
+		}
 		viewport = v;
 
 		vertices[0].x = 0;