A collection of classes and methods I developped to make my life easier when using OpenGL
Just to make my life easier and so that I don't need to look everywhere to find them, here is a small list of conventions I use:
camelCase
for functions
snake_case
for variables and namespaces
PascalCase
for classes
Most classes will be found in the nbop::glecs
namespace.
By default, the following uniforms will be automatically set:
u_model
: the model matrixu_view
: the view matrixu_projection
: the projection matrix
TODO :
u_time
: the time in seconds since the program startedu_delta_time
: the time in seconds since the last frameu_resolution
: the resolution of the window
And the vertex data cn be accessed with the following attributes:
v_position
: the vertex positionv_color
: the vertex color
Since it will mostly used with OpenGL, I will use glm
structures and functions to represent vectors, matrices, etc, instead of implementing them myself.
Some informations I ALWAYS ask myself and I don't want to forget:
With glm
matrices being in column-major order, in C = B * A
, A is "applied first", then B.
A way to require Components when creating a Component. For example, a Renderer requires a Mesh and a Transform.
Check encapsulation for example with the Shader class.
Limits the access level on a lot of methods. Right now, anyone can just bind
a Mesh for example.