glesv2 & gamnit: fix typos and minor issues
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 19 Aug 2017 20:33:16 +0000 (16:33 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sat, 19 Aug 2017 21:08:29 +0000 (17:08 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/gamnit/depth/more_materials.nit
lib/gamnit/dynamic_resolution.nit
lib/glesv2/glesv2.nit

index 3b320f9..bea40d5 100644 (file)
@@ -393,7 +393,7 @@ class BlinnPhongProgram
        # Should this program use the texture `map_diffuse`?
        var use_map_diffuse = uniforms["use_map_diffuse"].as(UniformBool) is lazy
 
-       # Diffuser texture unit
+       # Diffuse texture unit
        var map_diffuse = uniforms["map_diffuse"].as(UniformSampler2D) is lazy
 
        # Should this program use the texture `map_specular`?
index 97efba6..b40cdd0 100644 (file)
@@ -159,7 +159,7 @@ redef class App
        end
 end
 
-# Program drawing the dynamic screen to the real screen
+# Handles to reused GL buffers and texture
 private class DynamicContext
 
        # Real screen framebuffer
@@ -177,8 +177,6 @@ private class DynamicContext
        # Buffer name for vertex data
        var buffer_array: Int = -1
 
-       var float_per_vertex: Int is lazy do return 4 + 4 + 3
-
        # Prepare all attributes once per resolution change
        fun prepare_once(display: GamnitDisplay, max_dynamic_resolution_ratio: Float)
        do
@@ -248,7 +246,7 @@ private class DynamicContext
                # Depth
                glBindRenderbuffer(gl_RENDERBUFFER, depthbuffer)
                assert glIsRenderbuffer(depthbuffer)
-               glRenderbufferStorage(gl_RENDERBUFFER, gl_DEPTH_COMPNENT16, width, height)
+               glRenderbufferStorage(gl_RENDERBUFFER, gl_DEPTH_COMPONENT16, width, height)
                glFramebufferRenderbuffer(gl_FRAMEBUFFER, gl_DEPTH_ATTACHMENT, gl_RENDERBUFFER, depthbuffer)
                var gl_error = glGetError
                assert gl_error == gl_NO_ERROR else print_error gl_error
index 3c14238..7b02c8d 100644 (file)
@@ -755,7 +755,7 @@ fun gl_RGB565: GLRenderbufferFormat `{ return GL_RGB565; `}
 fun gl_RGB5_A1: GLRenderbufferFormat `{ return GL_RGB5_A1; `}
 
 # 16 depth bits format
-fun gl_DEPTH_COMPNENT16: GLRenderbufferFormat `{ return GL_DEPTH_COMPONENT16; `}
+fun gl_DEPTH_COMPONENT16: GLRenderbufferFormat `{ return GL_DEPTH_COMPONENT16; `}
 
 # 8 stencil bits format
 fun gl_STENCIL_INDEX8: GLRenderbufferFormat `{ return GL_STENCIL_INDEX8; `}
@@ -1206,6 +1206,7 @@ end
 fun gl_ALPHA: GLPixelFormat `{ return GL_ALPHA; `}
 fun gl_RGB: GLPixelFormat `{ return GL_RGB; `}
 fun gl_RGBA: GLPixelFormat `{ return GL_RGBA; `}
+fun gl_DEPTH_COMPONENT: GLPixelFormat `{ return GL_DEPTH_COMPONENT; `}
 
 # Set of buffers as a bitwise OR mask
 extern class GLBuffer `{ GLbitfield `}