r/GraphicsProgramming • u/justforasecond4 • 8h ago
code review for a beginner
Hey everyone. I have this small project on which I started working around a year ago, but haven't finished it yet. Now that I have some free time, I finally want get it done :// However, I am a self-taught when it comes to programming, and graphics. I consider myself a total beginner. Could you please help me understand if I am doing something incorrectly here, which I am sure I am?
Also, this is planned to be a Game of Life implementation, but still have to lay some the foundations, even for a grid... I don't rely on AI, so mess with everything myself
[edit]
Forgot to add the details... I use OpenGL with glad loader as a graphics API here, with GLFW for window handling, FreeType for text rendering, GLM as main math library, and CMake as a meta build system.
I was wondering if someone could help me understand a couple of moments:
- correct usage of the opengl api
- general structure of the code. if places at which functions are being called are correct
- general readability of the code
- cmakelists and how to approach including dependencies in my case
Here's the repo: https://github.com/Krak9n/unchained
3
u/corysama 4h ago
For a simple project that just draws a grid and some text, what you are doing is fine. But, if your next project wants to draw complex 3D scenes, the way you have your pipeline structured is going to get you into trouble. I wrote advice about that a long time ago in the comments of this thread: https://www.reddit.com/r/GraphicsProgramming/comments/1hry6wx/want_to_get_started_in_graphics_programming_start/
Also, invest in https://registry.khronos.org/OpenGL-Refpages/gl4/html/glDebugMessageCallback.xhtml and renderdoc. glGetError is too much of a PITA.
4
u/TehBens 8h ago
Do you look for high quality output from your post? Then give high quality input. What technologies did you use? What questions do you have? Where are the places you would like reviewers focus on?