Got the builtin basicscene to render. For some reason, it seems
like the model matrices are not working correctly. The two shapes
that are supposed to be rendering on screen are not moving around
as they should be.
Need to re-make the builtin version. The problem, again, was caused
by vtables. Need to find a way to make interfaces without virtual
methods to remove the need for vtables. Found a good stackoverflow
article on this.
https://stackoverflow.com/questions/44317289/c-interface-without-virtual-functions
The Positioned, Normaled, Textured, etc. Interfaces should be
re-made using this format.
Builtin general structure created. Added a builtin::BasicScene
class for quick general testing of the engine on different systems.
The builtin::BasicScene class greatly reduces the amount of code
needed to be handled by the developer by offering a pre-made way
to handle it. It even includes pre-made shaders!
Starting the setup for builtin types for rendering. This will allow
the engine to be easier to use for beginners while still offering
great modularity and functionality. The builtin namespace is
intended to simplify mesh loading and rendering. It should
eventually offer pre-made shaders to simplify the rendering of the
builtin types. Possibly in the future, it could have partially
setup scenes/application to simplify scene/application building
Also added a required prerender function to scene and application.
This function is intended to be used as a way to prepare the scene
to be rendered in its current state. For that reason, the delta
time and the current clock tick are not passed to it.
Finally got a 3D cube to be rendered. While doing it, fixed a
bug in MeshFactory that caused it to allocate the incorrect amount
of memory for each mesh.
Poseable is not a struct because it has a vtable. This means that
it cannot be used easily with glVertexAttribPointer.
This quick fix should be overwritten by a full fix that stores the
matrix data in a seperate vector and modifies the matrices with
poseable interfaces. (Will go into more detail in that commit.)
Now using GLM instead of the custom math libraries.
Sadly, this did not 100% fix the problem at hand but it does give
some closure that the math is not the problem.
Also it will be nice to have a general math library to not have to
deal with creating every math function every time.
Now, the batch subclasses define the Element specification and the
elements are not stored in the main Batch class. It is suggested
that the batch subclasses use vectors of the different element
types per requested VBO and offer a function to return a reference
to one of the elements by index. This functionality is implemented
in the current version of MyBatch.
A test for the movement needs to be completed
The trapezoid now throbs between black and white. This was made to
test out the element buffers using MyBatch. Next up for the
batches should probably be to figure out the recommended way of
specifying more than one element buffer. Currently it is done
by specifying the number of elements to be stored and the number
of element vbos needed but maybe there is some way to get it to
work using variadic templates. There is a comment about this in
the Batch.h file.
Now batches are actually batches.
Also added the MeshFactory class.
Drawing modes are now specified with DrawMode instead of the
GLenum. Renderables must be specified with a draw mode.
This commit gets creates the ObjectOriented scene and gets it
working.
The current test program swaps a triangle from small to large with
the 1 and 2 keys on the keyboard. (1 for small and 2 for large).
The small triangle is rendered by the simple scene and the large
one is rendered by the object oriented one.
Now using GLFW3 instead of the custom window class. This library
looks like it will make development much simpler and will make it
so that I am less worried about my windows code breaking. Currently
setup the http://antongerdelan.net/opengl/hellotriangle.html
tutorial in the MySimpleScene. Will probably create another scene
file to try to get the object oriented stuff working.