]> gitweb.factorcode.org Git - factor.git/commitdiff
opengl.textures: borrow get-texture-float and get-texture-int helper words from gpu...
authorJoe Groff <arcata@gmail.com>
Sat, 15 May 2010 19:09:50 +0000 (12:09 -0700)
committerJoe Groff <arcata@gmail.com>
Sat, 15 May 2010 19:09:50 +0000 (12:09 -0700)
basis/opengl/textures/textures.factor
extra/gpu/textures/textures.factor

index 9284a151f5bb24b6f06d751070d063995c54eee7..2341706f4c21bafbc552b0cc349cf0f5e9bcd323 100644 (file)
@@ -5,7 +5,7 @@ kernel opengl opengl.gl opengl.capabilities combinators images
 images.tesselation grouping sequences math math.vectors
 generalizations fry arrays namespaces system
 locals literals specialized-arrays ;
-FROM: alien.c-types => float ;
+FROM: alien.c-types => float <float> <int> *float *int ;
 SPECIALIZED-ARRAY: float
 IN: opengl.textures
 
@@ -404,3 +404,9 @@ PRIVATE>
     over dim>> max-texture-size [ <= ] 2all?
     [ <single-texture> ]
     [ [ max-texture-size tesselate ] dip <multi-texture> ] if ;
+
+: get-texture-float ( target level enum -- value )
+    0 <float> [ glGetTexLevelParameterfv ] keep *float ; inline
+: get-texture-int ( target level enum -- value )
+    0 <int> [ glGetTexLevelParameteriv ] keep *int ; inline
+
index 132e4303e7bb88ff1b111743fb938592dc668fc2..a240aae9452163ff3d4d40cfa2742402c7a669f5 100644 (file)
@@ -176,11 +176,6 @@ M: cube-map-face     texture-data-gl-target
     texture [ texture-gl-target ] [ handle>> ] bi glBindTexture
     texture ; inline
 
-: get-texture-float ( target level enum -- value )
-    0 <float> [ glGetTexLevelParameterfv ] keep *float ; inline
-: get-texture-int ( target level enum -- value )
-    0 <int> [ glGetTexLevelParameteriv ] keep *int ; inline
-
 : ?product ( x -- y )
     dup number? [ product ] unless ; inline