Frameworks, Part 2

Now we are back to frameworks, we must ask ourselves: What exactly do we need to put in a framework?

Recently, in a storm of assignments (which is about cel shading, something I won’t be mention here since the source code is lost for good), my framework broke down for no reason: It refuses to compile, but not reporting any errors. When I took out some changes that may be causing such error, the project compiles then throw me an error. The original Framework I used for 2 months up to now is seriously broken.

The only way for me to undo that, is to go back to my files from last year, and grab the framework that still works, while coding everything related from shaders from zero again.

Which leads me into asking: What do we need in a Framework?

  • Okay, firstly we are running in OpenGL, which means all the gl libraries should be included.
  • We’ll be running on GLSL too, thus we need to include the corresponding header.
  • We need something to load the shader as txt files, so a txt file loader is required.
  • We need to take a model from some outside source in order to render the image.
  • We need all supports like Keyboard and Mouse events together with sound responds.

In the end, that translate to just OpenGL libraries, GLSL, OBJ Loader, Text Loader and FMod. Which is a much smaller amount.

…and then I compiled an engine header to load all these, put this on the top of main, and hopefully it will solve the issue of instability.

Finally, for loading shaders, I implemented a manual load shader option, in which when one is attempting to load a shader, they are not doing from hardcoded filenames, but rather, a open file dialog appears and ask the user what file they are trying to load, then the filename is transmitted as a string object to the txt parser. This helps me manage the shader files well.

So here it is, my framework is usable again! Congrats to myself!

Until next time…no, we don’t have a video game sample today due to this is some programming insight to correct my past mistakes, so until next time.

Post a Comment