From 98efbade9bee5478eb9b5f649f678707311977e1 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 13 Jan 2014 01:09:29 -0800 Subject: [PATCH] clean up windowshacks.h --- interface/src/windowshacks.h | 39 ++++++++++++++---------------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/interface/src/windowshacks.h b/interface/src/windowshacks.h index b186df4a21..e8afee2f06 100644 --- a/interface/src/windowshacks.h +++ b/interface/src/windowshacks.h @@ -12,26 +12,14 @@ #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 inline double roundf(double value) { return (value > 0.0) ? floor(value + 0.5) : ceil(value - 0.5); } #define round roundf - - #ifdef _MSC_VER #ifndef SNPRINTF_FIX #define SNPRINTF_FIX @@ -40,20 +28,18 @@ inline double roundf(double value) { #define snprintf c99_snprintf -inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap) -{ +inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap) { int count = -1; - - if (size != 0) + if (size != 0) { count = _vsnprintf_s(str, size, _TRUNCATE, format, ap); - if (count == -1) + } + if (count == -1) { count = _vscprintf(format, ap); - + } return count; } -inline int c99_snprintf(char* str, size_t size, const char* format, ...) -{ +inline int c99_snprintf(char* str, size_t size, const char* format, ...) { int count; va_list ap; @@ -64,11 +50,16 @@ inline int c99_snprintf(char* str, size_t size, const char* format, ...) return count; } #endif // SNPRINTF_FIX - #endif // _MSC_VER + +// OpenGL related hacks, this is temporary +#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 + #endif // WIN32 - - - #endif // __hifi__windowshacks__ \ No newline at end of file