Skip to content

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.