38955603a91f — Leonard Ritter 3 months ago
* fixed launch-tukan
3 files changed, 17 insertions(+), 5 deletions(-)

M tukan/gl.sc
M tukan/view/blocktree.sc
M tukan/view/shader.sc
M tukan/gl.sc +12 -0
@@ 232,6 232,17 @@ typedef GLprogram < GLobject :: GLuint
 
 #-------------------------------------------------------------------------------
 
+using GL filter "^(Create|Delete)Framebuffers$"
+
+typedef GLframebuffer < GLobject :: GLuint
+    inline __typecall (cls)
+        bitcast (gen1 CreateFramebuffers) this-type
+
+    inline __drop (self)
+        del1 DeleteFramebuffers self
+
+#-------------------------------------------------------------------------------
+
 inline error-message-func (msg)
     inline ()
         static-error msg

          
@@ 249,6 260,7 @@ let GL =
             inline ()
                 GLtexture GL_TEXTURE_2D
         Buffer = GLbuffer
+        Framebuffer = GLframebuffer
         Query = GLquery
         QueryTimeElapsed =
             inline ()

          
M tukan/view/blocktree.sc +1 -1
@@ 4,7 4,7 @@ using import struct
 using import enum
 using import Option
 using import Array
-using import Map
+using import Set
 using import Box
 using import Rc
 

          
M tukan/view/shader.sc +4 -4
@@ 66,7 66,7 @@ fn make-shaderview ()
     let screen = (Screen)
 
     print "setting up texture..."
-    let fbtex = (GL.CreateTexture GL.TEXTURE_2D)
+    let fbtex = (GL.Texture GL.TEXTURE_2D)
     'setup (view fbtex)
         size = fbsize
         format = GL.RGBA8

          
@@ 75,17 75,17 @@ fn make-shaderview ()
     GL.ClearTexImage (view fbtex) 0 GL.RGBA GL.UNSIGNED_BYTE (bitcast &color (pointer void))
 
     print "setting up framebuffer..."
-    let fb = (GL.CreateFramebuffer)
+    let fb = (GL.Framebuffer)
     setup-framebuffer (view fb)
         color = (view fbtex)
 
     print "building shaders"
 
-    let globals-data = (GL.CreateBuffer)
+    let globals-data = (GL.Buffer)
     setup-ubo globals-data shglobals BUFFER_COUNT
 
     print "attaching shaders..."
-    let pg-test = (GL.CreateProgram)
+    let pg-test = (GL.Program)
     call
         attach-shaders pg-test
             vertex = test-vertex