Intersting, the tower defense genre in a sandbox environment also wasn't a bad idea. What engine are you using? Keep us updated
Thanks for the interest, I'm using a custom engine that I'm building alongside this project in C++ and OpenGL. I'll still have some defense elements in the game, but in a much different way.
Anyway, onto some catchup posts:
June 10, 2019
The day I started developing this game.
I used a library called GLFW to handle window creation as well as user inputs. You can read up on it here:
https://www.glfw.org/. I also use another library called GLM (GL Mathematics) to include the math-related classes so that I don't have to code them myself
. I also use GLEW to provide the declarations for OpenGL since most compilers only include the declarations for OpenGL 1.1 (oldest usable version of the API that has very little functionality). Finally, OpenAL to help with audio-related programming and stb_image.h to assist with texture loading.
So with all that out of the way, let's get into the pipeline of how drawing graphics works in OpenGL:
If you were trying to draw a textured cube, you would need 2 VBOs, one representing the positions of each vertex of the cube, and the other representing the texture coordinates corresponding to each vertex of the cube. Once that's done, while VAOs aren't completely necessary, they definitely help with organizing and defining each mesh, and they also have other benefits in the long run.
When you tell OpenGL to "draw" a mesh, what it's really doing is sending the VAO (which is just an array of VBOs) to the GPU where user-created shaders that use the GLSL language (similar to C) handle various steps of drawing the mesh as described in my extremely clean and professional looking diagram. I mean, what can I say, graphic design is my passion after all.
The code structure that I use appears like this:
Most of this code was just siphoned from earlier projects of mine, hence why I was able to get it all done in a relatively short amount of time. The reason textures are directly related to the main class is because that's where texture binding is handled, since texture binding is a pretty expensive process in memory.
To summarize:
The mesh object contains the VAO and VBOs for a mesh, and all of it's standalone attributes.
The shader object contains the shader program, which involves the vertex, fragment, and sometimes geometry shader. You can have more than one of these.
The entity object contains the mesh and it's transformations, and as a result handles translation, rotation, scaling, and drawing.
The texture object loads in and contains an OpenGL texture buffer.
The renderer object has all of the main drawing methods that I'm currently using.
At any rate, this was the base I started out with, and used to slowly develop the game over time. I didn't have much time near the end of June thanks to exams and finals, but I did manage to make a couple breakthroughs that led me to this point that I'm quite eager to talk about in my next few posts. I plan on updating this devlog at least twice a week.
EDIT: Siphoned not syphoned.