brocgl is a basic setup code needed to start using OpenGL on Windows.
It includes creating a window and a proper modern OpenGL context.
User api boils down to creating 2 functions: setup() and draw().
- void setup(); Called once during the initialization.
- void draw(); Called in a while() loop to update the screen.
In your project directory:
git submodule add https://github.com/brocbyte/brocgl
cd brocgl
setup_dev.cmd
- in your source cpp file, do
#include "win_gl.cpp"
and implementvoid setup()
andvoid draw()
functions - in your build process, set language version to std:c++20, add include directory brocgl, link with user32.lib, gdi32.lib, opengl32.lib
5th step in a single cl
call:
cl game.cpp /std:c++20 /I brocgl\ user32.lib gdi32.lib opengl32.lib