lib/glesv2: intro depth_range, depth_mask, polygon_offset & line_width
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 2 Jan 2015 20:50:40 +0000 (15:50 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 2 Jan 2015 21:30:56 +0000 (16:30 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/glesv2/glesv2.nit

index 54a9fcd..3e6ad1b 100644 (file)
@@ -425,6 +425,11 @@ class GLES
        # Set the viewport
        fun viewport(x, y, width, height: Int) `{ glViewport(x, y, width, height); `}
 
+       # Specify mapping of depth values from normalized device coordinates to window coordinates
+       #
+       # Default at `gl_depth_range(0.0, 1.0)`
+       fun depth_range(near, far: Float) `{ glDepthRangef(near, far); `}
+
        # Define front- and back-facing polygons
        #
        # Front-facing polygons are clockwise if `value`, counter-clockwise otherwise.
@@ -478,6 +483,15 @@ class GLES
        # Should always return `true` in OpenGL ES 2.0 and 3.0.
        fun shader_compiler: Bool do return get_bool(0x8DFA)
 
+       # Enable or disable writing into the depth buffer
+       fun depth_mask(value: Bool) `{ glDepthMask(value); `}
+
+       # Set the scale and units used to calculate depth values
+       fun polygon_offset(factor, units: Float) `{ glPolygonOffset(factor, units); `}
+
+       # Specify the width of rasterized lines
+       fun line_width(width: Float) `{ glLineWidth(width); `}
+
        # Set the texture minifying function
        #
        # Foreign: glTexParameter with GL_TEXTURE_MIN_FILTER