Windows implementation WIP
This commit is contained in:
@@ -30,26 +30,53 @@ float const D2R = PI * 2 / 360;
|
||||
#include <fstream>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "../3rdparty/tinyxml2/tinyxml2.h"
|
||||
#else
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <Accelerate/Accelerate.h>
|
||||
#include <AudioToolbox/AudioToolbox.h>
|
||||
#include <AudioToolbox/AudioFile.h>
|
||||
#include <AudioToolbox/ExtendedAudioFile.h>
|
||||
#include <AudioToolbox/AUGraph.h>
|
||||
#include <OpenAL/al.h>
|
||||
#include <OpenAL/alc.h>
|
||||
#if TARGET_OS_IPHONE
|
||||
#include <OpenAL/oalMacOSX_OALExtensions.h>
|
||||
#else
|
||||
#include <OpenAL/MacOSX_OALExtensions.h>
|
||||
#endif
|
||||
|
||||
#include "tinyxml2.h"
|
||||
#endif
|
||||
|
||||
#include <boost/tokenizer.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/signals2/mutex.hpp>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <limits>
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <boost/tokenizer.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/signals2/mutex.hpp>
|
||||
#include <iostream>
|
||||
|
||||
// _USE_MATH_DEFINES must be defined to get M_PI in Windows
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
|
||||
#include "tinyxml2.h"
|
||||
|
||||
|
||||
|
||||
using std::vector;
|
||||
@@ -84,18 +111,41 @@ using std::unordered_map;
|
||||
using std::unordered_multimap;
|
||||
using std::hash;
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
|
||||
#include <mutex>
|
||||
#include <cstdint>
|
||||
typedef int64_t __int64_t;
|
||||
typedef uint64_t __uint64_t;
|
||||
typedef int32_t __int32_t;
|
||||
typedef uint32_t __uint32_t;
|
||||
typedef int16_t __int16_t;
|
||||
typedef uint16_t __uint16_t;
|
||||
typedef int8_t __int8_t;
|
||||
typedef uint8_t __uint8_t;
|
||||
|
||||
#include <GL/glew.h>
|
||||
// OpenGL ES 2.0 mapping to OpenGL 3.2
|
||||
#define glDeleteQueriesEXT glDeleteQueries
|
||||
#define glGenQueriesEXT glGenQueries
|
||||
#define glBeginQueryEXT glBeginQuery
|
||||
#define glEndQueryEXT glEndQuery
|
||||
#define glGetQueryObjectuivEXT glGetQueryObjectuiv
|
||||
#define glTexStorage2DEXT glTexStorage2D
|
||||
#define GL_ANY_SAMPLES_PASSED_EXT GL_ANY_SAMPLES_PASSED
|
||||
#define GL_QUERY_RESULT_EXT GL_QUERY_RESULT
|
||||
|
||||
#elif TARGET_OS_IPHONE
|
||||
|
||||
#include <OpenGLES/ES2/gl.h>
|
||||
#include <OpenGLES/ES2/glext.h>
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#include <OpenGL/gl3.h>
|
||||
#include <OpenGL/gl3ext.h>
|
||||
|
||||
// OpenGL ES 2.0 mapping to OpenGL 3.2 mappings
|
||||
// OpenGL ES 2.0 mapping to OpenGL 3.2
|
||||
#define glDepthRangef glDepthRange
|
||||
#define glClearDepthf glClearDepth
|
||||
#define glDeleteQueriesEXT glDeleteQueries
|
||||
@@ -119,21 +169,7 @@ using std::hash;
|
||||
|
||||
#endif
|
||||
|
||||
#include <Accelerate/Accelerate.h>
|
||||
#include <AudioToolbox/AudioToolbox.h>
|
||||
#include <AudioToolbox/AudioFile.h>
|
||||
#include <AudioToolbox/ExtendedAudioFile.h>
|
||||
#include <AudioToolbox/AUGraph.h>
|
||||
#include <OpenAL/al.h>
|
||||
#include <OpenAL/alc.h>
|
||||
#if TARGET_OS_IPHONE
|
||||
#include <OpenAL/oalMacOSX_OALExtensions.h>
|
||||
#else
|
||||
#include <OpenAL/MacOSX_OALExtensions.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if DEBUG
|
||||
#if defined(DEBUG) || defined(_DEBUG)
|
||||
#define GLDEBUG(x) \
|
||||
x; \
|
||||
{ \
|
||||
@@ -148,7 +184,7 @@ fprintf(stderr, "Error at line number %d, in file %s. glGetError() returned %i f
|
||||
#endif
|
||||
|
||||
|
||||
#if DEBUG
|
||||
#if defined(DEBUG) || defined(_DEBUG)
|
||||
#define ALDEBUG(x) \
|
||||
x; \
|
||||
{ \
|
||||
@@ -162,7 +198,7 @@ fprintf(stderr, "Error at line number %d, in file %s. alGetError() returned %i f
|
||||
#define ALDEBUG(x) x;
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
#if defined(DEBUG) || defined(_DEBUG)
|
||||
#define OSDEBUG(x) \
|
||||
{ \
|
||||
OSStatus e = x; \
|
||||
@@ -176,7 +212,7 @@ fprintf(stderr, "Error at line number %d, in file %s. Returned %d for call %s\n"
|
||||
#endif
|
||||
|
||||
|
||||
#if GL_EXT_debug_marker && DEBUG
|
||||
#if defined(GL_EXT_debug_marker) && (defined(DEBUG) || defined(_DEBUG))
|
||||
|
||||
#define GL_PUSH_GROUP_MARKER(x) glPushGroupMarkerEXT(0, x)
|
||||
#define GL_POP_GROUP_MARKER glPopGroupMarkerEXT()
|
||||
|
||||
Reference in New Issue
Block a user