From b19c3ee65e7655fbb9ce71692751bfe31a4e8ada Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 11 Jul 2008 19:34:42 -0700 Subject: [PATCH] use single-precision floats in bunny vertex buffers for much better performance --- extra/bunny/model/model.factor | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/bunny/model/model.factor b/extra/bunny/model/model.factor index fce73785b5..6723f94353 100755 --- a/extra/bunny/model/model.factor +++ b/extra/bunny/model/model.factor @@ -2,7 +2,7 @@ USING: alien alien.c-types arrays sequences math math.vectors math.matrices math.parser io io.files kernel opengl opengl.gl opengl.glu io.encodings.ascii opengl.capabilities shuffle http.client vectors splitting system combinators -float-arrays continuations destructors namespaces sequences.lib +continuations destructors namespaces sequences.lib accessors ; IN: bunny.model @@ -66,7 +66,7 @@ TUPLE: bunny-buffers array element-array nv ni ; { [ [ first concat ] [ second concat ] bi - append >c-double-array + append >c-float-array GL_ARRAY_BUFFER swap GL_STATIC_DRAW ] [ @@ -86,10 +86,10 @@ M: bunny-dlist bunny-geom M: bunny-buffers bunny-geom dup { array>> element-array>> } get-slots [ { GL_VERTEX_ARRAY GL_NORMAL_ARRAY } [ - GL_DOUBLE 0 0 buffer-offset glNormalPointer + GL_FLOAT 0 0 buffer-offset glNormalPointer [ - nv>> "double" heap-size * buffer-offset - 3 GL_DOUBLE 0 roll glVertexPointer + nv>> "float" heap-size * buffer-offset + 3 GL_FLOAT 0 roll glVertexPointer ] [ ni>> GL_TRIANGLES swap GL_UNSIGNED_INT 0 buffer-offset glDrawElements