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

more windows float warning and error fixes

This commit is contained in:
Brad Hefta-Gaub 2014-01-12 22:07:37 -08:00
parent 19012e2f6d
commit 2017f850c4
4 changed files with 10 additions and 4 deletions

View file

@ -41,7 +41,8 @@ if (WIN32)
# this bit of #define GLdouble GLdouble is to fix up a mismatch between windows and the Qt versions of open GL.
# this will cause the QT versions to not accidentally define GLdouble as a float.
# undeffing NOMINMAX is because the Qt stuff doesn't safely check that that isn't already defined.
set(GL_HEADERS "#undef NOMINMAX\n#define GLdouble GLdouble\n#include <GL/glut.h>")
# need to add #define GL_DOUBLE
set(GL_HEADERS "#include <windowshacks.h>\n#include <GL/glut.h>")
endif (WIN32)
# set up the external glm library

View file

@ -74,7 +74,7 @@ void PieMenu::render() {
glColor3f(1.0f, 1.0f, 1.0f);
if (_radiusIntern < distance) {
float angle = atan2((_mouseY - _y), (_mouseX - _x)) - start;
float angle = atan2((float)(_mouseY - _y), (float)(_mouseX - _x)) - start;
angle = (0.0f < angle) ? angle : angle + 2.0f * M_PI;
_selectedAction = floor(angle / (2.0f * M_PI / _actions.size()));

View file

@ -12,12 +12,12 @@
#include "starfield/Config.h"
namespace starfield {
const float LOG2 = 1.4426950408889634;
const float LOG2 = 1.4426950408889634f;
class Tiling {
public:
Tiling(unsigned tileResolution) : _tileResolution(tileResolution), _rcpSlice(tileResolution / Radians::twicePi()) {
_nBits = ceil(log(getTileCount()) * LOG2); }
_nBits = ceil(log((float)getTileCount()) * LOG2); }
unsigned getAzimuthalTiles() const { return _tileResolution; }
unsigned getAltitudinalTiles() const { return _tileResolution / 2 + 1; }

View file

@ -11,6 +11,11 @@
#ifndef __hifi__windowshacks__
#define __hifi__windowshacks__
#undef NOMINMAX
#define GLdouble GLdouble
#define GL_DOUBLE 0x140A
#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
#define GL_RESCALE_NORMAL 0x803A
#endif // __hifi__windowshacks__