GameEngine in golang
|
|
||
|---|---|---|
| Engine | ||
| NSightProject | ||
| Resources | ||
| Scripts | ||
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| LICENSE.md | ||
| README.md | ||
Game
This is a basic project that renders stuff in a window using opengl and glfw
Troubleshooting
If windows says that the app cannot be launched on your device, try compiling with these compiler flags
-ldflags="-s -w"
TODO:
- Make some kind of protocol for communication between graphical engine and the glue program and implement it properly
- Embed files at compilation time so that I dont have to ship the resource folder with it
- This would most probably pass config from some kind of global config
- Implement instances
- When using a model - add the renderable to the queue of the model, when rendering use opengl instancing to lighten the load
Concepts
Controls
-
The engine contains subpackages, ea Graphics, which contains all graphics logics, exposed in Public.go
-
TextureManager
- Used for loading textures
- Manages duplicate loads, etc.
-
ShaderManager
- The same essentially
-
Events
- Currently unused except for keybinds
-
Events.Keybinds
- Used for keybinds
- Cannot call opengl functions from within, if needed use GraphicalManager.EnqueueLoadFunction(func() {})
- This is because the engine multi-threads events, and opengl cannot be called from a different thread than main
- Generally do this when calling opengl calls from goroutines, it will be called exactly once before drawing the next frame
Credits
So many thanks to learnopengl.com, a LOT of the opengl code is taken from there, most of it changed up, but this project would not exist if it was not for this site https://github.com/Samson-Mano/opengl_textrendering