]> gitweb.factorcode.org Git - factor.git/commitdiff
Don't use GL_ARB_texture_non_power_of_two on ATI hardware to fix bug reported by...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 10 Apr 2009 11:18:29 +0000 (06:18 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 10 Apr 2009 11:18:29 +0000 (06:18 -0500)
basis/opengl/capabilities/capabilities.factor
basis/opengl/textures/textures.factor
basis/ui/gadgets/worlds/worlds.factor

index 09d49b33c284645939a952a03696b9acb8babb60..ad04ce7fa5ce72547a841ab979f2a39636cba985 100755 (executable)
@@ -32,6 +32,8 @@ IN: opengl.capabilities
     (gl-version) drop ;
 : gl-vendor-version ( -- version )
     (gl-version) nip ;
+: gl-vendor ( -- name )
+    GL_VENDOR glGetString ;
 : has-gl-version? ( version -- ? )
     gl-version version-before? ;
 : (make-gl-version-error) ( required-version -- )
index a565a14597b2111e85ed48d3a7f41e2b9cabf6d5..76e0c473b91049e301a9ce253e3a3343a8817947 100755 (executable)
@@ -1,13 +1,23 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs cache colors.constants destructors fry kernel
-opengl opengl.gl combinators images images.tesselation grouping
-specialized-arrays.float sequences math math.vectors
-math.matrices generalizations fry arrays namespaces ;
+opengl opengl.gl opengl.capabilities combinators images
+images.tesselation grouping specialized-arrays.float sequences math
+math.vectors math.matrices generalizations fry arrays namespaces
+system ;
 IN: opengl.textures
 
 SYMBOL: non-power-of-2-textures?
 
+: check-extensions ( -- )
+    #! ATI frglx driver doesn't implement GL_ARB_texture_non_power_of_two properly.
+    #! See thread 'Linux font display problem' April 2009 on Factor-talk
+    gl-vendor "ATI Technologies Inc." = not os macosx? or [
+        "2.0" { "GL_ARB_texture_non_power_of_two" }
+        has-gl-version-or-extensions?
+        non-power-of-2-textures? set
+    ] when ;
+
 : gen-texture ( -- id ) [ glGenTextures ] (gen-gl-object) ;
 
 : delete-texture ( id -- ) [ glDeleteTextures ] (delete-gl-object) ;
index f671add531257750f8f308a6da0e281c9daad6f7..a186de76709cbe4197514c2f26f243665de07083 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs continuations kernel math models
-namespaces opengl opengl.capabilities opengl.textures sequences io
-combinators combinators.short-circuit fry math.vectors math.rectangles
-cache ui.gadgets ui.gestures ui.render ui.backend ui.gadgets.tracks
+namespaces opengl opengl.textures sequences io combinators
+combinators.short-circuit fry math.vectors math.rectangles cache
+ui.gadgets ui.gestures ui.render ui.backend ui.gadgets.tracks
 ui.commands ;
 IN: ui.gadgets.worlds
 
@@ -77,10 +77,6 @@ SYMBOL: flush-layout-cache-hook
 
 flush-layout-cache-hook [ [ ] ] initialize
 
-: check-extensions ( -- )
-    "2.0" { "GL_ARB_texture_non_power_of_two" } has-gl-version-or-extensions?
-    non-power-of-2-textures? set ;
-
 : (draw-world) ( world -- )
     dup handle>> [
         check-extensions