How jeremyzetadev/c_sdl2_game works
This repository is a small OpenGL starter project: two standalone examples demonstrate creating a window with GLFW or SDL2, initializing GLAD, and using an OpenGL context. The GLFW example additionally compiles shaders, configures triangle geometry, and renders until exit; the SDL2 example initializes the loader and polls for quit events. The generated GLAD loader and its API header provide the shared OpenGL entry points. README material also mentions shader/file-reading setup, but no corresponding implementation is visible in the provided tree or excerpts.
Main entry points: main.c GLFW Triangle · main_sdl2.c SDL2 Starter · glad.h GLAD API · glad.c GLAD Loader
Components 8
Window Examples
- GLFW Triangle
main.c - SDL2 Starter
main_sdl2.c
OpenGL Loader
- GLAD API
glad/include/glad/glad.h - GLAD Loader
glad/src/glad.c
Other components
- Example User
- GLFW
- SDL2
- OpenGL Context
Connections 10
- Example User → GLFW Triangle: runs
- Example User → SDL2 Starter: runs
- GLFW Triangle → GLFW: creates window
main.c - SDL2 Starter → SDL2: creates window
main_sdl2.c - GLFW Triangle → GLAD API: uses API
main.c - SDL2 Starter → GLAD API: uses API
main_sdl2.c - GLFW Triangle → GLAD Loader: loads functions
main.c - SDL2 Starter → GLAD Loader: initializes loader
main_sdl2.c - GLFW Triangle → OpenGL Context: renders triangle
main.c - SDL2 Starter → OpenGL Context: queries vendor
main_sdl2.c