Gamedev Framework (gf)
0.3.0
A C++11 framework for 2D games
|
Gamedev Framework is based on Open GL ES 2.0. This choice is motivated by the following facts:
glBegin()
, hello shaders).In OpenGL, texture data should be uploaded beginning with the lower left corner. In gf, textures are uploaded beginning with the upper left corner, meaning that they are horizontally flipped in graphical memory. This is not a problem.
Indeed, texture coordinates normally range from \( 0 \) to \( 1 \), \( (0,0) \) being the lower left corner. In gf, the convention is that \( (0,0) \) represents the upper left corner, which is more intuitive for a graphical application.
In OpenGL, matrices are defined in column major order. In gf, gf::Matrix is defined in row major order. So, when uploaded directly, the matrix is transposed. As a consequence, in the shader, instead of doing a matrix-vector multiplication, we have to do a vector-matrix multiplication and that's it.