Commit 3e0472ec authored by Philip Trettner's avatar Philip Trettner

Made glow-extras windows compatible

parent cfce9b4c
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
project(glow-extras) project(glow-extras)
if(MSVC)
set(GLOW_EXTRAS_DEF_OPTIONS /MP)
else()
set(GLOW_EXTRAS_DEF_OPTIONS -Wall -Werror -std=c++11)
endif()
# all glow-extras # all glow-extras
add_library(glow-extras ${GLOW_LINK_TYPE} glow-extras.cc) add_library(glow-extras ${GLOW_LINK_TYPE} glow-extras.cc)
......
...@@ -5,6 +5,6 @@ file(GLOB_RECURSE HEADER_FILES "*.hh") ...@@ -5,6 +5,6 @@ file(GLOB_RECURSE HEADER_FILES "*.hh")
add_library(glow-extras-assimp ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES}) add_library(glow-extras-assimp ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(glow-extras-assimp PUBLIC ./) target_include_directories(glow-extras-assimp PUBLIC ./)
target_compile_options(glow-extras-assimp PRIVATE -Wall -Werror -std=c++11) target_compile_options(glow-extras-assimp PRIVATE ${GLOW_EXTRAS_DEF_OPTIONS})
target_link_libraries(glow-extras-assimp PUBLIC glow) target_link_libraries(glow-extras-assimp PUBLIC glow)
target_link_libraries(glow-extras-assimp PRIVATE assimp) target_link_libraries(glow-extras-assimp PRIVATE assimp)
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <glow/fwd.hh> #include <glow/fwd.hh>
#include <string>
namespace glow namespace glow
{ {
namespace assimp namespace assimp
......
...@@ -5,5 +5,5 @@ file(GLOB_RECURSE HEADER_FILES "*.hh") ...@@ -5,5 +5,5 @@ file(GLOB_RECURSE HEADER_FILES "*.hh")
add_library(glow-extras-camera ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES}) add_library(glow-extras-camera ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(glow-extras-camera PUBLIC ./) target_include_directories(glow-extras-camera PUBLIC ./)
target_compile_options(glow-extras-camera PRIVATE -Wall -Werror -std=c++11) target_compile_options(glow-extras-camera PRIVATE ${GLOW_EXTRAS_DEF_OPTIONS})
target_link_libraries(glow-extras-camera PUBLIC glow) target_link_libraries(glow-extras-camera PUBLIC glow)
...@@ -80,7 +80,7 @@ void GenericCamera::FPSstyleLookAround(float _deltaX, float _deltaY) ...@@ -80,7 +80,7 @@ void GenericCamera::FPSstyleLookAround(float _deltaX, float _deltaY)
// get roll / pitch / yaw from the current rotation matrix: // get roll / pitch / yaw from the current rotation matrix:
float yaw1 = asin(-R[2][0]); float yaw1 = asin(-R[2][0]);
float yaw2 = M_PI - asin(-R[2][0]); float yaw2 = glm::pi<float>() - asin(-R[2][0]);
float pitch1 = (cos(yaw1) > 0) ? atan2(R[2][1], R[2][2]) : atan2(-R[2][1], -R[2][2]); float pitch1 = (cos(yaw1) > 0) ? atan2(R[2][1], R[2][2]) : atan2(-R[2][1], -R[2][2]);
float pitch2 = (cos(yaw2) > 0) ? atan2(R[2][1], R[2][2]) : atan2(-R[2][1], -R[2][2]); float pitch2 = (cos(yaw2) > 0) ? atan2(R[2][1], R[2][2]) : atan2(-R[2][1], -R[2][2]);
...@@ -104,7 +104,7 @@ void GenericCamera::FPSstyleLookAround(float _deltaX, float _deltaY) ...@@ -104,7 +104,7 @@ void GenericCamera::FPSstyleLookAround(float _deltaX, float _deltaY)
// add rotation diffs given: // add rotation diffs given:
yaw = yaw + _deltaX; yaw = yaw + _deltaX;
pitch = glm::clamp(pitch + _deltaY, -0.5f * (float)M_PI, 0.5f * (float)M_PI); pitch = glm::clamp(pitch + _deltaY, -0.5f * glm::pi<float>(), 0.5f * glm::pi<float>());
// create rotation matices, seperated so we have full control over the order: // create rotation matices, seperated so we have full control over the order:
glm::mat4 newRotY = glm::yawPitchRoll(yaw, 0.0f, 0.0f); glm::mat4 newRotY = glm::yawPitchRoll(yaw, 0.0f, 0.0f);
......
...@@ -5,5 +5,5 @@ file(GLOB_RECURSE HEADER_FILES "*.hh") ...@@ -5,5 +5,5 @@ file(GLOB_RECURSE HEADER_FILES "*.hh")
add_library(glow-extras-geometry ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES}) add_library(glow-extras-geometry ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(glow-extras-geometry PUBLIC ./) target_include_directories(glow-extras-geometry PUBLIC ./)
target_compile_options(glow-extras-geometry PRIVATE -Wall -Werror -std=c++11) target_compile_options(glow-extras-geometry PRIVATE ${GLOW_EXTRAS_DEF_OPTIONS})
target_link_libraries(glow-extras-geometry PUBLIC glow) target_link_libraries(glow-extras-geometry PUBLIC glow)
...@@ -7,6 +7,6 @@ file(GLOB_RECURSE SHADER_FILES "shader/*.*") ...@@ -7,6 +7,6 @@ file(GLOB_RECURSE SHADER_FILES "shader/*.*")
add_library(glow-extras-material ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES}) add_library(glow-extras-material ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES})
target_include_directories(glow-extras-material PUBLIC ./) target_include_directories(glow-extras-material PUBLIC ./)
target_compile_options(glow-extras-material PRIVATE -Wall -Werror -std=c++11) target_compile_options(glow-extras-material PRIVATE ${GLOW_EXTRAS_DEF_OPTIONS})
target_link_libraries(glow-extras-material PUBLIC glow glow-extras-camera) target_link_libraries(glow-extras-material PUBLIC glow glow-extras-camera)
target_link_libraries(glow-extras-material PRIVATE glow-extras-geometry) target_link_libraries(glow-extras-material PRIVATE glow-extras-geometry)
...@@ -7,6 +7,6 @@ file(GLOB_RECURSE SHADER_FILES "shader/*.*") ...@@ -7,6 +7,6 @@ file(GLOB_RECURSE SHADER_FILES "shader/*.*")
add_library(glow-extras-pipeline ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES}) add_library(glow-extras-pipeline ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES})
target_include_directories(glow-extras-pipeline PUBLIC ./) target_include_directories(glow-extras-pipeline PUBLIC ./)
target_compile_options(glow-extras-pipeline PRIVATE -Wall -Werror -std=c++11) target_compile_options(glow-extras-pipeline PRIVATE ${GLOW_EXTRAS_DEF_OPTIONS})
target_link_libraries(glow-extras-pipeline PUBLIC glow glow-extras-camera) target_link_libraries(glow-extras-pipeline PUBLIC glow glow-extras-camera)
target_link_libraries(glow-extras-pipeline PRIVATE glow-extras-geometry) target_link_libraries(glow-extras-pipeline PRIVATE glow-extras-geometry)
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <glm/ext.hpp> #include <glm/ext.hpp>
using namespace glow;
using namespace glow::pipeline; using namespace glow::pipeline;
int RenderingPipeline::getOutputWidth() const int RenderingPipeline::getOutputWidth() const
......
...@@ -12,5 +12,4 @@ void main() ...@@ -12,5 +12,4 @@ void main()
color = clamp(color, vec3(0), vec3(1)); color = clamp(color, vec3(0), vec3(1));
fColor = linearToSRGB(color); // linear to sRGB conversion fColor = linearToSRGB(color); // linear to sRGB conversion
fColor = color;
} }
...@@ -5,5 +5,5 @@ file(GLOB_RECURSE HEADER_FILES "*.hh") ...@@ -5,5 +5,5 @@ file(GLOB_RECURSE HEADER_FILES "*.hh")
add_library(glow-extras-shader ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES}) add_library(glow-extras-shader ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(glow-extras-shader PUBLIC ./) target_include_directories(glow-extras-shader PUBLIC ./)
target_compile_options(glow-extras-shader PRIVATE -Wall -Werror -std=c++11) target_compile_options(glow-extras-shader PRIVATE ${GLOW_EXTRAS_DEF_OPTIONS})
target_link_libraries(glow-extras-shader PUBLIC glow) target_link_libraries(glow-extras-shader PUBLIC glow)
...@@ -5,5 +5,5 @@ file(GLOB_RECURSE HEADER_FILES "*.hh") ...@@ -5,5 +5,5 @@ file(GLOB_RECURSE HEADER_FILES "*.hh")
add_library(glow-extras-timing ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES}) add_library(glow-extras-timing ${GLOW_LINK_TYPE} ${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(glow-extras-timing PUBLIC ./) target_include_directories(glow-extras-timing PUBLIC ./)
target_compile_options(glow-extras-timing PRIVATE -Wall -Werror -std=c++11) target_compile_options(glow-extras-timing PRIVATE ${GLOW_EXTRAS_DEF_OPTIONS})
target_link_libraries(glow-extras-timing PUBLIC glow aion) target_link_libraries(glow-extras-timing PUBLIC glow aion)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment