mirror of https://github.com/bjornbytes/lovr.git
GLEW for windows...;
This commit is contained in:
parent
5615fe579c
commit
f49cfa4f11
|
@ -4,8 +4,9 @@ project(lovr)
|
||||||
option(OSVR_PATH "The path to the osvr snapshot")
|
option(OSVR_PATH "The path to the osvr snapshot")
|
||||||
|
|
||||||
add_executable(lovr
|
add_executable(lovr
|
||||||
src/util.c
|
|
||||||
src/glfw.c
|
src/glfw.c
|
||||||
|
src/util.c
|
||||||
|
src/shader.c
|
||||||
src/event.c
|
src/event.c
|
||||||
src/graphics.c
|
src/graphics.c
|
||||||
src/model.c
|
src/model.c
|
||||||
|
@ -28,10 +29,15 @@ add_subdirectory(deps/luajit luajit)
|
||||||
include_directories(deps/luajit/src ${CMAKE_BINARY_DIR}/luajit)
|
include_directories(deps/luajit/src ${CMAKE_BINARY_DIR}/luajit)
|
||||||
set(LOVR_LUA liblua)
|
set(LOVR_LUA liblua)
|
||||||
|
|
||||||
|
# GLEW
|
||||||
|
add_subdirectory(deps/glew/build/cmake glew)
|
||||||
|
include_directories(deps/glew/include)
|
||||||
|
set(LOVR_GLEW glew)
|
||||||
|
|
||||||
# GLFW
|
# GLFW
|
||||||
add_subdirectory(deps/glfw glfw)
|
add_subdirectory(deps/glfw glfw)
|
||||||
include_directories(deps/glfw/include)
|
include_directories(deps/glfw/include)
|
||||||
set(LOVR_GLFW glfw opengl32 ${GLFW_LIBRARIES})
|
set(LOVR_GLFW glfw ${GLFW_LIBRARIES})
|
||||||
|
|
||||||
# assimp
|
# assimp
|
||||||
add_subdirectory(deps/assimp assimp)
|
add_subdirectory(deps/assimp assimp)
|
||||||
|
@ -50,6 +56,7 @@ move_dll(osvr::osvrClientKit)
|
||||||
|
|
||||||
set(LOVR_LIB
|
set(LOVR_LIB
|
||||||
${LOVR_LUA}
|
${LOVR_LUA}
|
||||||
|
${LOVR_GLEW}
|
||||||
${LOVR_GLFW}
|
${LOVR_GLFW}
|
||||||
${LOVR_ASSIMP}
|
${LOVR_ASSIMP}
|
||||||
)
|
)
|
||||||
|
@ -57,5 +64,6 @@ set(LOVR_LIB
|
||||||
target_link_libraries(lovr ${LOVR_LIB})
|
target_link_libraries(lovr ${LOVR_LIB})
|
||||||
|
|
||||||
move_dll(${LOVR_LUA})
|
move_dll(${LOVR_LUA})
|
||||||
|
move_dll(${LOVR_GLEW})
|
||||||
move_dll(${LOVR_GLFW})
|
move_dll(${LOVR_GLFW})
|
||||||
move_dll(${LOVR_ASSIMP})
|
move_dll(${LOVR_ASSIMP})
|
||||||
|
|
|
@ -24,4 +24,11 @@ void initGlfw(GLFWerrorfun onError, GLFWwindowclosefun onClose) {
|
||||||
|
|
||||||
glfwSetWindowCloseCallback(window, onClose);
|
glfwSetWindowCloseCallback(window, onClose);
|
||||||
glfwMakeContextCurrent(window);
|
glfwMakeContextCurrent(window);
|
||||||
|
|
||||||
|
GLenum err = glewInit();
|
||||||
|
if (err != GLEW_OK) {
|
||||||
|
error("Could not initialize GLEW");
|
||||||
|
} else if (!GLEW_VERSION_2_1) {
|
||||||
|
error("Geez your OpenGL is old");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define GLFW_INCLUDE_GLCOREARB
|
#define GLFW_INCLUDE_GLCOREARB
|
||||||
|
#elif WIN32
|
||||||
|
#include <GL/glew.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
GLFWwindow* window;
|
GLFWwindow* window;
|
||||||
|
|
Loading…
Reference in New Issue