Skip to content

Commit

Permalink
Ported to win
Browse files Browse the repository at this point in the history
Just got it running on my VS2015
  • Loading branch information
SeriousSamV committed Feb 6, 2017
1 parent a2794c5 commit 496e9d8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
4 changes: 2 additions & 2 deletions 01/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ int main(void)
glGenVertexArrays(1, &VAO);

GLuint vertex_shader = mylib::compileShader(
"/home/sam/workspace/cpp/ogl_playground/01/simple.vertex.glsl",
"C:\\Users\\Samuel Vishesh Paul\\Documents\\GitHub\\My-Jolly-journey\\01/simple.vertex.glsl",
GL_VERTEX_SHADER
);
GLuint frag_shader = mylib::compileShader(
"/home/sam/workspace/cpp/ogl_playground/01/simple.fragment.glsl",
"C:\\Users\\Samuel Vishesh Paul\\Documents\\GitHub\\My-Jolly-journey\\01\\simple.fragment.glsl",
GL_FRAGMENT_SHADER
);
GLuint shader_program = mylib::linkShaderProgram(
Expand Down
34 changes: 25 additions & 9 deletions 09/main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#undef _NDEBUG

#define WIN32

#include "../lib/mylib.hpp"
#include "../lib/camera.hpp"

#include <epoxy/gl.h>
#ifdef _WIN32
#include <epoxy\wgl.h>
#else
#include <epoxy/glx.h>
#endif

#include <SOIL/SOIL.h>
#include <SOIL.h>

#define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp>
Expand Down Expand Up @@ -71,20 +77,20 @@ class myApp : public mylib::App
{
lightingShader = mylib::Shader({
std::make_pair(
"/home/sam/workspace/cpp/ogl_playground/07/07.vertex.glsl",
"C:\\Users\\Samuel Vishesh Paul\\Documents\\GitHub\\My-Jolly-journey\\07/07.vertex.glsl",
GL_VERTEX_SHADER),
std::make_pair(
//"/home/sam/workspace/cpp/ogl_playground/07/07.fragment.glsl",
"/home/sam/workspace/cpp/ogl_playground/09/ambientLighting.fragment.glsl",
"C:\\Users\\Samuel Vishesh Paul\\Documents\\GitHub\\My-Jolly-journey\\09\\ambientLighting.fragment.glsl",
GL_FRAGMENT_SHADER),
});
lightSrcShader = mylib::Shader({
std::make_pair(
"/home/sam/workspace/cpp/ogl_playground/07/07.vertex.glsl",
"C:\\Users\\Samuel Vishesh Paul\\Documents\\GitHub\\My-Jolly-journey\\07.vertex.glsl",
GL_VERTEX_SHADER),
std::make_pair(
//"/home/sam/workspace/cpp/ogl_playground/07/07.fragment.glsl",
"/home/sam/workspace/cpp/ogl_playground/09/lightSrc.fragment.glsl",
"C:\\Users\\Samuel Vishesh Paul\\Documents\\GitHub\\My-Jolly-journey\\09/lightSrc.fragment.glsl",
GL_FRAGMENT_SHADER),
});

Expand Down Expand Up @@ -203,9 +209,19 @@ class myApp : public mylib::App

int main(const int argc, const char *const argv[])
{
mylib::Window wind;
myApp app(std::move(wind));
app.run(app);

try
{
mylib::Window wind;
myApp app(std::move(wind));
app.run(app);
}
catch (const std::exception& e)
{
std::cerr << e.what() << std::endl;
std::cin.get();
std::exit(EXIT_FAILURE);
}

std::cin.get();
std::exit(EXIT_SUCCESS);
}
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ find_package(glm REQUIRED)
find_package(Boost REQUIRED)
find_package(tinyobjloader REQUIRED)

set(SOIL_INCLUDE_DIR "/usr/include/SOIL")
if(UNIX)
set(SOIL_INCLUDE_DIR "/usr/include/SOIL")
elseif(WIN32)
set(SOIL_INCLUDE_DIR "C:/Program Files/SOIL/include")
endif(UNIX)

set(SOIL_LIBRARY "SOIL")

set(ALL_INCLUDE_DIR
Expand All @@ -42,6 +47,10 @@ set(ALL_INCLUDE_DIR
${GTKMM_INCLUDE_DIRS}
)

if(WIN32)
set(ALL_INCLUDE_DIR ${ALL_INCLUDE_DIR} "C:/Program Files/epoxy/include")
endif(WIN32)

set(ALL_LIBS
${OPENGL_LIBRARY}
${SOIL_LIBRARY}
Expand Down

0 comments on commit 496e9d8

Please sign in to comment.