A short introduction

What you will need?

To get something rendered, you will need a VertexArray.

VertexArrays can be created from a Program object and one or several Buffer objects. (In some techniques no buffers are needed, but let’s keep it simple for now)

To create a Program object, you will need to supply it your shader(s) as strings. Having a vertex and fragment shader is the most common use case as this will render something visible to a screen or framebuffer.

Once you have your Program object, you can fill a Buffer with your data, then pass them to VertexArray, then call VertexArray.render().

All of the objects above can only be created from a Context object.

Here is our checklist:

  1. Install ModernGL.
  2. Create a Context.
  3. Create a Program object.
  4. Create a VertexArray object.

Proceed to the next step.