Fix compilation errors on Linux and issue in CMakeLists file of raycast example

This commit is contained in:
Daniel Chappuis 2015-01-31 02:12:56 +01:00
parent 111eec63fe
commit 3b2ce61cf2
2 changed files with 10 additions and 5 deletions

View File

@ -27,6 +27,8 @@
#include "Viewer.h"
#include "openglframework.h"
#include <iostream>
#include <cstdlib>
#include <sstream>
using namespace openglframework;
@ -60,7 +62,7 @@ void Viewer::init(int argc, char** argv, const std::string& windowsTitle,
// Initialize the GLFW library
if (!glfwInit()) {
exit(EXIT_FAILURE);
std::exit(EXIT_FAILURE);
}
// Active the multi-sampling by default
@ -73,7 +75,7 @@ void Viewer::init(int argc, char** argv, const std::string& windowsTitle,
static_cast<int>(windowsSize.y), mWindowTitle.c_str(), NULL, NULL);
if (!mWindow) {
glfwTerminate();
exit(EXIT_FAILURE);
std::exit(EXIT_FAILURE);
}
glfwMakeContextCurrent(mWindow);
@ -87,7 +89,7 @@ void Viewer::init(int argc, char** argv, const std::string& windowsTitle,
// Problem: glewInit failed, something is wrong
std::cerr << "GLEW Error : " << glewGetErrorString(errorGLEW) << std::endl;
assert(false);
exit(EXIT_FAILURE);
std::exit(EXIT_FAILURE);
}
if (isMultisamplingActive) {
@ -332,6 +334,9 @@ void Viewer::displayGUI() {
// Display the FPS
void Viewer::displayFPS() {
std::string windowTitle = mWindowTitle + " | FPS : " + std::to_string(mFPS);
std::stringstream ss;
ss << mFPS;
std::string fpsString = ss.str();
std::string windowTitle = mWindowTitle + " | FPS : " + fpsString;
glfwSetWindowTitle(mWindow, windowTitle.c_str());
}

View File

@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(Raycast)
# Where to build the executables
SET(EXECUTABLE_OUTPUT_PATH "${OUR_EXECUTABLE_OUTPUT_PATH}/collisionshapes")
SET(EXECUTABLE_OUTPUT_PATH "${OUR_EXECUTABLE_OUTPUT_PATH}/raycast")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXECUTABLE_OUTPUT_PATH})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH})