- # Clear the color buffer to `red`, `green`, `blue` and `alpha`
- fun clear_color(red, green, blue, alpha: Float) `{
- glClearColor(red, green, blue, alpha);
- `}
-
- # 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.
- fun front_face=(value: Bool) `{ glFrontFace(value? GL_CW: GL_CCW); `}
-
- # Specify whether front- or back-facing polygons can be culled, default is `back` only
- #
- # One or both of `front` or `back` must be `true`. If you want to deactivate culling
- # use `(new GLCap.cull_face).disable`.
- #
- # Require: `front or back`
- fun cull_face(front, back: Bool)
- do
- assert not (front or back)
- cull_face_native(front, back)
- end
-
- private fun cull_face_native(front, back: Bool) `{
- glCullFace(front? back? GL_FRONT_AND_BACK: GL_BACK: GL_FRONT);
- `}
-
- # Clear the `buffer`
- fun clear(buffer: GLBuffer) `{ glClear(buffer); `}
-
- # Last error from OpenGL ES 2.0
- fun error: GLError `{ return glGetError(); `}
-