Don't use GL_ARB_texture_non_power_of_two on ATI hardware to fix bug reported by Andy Turner and Caesar Hu
parent
2b26da1ad2
commit
713ab02337
|
@ -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 -- )
|
||||
|
|
|
@ -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) ;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue