add and use gl3w
This commit is contained in:
parent
340b4b2f34
commit
d4440ade7f
@ -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
|
||||
|
@ -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;
|
||||
|
4544
glcorearb.h
Normal file
4544
glcorearb.h
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user