Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 939 Bytes

README.md

File metadata and controls

27 lines (17 loc) · 939 Bytes

SDL2 OpenGL Basic Template

Simple and useful (supposedly) cross-platform template for OpenGL. Uses SDL_GL_GetProcAddress() to create the OpenGL functions so that you do not need to link or include the OS specific opengl library.

// Use this!
#include <opengl.h>
// instead of
#include <gl.h>
// or
#include <SDL_opengl.h>

..and you don't need to link it in the Makefile..

LDLIBS = -lSDL2 # No gl here

..then make sure you use Init_OpenGL() after creating the OpenGL context to initialise the functions.

Credits

The opengl.h and opengl.cpp files are by nlguillemot who provided the source code and talks about it in this article. The opengl files are also derived from from Khronos' glcorearb.h.