3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-26 14:15:39 +02:00

more windows build fixes

This commit is contained in:
Brad Hefta-Gaub 2014-01-12 22:52:06 -08:00
parent 2017f850c4
commit d92d043e8f
5 changed files with 38 additions and 12 deletions

View file

@ -34,7 +34,8 @@ if (UNIX AND NOT APPLE)
endif (UNIX AND NOT APPLE)
if (WIN32)
add_definitions( -D_USE_MATH_DEFINES ) # apparently needed to get M_PI and other defines from cmath/math.h
add_definitions( -D_USE_MATH_DEFINES -DWINDOWS_LEAN_AND_MEAN ) # apparently needed to get M_PI and other defines from cmath/math.h
#set(GLUT_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external/glut)
#set(GL_HEADERS "#define GLEW_STATIC\n#define FREEGLUT_STATIC\n#define FREEGLUT_LIB_PRAGMAS 0\n#include <GL/glew.h>\n#include <GL/wglew.h>\n#include <GL/freeglut_std.h>\n#include <GL/freeglut_ext.h>")

View file

@ -5,6 +5,10 @@
// Created by Andrzej Kapolka on 5/10/13.
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
#ifdef WIN32
#include <Systime.h>
#endif
#include <sstream>
#include <stdlib.h>
@ -3477,11 +3481,6 @@ void Application::displayOverlay() {
glPopMatrix();
}
#ifdef WIN32
double roundf(double value) {
return (value > 0.0) ? floor(value + 0.5) : ceil(value - 0.5);
}
#endif
void Application::displayStats() {
int statsVerticalOffset = 8;

View file

@ -6,6 +6,11 @@
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
//
#ifdef WIN32
#define WANT_TIMEVAL
#include <Systime.h>
#endif
#include <cstring>
#include <glm/glm.hpp>
@ -115,17 +120,17 @@ void Transmitter::renderLevels(int width, int height) {
// Draw the numeric degree/sec values from the gyros
sprintf(val, "Pitch Rate %4.1f", _lastRotationRate.x);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y, 0.10, 0, 1.0, 1, val, 0, 1, 0);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "Yaw Rate %4.1f", _lastRotationRate.y);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 15, 0.10, 0, 1.0, 1, val, 0, 1, 0);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 15, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "Roll Rate %4.1f", _lastRotationRate.z);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 30, 0.10, 0, 1.0, 1, val, 0, 1, 0);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 30, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "Pitch %4.3f", _estimatedRotation.x);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 45, 0.10, 0, 1.0, 1, val, 0, 1, 0);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 45, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "Yaw %4.3f", _estimatedRotation.y);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 60, 0.10, 0, 1.0, 1, val, 0, 1, 0);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 60, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
sprintf(val, "Roll %4.3f", _estimatedRotation.z);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 75, 0.10, 0, 1.0, 1, val, 0, 1, 0);
drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 75, 0.10f, 0, 1.0f, 1, val, 0, 1, 0);
// Draw the levels as horizontal lines
const int LEVEL_CENTER = 150;

View file

@ -9,6 +9,11 @@
#include <QNetworkReply>
#ifdef WIN32
#define WANT_TIMEVAL
#include <Systime.h>
#endif
#include "Application.h"
#include "GeometryCache.h"
#include "world.h"

View file

@ -11,11 +11,27 @@
#ifndef __hifi__windowshacks__
#define __hifi__windowshacks__
#ifdef WIN32
#undef NOMINMAX
#define GLdouble GLdouble
#define GL_DOUBLE 0x140A
#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
#define GL_RESCALE_NORMAL 0x803A
#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
#define GL_CLAMP_TO_BORDER 0x812D
#include <cmath>
inline double roundf(double value) {
return (value > 0.0) ? floor(value + 0.5) : ceil(value - 0.5);
}
#endif // WIN32
#endif // __hifi__windowshacks__