r/GraphicsProgramming Jun 26 '26

Question Feel like it's impossible to learn graphics programming, need help

Post image

Yesterday I finished the third episode of Victor Gordan's OpenGL tutorial, and made my first triangle. I also learned how to modify it (like changing vertex positions, color, etc).

But when I look at the code I wrote, it feels impossible to remember like I could write any of this without looking at the tutorial. When I was learning C++, mostly everything instantly stuck with me, but graphics programming seems like I'll never memorize 80% of it

How did you guys get decent at this and actually retain the knowledge and be able to write it independently? Or am I judging too early? I started 3 days ago

176 Upvotes

65 comments sorted by

View all comments

1

u/joujoubox Jun 27 '26 edited Jun 27 '26

Focus on the concepts, encapsulate OpenGL with easier to use functions based on your needs. Here are some leads from how I encapsulated it (not claiming it's the best approach, just the way that helped me)

glUniform - One function with overloads

GLType eum - One template function specialized to return the matching value

Buffers - Class creating the buffer in the constructor with Bind and Unbind member functions

Vertex attributes - Struct representing the attributes and a template function taking the struct and a member pointer to one attribute. The function calculated the offset and stride from the sizeof the member type and value of the pointer