uses GLEW with Linux to avoid issues with glUniform1f, explicitly links glfw3 and C math library

This commit is contained in:
Andrew Corrigan 2014-02-02 20:23:55 +08:00
parent 786dffa0cb
commit 1dd4cf0104
2 changed files with 11 additions and 1 deletions

View File

@ -20,6 +20,9 @@
#include <string.h>
#include <iconv.h>
#include <math.h>
#ifdef NANOVG_GLEW
# include <GL/glew.h>
#endif
#include <GLFW/glfw3.h>
#include "nanovg.h"
#define GLNANOVG_IMPLEMENTATION
@ -743,6 +746,12 @@ int main()
glfwSetKeyCallback(window, key);
glfwMakeContextCurrent(window);
#ifdef NANOVG_GLEW
if(glewInit() != GLEW_OK) {
printf("Could not init glew.\n");
return -1;
}
#endif
vg = glnvgCreate(512,512);
if (vg == NULL) {

View File

@ -14,7 +14,8 @@ solution "nanovg"
targetdir("build")
configuration { "linux" }
links { "X11","Xrandr", "rt", "GL", "GLU", "pthread" }
links { "X11","Xrandr", "rt", "GL", "GLU", "pthread","m","glfw3","GLEW" }
defines { "NANOVG_GLEW" }
configuration { "windows" }
links { "glu32","opengl32", "gdi32", "winmm", "user32" }