Also moved all the code for each pipeline into the header files
rather than the .cpp files to keep it all in one place.
Considering just moving all the code into one file just to make it
easier to create new pipelines but that may be overkill and may
make the project harder to maintain in the future.
Changing the mechanic of the renderer to support pipelines.
One scene could have multiple pipelines. The pipelines allow for
one shader, one camera, and multiple batches.
The problem was caused by vector re-allocation. This is a similar
problem to what happened with the mesh factory. It was solved by
converting the texture factory to use lists instead of vectors.
The reason for using lists is to prevent the need for explicit
deallocation of resources and instead allow the use of a list to
automatically allocate/deallocate the textures/samplers/meshes.
There is an OpenGL error (1282) invalid operation that is getting
caught when switching to the imagescene. This needs to get fixed
and then hopefully the whole thing will work.
Added image scene to render an image in a scene. There is also now
a testing image that is an uber meme. Currently the problem is
that the spritebatch cannot use the offsetof macro because it is a
templated class. Possible solutions to this are changing it to be
specifyable or implemented per vertex type as the other batches
have been.
The sprite inherits from Poseable. It is intended to allow for
pure 2D rendering or integration of sprites/particles into 3D
scenes. Eventually an ImageScene should be created to test out the
image loading, sprite movement and rotation, and 2D camera
functionality for the builtin engine.
MyBuiltinTexturedScene (number 7) displays a cube that loads its
faces from a hard-coded texture. Mipmaping is supported. Just use
the XXX_MIPMAP_XXX Min/Mag filters to use it. TODO next is
combining lighting and textures and then up after that is shadows.
I may just do lighting and shadows before lighting, shadows, and
textures.
Want to use seperate textures and samplers for the scene to allow
for more modularization. Currently have created a texture class
and started creating a scene class.
Now, LitScene allows for simple lighting. (Shadows still to come).
Ambient, specular, and diffuse lighting available and each mesh's
vertex can define a material that defines its reflectivity. An
example scene was added to the MyApplication as the scene for the
6 button.
The builtin namespace is intended to be a slighly higher level
interface with OpenGL through the charcoal engine. It is inteneded
to allow the developer to create applications without needing to
create shader code or worry about rendering techniques. Eventually,
applications with lighting, textures, vertex coloring, shadows, and
a text-based UI should be available through the builtin namespace
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.