summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/render/gl.scm3
-rw-r--r--chickadee/render/gpu.scm10
2 files changed, 12 insertions, 1 deletions
diff --git a/chickadee/render/gl.scm b/chickadee/render/gl.scm
index 0781048..06c20e7 100644
--- a/chickadee/render/gl.scm
+++ b/chickadee/render/gl.scm
@@ -305,7 +305,8 @@ object.")
;;; Context Queries
;;;
-(re-export (%glGetString . gl-get-string))
+(re-export (%glGetString . gl-get-string)
+ (%glGetIntegerv . gl-get-integer-v))
;;;
diff --git a/chickadee/render/gpu.scm b/chickadee/render/gpu.scm
index e01486d..8921062 100644
--- a/chickadee/render/gpu.scm
+++ b/chickadee/render/gpu.scm
@@ -35,6 +35,7 @@
gpu-gl-context
gpu-gl-version
gpu-glsl-version
+ gpu-max-texture-size
gpu-blend-mode
gpu-depth-test
gpu-stencil-test
@@ -100,6 +101,7 @@ from the GPU's memory."
(%make-gpu gl-context
gl-version
glsl-version
+ max-texture-size
blend-mode
depth-test
stencil-test
@@ -113,6 +115,7 @@ from the GPU's memory."
(gl-context gpu-gl-context)
(gl-version gpu-gl-version)
(glsl-version gpu-glsl-version)
+ (max-texture-size gpu-max-texture-size)
(blend-mode %gpu-blend-mode)
(depth-test %gpu-depth-test)
(stencil-test %gpu-stencil-test)
@@ -125,6 +128,12 @@ from the GPU's memory."
(define current-gpu (make-parameter #f))
+(define (max-texture-size)
+ (let ((bv (make-s32vector 1)))
+ (gl-get-integer-v (get-p-name max-texture-size)
+ (bytevector->pointer bv))
+ (s32vector-ref bv 0)))
+
(define (make-gpu gl-context)
(define (extract-version attr)
(car (string-split (pointer->string (gl-get-string attr)) #\space)))
@@ -152,6 +161,7 @@ from the GPU's memory."
(%make-gpu gl-context
gl-version
glsl-version
+ (max-texture-size)
(make-gpu-state (module-ref blend-module 'apply-blend-mode)
'replace)
(make-gpu-state (module-ref depth-module 'apply-depth-test) #f)