Wednesday 16 August 2017

Game Engine 16/08/17 - Graphics Module

I'm now readapting the GraphicsModule to the new Engine framework and also redesigning its skeleton. I have a VertexArray class & a Shader class, which have as child classes, for exemple,
OpenGLVertexArray and OpenGLShader. The GraphicsModule has two functions named GenerateVertexArray and GenerateShader which return a VertexArray handle and a Shader handle, respectively. This way I have a layer of abstraction between the Graphics API & the Engine.

I also have a OpenGLGraphicsModule, which overrides the functions so it creates the right VertexArray & Shader types and also handles all the OpenGL related stuff.

All the other classes use VertexArray and Shader as basis. For example, the Mesh class uses a VertexArray, avoiding direct OpenGL calls for flexibility.

No comments:

Post a Comment