Skip to content

Instantly share code, notes, and snippets.

View mattearly's full-sized avatar

Matthew Early mattearly

View GitHub Profile
@mattearly
mattearly / sdl2_opengl.cpp
Last active August 17, 2020 22:22 — forked from jordandee/sdl2_opengl.cpp
Simple SDL2/OpenGL example
// To compile with gcc: (tested on Ubuntu 14.04 64bit):
// g++ sdl2_opengl.cpp -lSDL2main -lSDL2 -lGL
// To compile with msvc: (tested on Windows 7 64bit)
// cl sdl2_opengl.cpp /I C:\sdl2path\include /link C:\path\SDL2.lib C:\path\SDL2main.lib /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libcmtd.lib opengl32.lib
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>