-
Notifications
You must be signed in to change notification settings - Fork 4
6. Drawing an object
theproadam edited this page Apr 8, 2020
·
1 revision
With a buffer and a shader initialized, all you have to do is select a shader and a buffer, and then draw it to the screen.
Use SelectShader()
and SelectBuffer()
to select your shaders, then once both are selected, just use the Draw()
function to draw to the drawing buffer.
GL.SelectShader(myShader);
GL.SelectBuffer(myBuffer);
GL.Draw();
Alternatively you can also use this method which consumes less lines:
GL.Draw(myBuffer, myShader);
Don't forget to update the viewport with Blit()
once all your objects are drawn to the drawing buffer.
- Initializing the renderer
- Setting the transform data
- Blitting and clearing the viewport
- Initializing a vertex buffer
- Creating a shader
- Drawing an object
- Screen space shaders
- Blitting bitmaps
- Loading a texture
- Creating a framebuffer
- Displaying a texture