Skip to content

Instantly share code, notes, and snippets.

View cocoademon's full-sized avatar

Cameron Foale cocoademon

View GitHub Profile
// Despite appearances to the contrary, this does proper error handling. Any error cascades into a failure of the wglGetProcAddress.
int init_opengl() {
HWND window = CreateWindowA("edit", "", WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
PIXELFORMATDESCRIPTOR format_desc = {
.nSize = sizeof(PIXELFORMATDESCRIPTOR),
.nVersion = 1,
.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL
};