-
Notifications
You must be signed in to change notification settings - Fork 0
Initializing the renderer
Unlike renderXF, there is no need to initialize anything, as XFDraw uses a static class called GL
.
It is recommended to call GL.Initialize();
to perform compatibility checks and DLL importing during startup, instead of a less convenient time where the first GL
method is called.
This method essentially blits a texture (which can be a framebuffer) onto a form provided in BlitData class.
This method clears a selected texture (or framebuffer) with a specific color. It is very fast.
This method clears a selected texture (or framebuffer) with zeroes.
XFDraw support Wireframe and triangle modes.
GLMode | Implemented | Description |
---|---|---|
GLMode.Triangle | Yes | Triangle |
GLMode.Wireframe | Yes | Wireframe |
GLMode.TriangleWireLate | Yes | Triangle and Wireframe |
GLMode.TriangleSingle | No | Triangle but the shader is called only once |
GLMode.Line | No | Line rendering mode |
Example code:
GL.Draw(vertexBuffer, yourShader, depthBuffer, projectionMatrix, GLMode.Triangle);
//Or
GL.Draw(vertexBuffer, yourShader, depthBuffer, projectionMatrix, GLMode.Triangle, startIndex, stopIndex);
Wireframe and TriangleWireframe support depth offsets. TriangleWireframe is a special effect which makes it more convenient to draw a wireframe at the end of a draw command. This saves an entire vertex stage and XYZ to XY transform stage during a draw command making it faster than calling the two one after the other.
GLMode.TriangleSingle does not support using gl_FragCoord
, gl_FragDepth
or gl_FragPos
as its not sampled per pixel basis, but rather a per triangle. This is very useful for vertex attributes that stay constant for the entire triangle face, as this method saves performance.