Fix compilation errors on Visual Studio

This commit is contained in:
Daniel Chappuis 2015-08-13 19:47:29 +02:00
parent aff7c2ec53
commit 1bde11f245
8 changed files with 10 additions and 9 deletions

View File

@ -28,7 +28,7 @@ SET(CMAKE_CXX_FLAGS "-std=c++0x")
#ADD_DEFINITIONS(-DGL3) #ADD_DEFINITIONS(-DGL3)
# Headers # Headers
INCLUDE_DIRECTORIES("src/" "opengl-framework/src/" "glfw/include/" "common/" "scenes/" "imgui/") INCLUDE_DIRECTORIES(${GLEW_INCLUDE_PATH} "src/" "opengl-framework/src/" "glfw/include/" "common/" "scenes/" "imgui/")
# Testbed source files # Testbed source files
SET(TESTBED_SOURCES SET(TESTBED_SOURCES

View File

@ -236,7 +236,7 @@ void Cone::createVBOAndVAO() {
// Create th VBO for the indices data // Create th VBO for the indices data
mVBOIndices.create(); mVBOIndices.create();
mVBOIndices.bind(); mVBOIndices.bind();
size_t sizeIndices = mIndices[0].size() * sizeof(uint); size_t sizeIndices = mIndices[0].size() * sizeof(unsigned int);
mVBOIndices.copyDataIntoVBO(sizeIndices, getIndicesPointer(), GL_STATIC_DRAW); mVBOIndices.copyDataIntoVBO(sizeIndices, getIndicesPointer(), GL_STATIC_DRAW);
mVBOIndices.unbind(); mVBOIndices.unbind();

View File

@ -260,7 +260,7 @@ void ConvexMesh::createVBOAndVAO() {
// Create th VBO for the indices data // Create th VBO for the indices data
mVBOIndices.create(); mVBOIndices.create();
mVBOIndices.bind(); mVBOIndices.bind();
size_t sizeIndices = mIndices[0].size() * sizeof(uint); size_t sizeIndices = mIndices[0].size() * sizeof(unsigned int);
mVBOIndices.copyDataIntoVBO(sizeIndices, getIndicesPointer(), GL_STATIC_DRAW); mVBOIndices.copyDataIntoVBO(sizeIndices, getIndicesPointer(), GL_STATIC_DRAW);
mVBOIndices.unbind(); mVBOIndices.unbind();

View File

@ -237,7 +237,7 @@ void Cylinder::createVBOAndVAO() {
// Create th VBO for the indices data // Create th VBO for the indices data
mVBOIndices.create(); mVBOIndices.create();
mVBOIndices.bind(); mVBOIndices.bind();
size_t sizeIndices = mIndices[0].size() * sizeof(uint); size_t sizeIndices = mIndices[0].size() * sizeof(unsigned int);
mVBOIndices.copyDataIntoVBO(sizeIndices, getIndicesPointer(), GL_STATIC_DRAW); mVBOIndices.copyDataIntoVBO(sizeIndices, getIndicesPointer(), GL_STATIC_DRAW);
mVBOIndices.unbind(); mVBOIndices.unbind();

View File

@ -273,7 +273,7 @@ void Dumbbell::createVBOAndVAO() {
// Create th VBO for the indices data // Create th VBO for the indices data
mVBOIndices.create(); mVBOIndices.create();
mVBOIndices.bind(); mVBOIndices.bind();
size_t sizeIndices = mIndices[0].size() * sizeof(uint); size_t sizeIndices = mIndices[0].size() * sizeof(unsigned int);
mVBOIndices.copyDataIntoVBO(sizeIndices, getIndicesPointer(), GL_STATIC_DRAW); mVBOIndices.copyDataIntoVBO(sizeIndices, getIndicesPointer(), GL_STATIC_DRAW);
mVBOIndices.unbind(); mVBOIndices.unbind();

View File

@ -161,7 +161,7 @@ void VisualContactPoint::createVBOAndVAO() {
// Create th VBO for the indices data // Create th VBO for the indices data
mVBOIndices.create(); mVBOIndices.create();
mVBOIndices.bind(); mVBOIndices.bind();
size_t sizeIndices = mMesh.getIndices(0).size() * sizeof(uint); size_t sizeIndices = mMesh.getIndices(0).size() * sizeof(unsigned int);
mVBOIndices.copyDataIntoVBO(sizeIndices, mMesh.getIndicesPointer(), GL_STATIC_DRAW); mVBOIndices.copyDataIntoVBO(sizeIndices, mMesh.getIndicesPointer(), GL_STATIC_DRAW);
mVBOIndices.unbind(); mVBOIndices.unbind();

View File

@ -33,6 +33,7 @@
#include "Vector3.h" #include "Vector3.h"
#include "Vector4.h" #include "Vector4.h"
#include "Matrix3.h" #include "Matrix3.h"
#include "definitions.h"
namespace openglframework { namespace openglframework {
@ -441,7 +442,7 @@ inline Matrix4 Matrix4::perspectiveProjectionMatrix(float near, float far, int w
// Compute the aspect ratio // Compute the aspect ratio
float aspect = float(width) / float(height); float aspect = float(width) / float(height);
float top = near * tan((fieldOfView / 2.0f) * (float(M_PI) / 180.0f)); float top = near * tan((fieldOfView / 2.0f) * (float(PI) / 180.0f));
float bottom = -top; float bottom = -top;
float left = bottom * aspect; float left = bottom * aspect;
float right = top * aspect; float right = top * aspect;

View File

@ -139,8 +139,8 @@ void RaycastScene::createLines() {
for (int i=0; i<nbRaysOneDimension; i++) { for (int i=0; i<nbRaysOneDimension; i++) {
for (int j=0; j<nbRaysOneDimension; j++) { for (int j=0; j<nbRaysOneDimension; j++) {
float theta = i * 2.0f * M_PI / float(nbRaysOneDimension); float theta = i * 2.0f * PI / float(nbRaysOneDimension);
float phi = j * M_PI / float(nbRaysOneDimension); float phi = j * PI / float(nbRaysOneDimension);
// Generate a point on a sphere with spherical coordinates // Generate a point on a sphere with spherical coordinates
float x = RAY_LENGTH * std::sin(phi) * std::cos(theta); float x = RAY_LENGTH * std::sin(phi) * std::cos(theta);