Earlier quoted context omitted.
I wanted to include common code for all shaders in a simple way, but I was too lazy write a proper parser. So instead I used the C++ preprocessor and macros to include things from common shader code and combine them in the build step.
FYI: https://docs.gl/es2/glShaderSource takes an array of strings and just internally appends them together. So, rather than trying to #include common code for all my shaders, I just pass a common_code_string and a shader_specific_code_string every time.
Show HN: The full source code and assets for my custom game engine and game
21–30 of 38 posts
Re: Show HN: The full source code and assets for my custom game engine and game
#22You should probably give credit to Casey / Handmade Hero with regards to your windows platform code. Well its kinda scattered around, so probably just credit in general.
So... not from scratch?
Though that would be one hell of a project.
Re: Show HN: The full source code and assets for my custom game engine and game
#23Earlier quoted context omitted.
So... not from scratch?
Here 'from scratch' probably means 'from fundamentals', e.g. without a prefab game engine, as opposed to 'taking no inspiration or lessons from anyone else or using any library code written by other people'. Though that would be one hell of a project.
“If you wish to make an apple pie from scratch, you must first invent the universe” :)
Re: Show HN: The full source code and assets for my custom game engine and game
#24Earlier quoted context omitted.
Here 'from scratch' probably means 'from fundamentals', e.g. without a prefab game engine, as opposed to 'taking no inspiration or lessons from anyone else or using any library code written by other people'. Though that would be one hell of a project.
I mentioned in a couple of places that I did use other people's file loading libraries (mainly Sean Barrett's excellent stb libs). “If you wish to make an apple pie from scratch, you must first invent the universe” :)
This is something I posted on Casey's first handmade video, together with some counter arguments to his rant on the shortcomings of c++ and windows. He has since disabled comments.
Re: Show HN: The full source code and assets for my custom game engine and game
#25Re: Show HN: The full source code and assets for my custom game engine and game
#26Re: Show HN: The full source code and assets for my custom game engine and game
#27More of a general nooby question: what would be a good way to read through code like this? Where to start? How to understand what's going on and when? etc.
For Hockey Slam you can look for the entrypoint in Windows:
https://github.com/Mknsri/HockeySlam/blob/main/windows/win_m...
or Android:
https://github.com/Mknsri/HockeySlam/blob/main/android/app/s...
Then start tracing through, looking at any function calls that look like they contain anything interesting. Additionally in this project you can jump straight to the entrypoints of the game code:
https://github.com/Mknsri/HockeySlam/blob/main/game/game_mai...
Or the rendering code:
https://github.com/Mknsri/HockeySlam/blob/main/ogl/ogl_main....
Another way would be to look at the files and see if anything catches your interest, for example if you want to learn about the UI system, you could look at how a button is defined:
https://github.com/Mknsri/HockeySlam/blob/main/game/imui_sys...
Fabien Sanglard has great articles on studying classic video game engines, and could be used as a guide on how to approach codebases: https://fabiensanglard.net/quake2/index.php
Re: Show HN: The full source code and assets for my custom game engine and game
#28Congrats on finishing the game, it's an accomplishment
Thanks! Finishing such a large project feels great and you learn a lot when you have to implement so much you take for granted when using things other people have built
Re: Show HN: The full source code and assets for my custom game engine and game
#29Earlier quoted context omitted.
Thanks! Finishing such a large project feels great and you learn a lot when you have to implement so much you take for granted when using things other people have built
Yes, congratulations on finishing the game! Also, thank you very much for sharing the story of making it. I'm more inspired than ever to keep dev logs for the little side projects I work on. It's important to keep track of progress, reflect on where you were early on, and see how far you've come.
Re: Show HN: The full source code and assets for my custom game engine and game
#30...how!? How did you even learn how to do this? I've never seen a github repo or documentation or tutorials that even mentions doing this. Nothing on the developer.android website, nothing in any YouTube tutorials. I'm blown away.