Skip to content

Instantly share code, notes, and snippets.

View NTimmons's full-sized avatar

Nicholas Timmons NTimmons

View GitHub Profile
@nickrolfe
nickrolfe / windows_modern_opengl_context.c
Last active April 24, 2024 13:00
Sample code showing how to create a window using a modern OpenGL core profile context without any libraries other than the standard Win32 wglXXX calls.
// Sample code showing how to create a modern OpenGL window and rendering context on Win32.
#include <windows.h>
#include <gl/gl.h>
#include <stdbool.h>
typedef HGLRC WINAPI wglCreateContextAttribsARB_type(HDC hdc, HGLRC hShareContext,
const int *attribList);
wglCreateContextAttribsARB_type *wglCreateContextAttribsARB;