uses GLEW with Linux to avoid issues with glUniform1f, explicitly links glfw3 and C math library
This commit is contained in:
parent
786dffa0cb
commit
1dd4cf0104
@ -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) {
|
||||
|
@ -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" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user