Building a C++ Game Engine from Scratch | Scion2D Episode 19
In this video, we continue building Scion2D, a custom 2D C++ game engine from scratch using Modern C++, OpenGL, SDL2, EnTT, Lua, sol2, and GLM.
In Episode 19, we begin binding the GLM math library to Lua using sol2 while improving the TransformComponent so Lua scripts can properly access glm::vec2 values and math functionality.
This is another important step toward building a flexible scripting system and exposing engine math systems directly to gameplay scripts.
Topics covered in this video:
Binding GLM to Lua
Integrating GLM with sol2
Creating Lua bindings for glm::vec2
Exposing math types to scripts
Updating the TransformComponent
Accessing glm data from Lua
Building reusable scripting utilities
Expanding runtime scripting support
Structuring scalable scripting systems
We use this system as the foundation for exposing additional math functionality later as the engine grows.
Feel free to experiment with adding more:
glm types
math functions
vector operations
matrix functionality
Helpful Documentation:
GLM:
https://github.com/g-truc/glm
sol2 Documentation:
https://sol2.readthedocs.io/en/latest/
EnTT Meta Documentation:
https://github.com/skypjack/entt/blob...
EnTT Meets Sol2:
https://github.com/skaarj1989/entt-me...
The EnTT Meets Sol2 repository is an excellent resource for learning advanced reflection and scripting workflows using EnTT and sol2 together.
This series is focused on teaching real game engine development step by step while building an actual engine and editor from the ground up.
Scion2D is being developed with modern C++ and will eventually power a future JRPG project called The Lost Children.
🔗 GitHub Repository
Explore the project here:
https://github.com/dwjclark11/Scion2D
💬 Join the Community
Chat, give feedback, or get help on Discord:
/ discord
📺 Watch the Full Playlist
Catch all the videos in the series:
• Build a 2D Game Engine in C++ | Scion2D Ga...
👍 Like the video and subscribe for future engine development tutorials and Modern C++ programming content.
💬 Questions or ideas? Drop a comment below. I would love to hear your thoughts and suggestions.