add and use gl3w

This commit is contained in:
Josh Holtrop 2014-06-09 21:12:15 -04:00
parent 340b4b2f34
commit d4440ade7f
5 changed files with 7134 additions and 3 deletions

View File

@ -9,7 +9,7 @@ NAME = "freetype2gl3"
task :default do
Rscons::Environment.new do |env|
env.build_root = "build"
env["LIBS"] += ["SDL2", "GL"]
env["LIBS"] += ["SDL2", "GL", "dl"]
env.Program("^/#{NAME}", Dir["*.{cc,c}"])
end
end

View File

@ -1,6 +1,5 @@
#include <SDL2/SDL.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "gl3w.h"
#define WIDTH 500
#define HEIGHT 500
@ -41,6 +40,20 @@ int main(int argc, char *argv[])
SDL_GLContext gl_context = SDL_GL_CreateContext(window);
if (gl3wInit() != 0)
{
printf("Failed to gl3wInit()\n");
SDL_Quit();
return 2;
}
if (!gl3wIsSupported(3, 0))
{
printf("OpenGL 3.0 is not supported!\n");
SDL_Quit();
return 2;
}
init();
display(window);
SDL_Event event;

1339
gl3w.c Normal file

File diff suppressed because it is too large Load Diff

1235
gl3w.h Normal file

File diff suppressed because it is too large Load Diff

4544
glcorearb.h Normal file

File diff suppressed because it is too large Load Diff