@@ -8,5 +8,5 @@ add_executable(vtk ${SOURCES}) | |||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE) | |||
find_package(Threads REQUIRED) | |||
target_link_libraries(vtk SDL2 GL GLEW GLU noise ${CMAKE_THREAD_LIBS_INIT}) | |||
target_link_libraries(vtk SDL2 GL GLEW GLU ${CMAKE_THREAD_LIBS_INIT}) | |||
@@ -4,8 +4,8 @@ | |||
#include <string> | |||
namespace vtk::file { | |||
namespace vtk { namespace file { | |||
std::string loadFileIntoString(const std::string& fName); | |||
} | |||
}} |
@@ -14,7 +14,7 @@ namespace vtk { | |||
class Shader; | |||
} | |||
namespace vtk::gls { | |||
namespace vtk { namespace gls { | |||
// set active shader | |||
int setShader(const GLuint& shaderID); | |||
@@ -23,4 +23,4 @@ namespace vtk::gls { | |||
void setFlag(const GLenum& flag, const bool& newState); | |||
void restoreState(); | |||
} | |||
}} |
@@ -7,7 +7,7 @@ | |||
#include "terrain/open_simplex_noise.h" | |||
#include "terrain/noisemodule.h" | |||
namespace vtk::noise { | |||
namespace vtk { namespace noise { | |||
class Noise : public NoiseModule { | |||
public: | |||
@@ -23,4 +23,4 @@ protected: | |||
struct osn_context* mCtx; | |||
}; | |||
} | |||
}} //vtk::noise |
@@ -4,7 +4,7 @@ | |||
#pragma once | |||
namespace vtk::noise { | |||
namespace vtk { namespace noise { | |||
class NoiseModule { | |||
public: | |||
@@ -12,4 +12,4 @@ public: | |||
virtual double get3D(const double& x, const double& y, const double& z) { return 0.0; } | |||
}; | |||
} | |||
}} //vtk::noise |
@@ -6,7 +6,7 @@ | |||
#include "terrain/noisemodule.h" | |||
namespace vtk::noise { | |||
namespace vtk { namespace noise { | |||
class YGradient : public NoiseModule { | |||
public: | |||
@@ -23,4 +23,4 @@ protected: | |||
double mEnd; | |||
}; | |||
} | |||
}} //vtk::noise |
@@ -7,7 +7,7 @@ | |||
#include "terrain/noisemodule.h" | |||
namespace vtk::noise { | |||
namespace vtk { namespace noise { | |||
class YTurbulence : public NoiseModule { | |||
public: | |||
@@ -20,4 +20,4 @@ protected: | |||
std::shared_ptr<NoiseModule> mModifier; | |||
double mMultiplier; | |||
}; | |||
} | |||
}} // vtk::noise |
@@ -1,4 +1,4 @@ | |||
#version 440 | |||
#version 430 | |||
#extension GL_EXT_texture_array : enable | |||
in vec3 texCoordInterp; |
@@ -1,4 +1,4 @@ | |||
#version 400 | |||
#version 430 | |||
layout(location = 0) in vec3 position; | |||
layout(location = 1) in vec3 texCoord; |
@@ -4,7 +4,7 @@ | |||
#include "fileutils.h" | |||
#include "spdlog/spdlog.h" | |||
namespace vtk::file { | |||
namespace vtk { namespace file { | |||
std::string loadFileIntoString(const std::string& fName) { | |||
std::ifstream in(fName, std::ios::in | std::ios::binary); | |||
@@ -23,4 +23,4 @@ std::string loadFileIntoString(const std::string& fName) { | |||
} | |||
} | |||
}} |
@@ -39,7 +39,7 @@ void Game::init() { | |||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); | |||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4); | |||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 4); | |||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); | |||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); | |||
SDL_GL_SetSwapInterval(conf->getValue<int>("graphics.vsync", 0)); |
@@ -5,7 +5,7 @@ | |||
#include "graphics/glstate.h" | |||
#include "graphics/shader.h" | |||
namespace vtk::gls { | |||
namespace vtk { namespace gls { | |||
static GLuint activeShader(0); | |||
static bool trackingEnabled(false); | |||
@@ -52,4 +52,4 @@ namespace vtk::gls { | |||
} | |||
flags.clear(); | |||
} | |||
} | |||
}} |
@@ -28,7 +28,6 @@ | |||
#include <SDL2/SDL.h> | |||
#include <noise/noise.h> | |||
namespace vtk { | |||
@@ -1,6 +1,6 @@ | |||
#include "terrain/noise.h" | |||
namespace vtk::noise { | |||
namespace vtk { namespace noise { | |||
Noise::Noise(const int64_t& seed) { | |||
mScale = 32.0; | |||
@@ -29,5 +29,5 @@ void Noise::setScale(const double& scale) { | |||
mScale = scale; | |||
} | |||
} | |||
}} | |||
@@ -1,6 +1,6 @@ | |||
#include "terrain/ygradient.h" | |||
namespace vtk::noise { | |||
namespace vtk { namespace noise { | |||
YGradient::YGradient() { | |||
mStart = 0.0; | |||
@@ -26,4 +26,4 @@ double YGradient::get3D(const double& x, const double& y, const double& z) { | |||
else if (factor <= 0.0) return -1.0; | |||
return (factor * 2.0) - 1.0; | |||
} | |||
} | |||
}} |
@@ -2,7 +2,7 @@ | |||
#include "terrain/yturbulence.h" | |||
namespace vtk::noise { | |||
namespace vtk { namespace noise { | |||
YTurbulence::YTurbulence(std::shared_ptr<NoiseModule> input, std::shared_ptr<NoiseModule> modifier) { | |||
mInput = input; | |||
@@ -20,4 +20,4 @@ double YTurbulence::get3D(const double&x, const double&y, const double&z) { | |||
return mInput->get3D(x, y + mod, z); | |||
} | |||
} | |||
}} |