Abstracting some Logic in my engine

May 7, 2025

I removed the shader maker mode for now and started working on the shader editor mode. The implementation is already working so now I can use the engine to work on my shader scripts. There is a live update feature that I can toggle on or off to see changes. Also I added a button to insert a template into the editor, as well as a way to save the script when you’re done working on it. I need to make a way to load scripts into the editor as well. Shouldn’t be too hard since I already did this with the template as it’s being pulled from a glsl file.

I’m working on separating some of the logic in the code and I’ve abstracted the GUI and Panels into their own classes. The GUI has a reference to the currently active panel and when we want to change modes I can call the SwitchMode() function and pass in the Panel Type based on the PanelType enum.

Ultimately I need to abstract this further to create a mode state machine that is in charge of what mode is active and this state machine would also be in charge of changing the current panel(s), since I don’t want to be limited to only one panel per mode.


Blog

Kero Mena