make source compile under MinGW32
todo: link against OpenGL GLU/GLUT.
This commit is contained in:
@@ -254,7 +254,7 @@ int maxNumOutstandingTasks = 4;
|
|||||||
|
|
||||||
#ifdef USE_WIN32_THREADING
|
#ifdef USE_WIN32_THREADING
|
||||||
|
|
||||||
m_threadSupportCollision = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo(
|
m_threadSupportCollision = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo(
|
||||||
"collision",
|
"collision",
|
||||||
processCollisionTask,
|
processCollisionTask,
|
||||||
createCollisionLocalStoreMemory,
|
createCollisionLocalStoreMemory,
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ typedef union
|
|||||||
void *p;
|
void *p;
|
||||||
} addr64;
|
} addr64;
|
||||||
|
|
||||||
|
#define USE_WIN32_THREADING 1
|
||||||
|
|
||||||
#if defined(__MINGW32__) || defined(__CYGWIN__) || (defined (_MSC_VER) && _MSC_VER < 1300)
|
#if defined(__MINGW32__) || defined(__CYGWIN__) || (defined (_MSC_VER) && _MSC_VER < 1300)
|
||||||
#else
|
#else
|
||||||
#endif //__MINGW32__
|
#endif //__MINGW32__
|
||||||
@@ -26,7 +28,7 @@ typedef union
|
|||||||
|
|
||||||
#include <string.h> //memcpy
|
#include <string.h> //memcpy
|
||||||
|
|
||||||
#define USE_WIN32_THREADING 1
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define spu_printf printf
|
#define spu_printf printf
|
||||||
|
|||||||
@@ -17,17 +17,20 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
#ifdef USE_WIN32_THREADING
|
#ifdef USE_WIN32_THREADING
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
#include "SpuCollisionTaskProcess.h"
|
#include "SpuCollisionTaskProcess.h"
|
||||||
|
|
||||||
#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
|
#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
|
||||||
|
|
||||||
#include <Windows.h>
|
|
||||||
|
|
||||||
///The number of threads should be equal to the number of available cores
|
///The number of threads should be equal to the number of available cores
|
||||||
///Todo: each worker should be linked to a single core, using SetThreadIdealProcessor.
|
///Todo: each worker should be linked to a single core, using SetThreadIdealProcessor.
|
||||||
|
|
||||||
///Win32ThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
|
///Win32ThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
|
||||||
///Setup and initialize SPU/CELL/Libspe2
|
///Setup and initialize SPU/CELL/Libspe2
|
||||||
Win32ThreadSupport::Win32ThreadSupport(Win32ThreadConstructionInfo& threadConstructionInfo)
|
Win32ThreadSupport::Win32ThreadSupport(const Win32ThreadConstructionInfo & threadConstructionInfo)
|
||||||
{
|
{
|
||||||
startThreads(threadConstructionInfo);
|
startThreads(threadConstructionInfo);
|
||||||
}
|
}
|
||||||
@@ -173,7 +176,7 @@ void Win32ThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned in
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Win32ThreadSupport::startThreads(Win32ThreadConstructionInfo& threadConstructionInfo)
|
void Win32ThreadSupport::startThreads(const Win32ThreadConstructionInfo& threadConstructionInfo)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_activeSpuStatus.resize(threadConstructionInfo.m_numThreads);
|
m_activeSpuStatus.resize(threadConstructionInfo.m_numThreads);
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ private:
|
|||||||
public:
|
public:
|
||||||
///Setup and initialize SPU/CELL/Libspe2
|
///Setup and initialize SPU/CELL/Libspe2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct Win32ThreadConstructionInfo
|
struct Win32ThreadConstructionInfo
|
||||||
{
|
{
|
||||||
Win32ThreadConstructionInfo(char* uniqueName,
|
Win32ThreadConstructionInfo(char* uniqueName,
|
||||||
@@ -94,12 +92,14 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Win32ThreadSupport(Win32ThreadConstructionInfo& threadConstructionInfo);
|
|
||||||
|
|
||||||
|
Win32ThreadSupport(const Win32ThreadConstructionInfo& threadConstructionInfo);
|
||||||
|
|
||||||
///cleanup/shutdown Libspe2
|
///cleanup/shutdown Libspe2
|
||||||
virtual ~Win32ThreadSupport();
|
virtual ~Win32ThreadSupport();
|
||||||
|
|
||||||
void startThreads(Win32ThreadConstructionInfo& threadInfo);
|
void startThreads(const Win32ThreadConstructionInfo& threadInfo);
|
||||||
|
|
||||||
|
|
||||||
///send messages to SPUs
|
///send messages to SPUs
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ void
|
|||||||
daeMetaElement::validate()
|
daeMetaElement::validate()
|
||||||
{
|
{
|
||||||
if (_createFunc == NULL)
|
if (_createFunc == NULL)
|
||||||
_createFunc = DAECreateElement;
|
_createFunc = (daeElementConstructFunctionPtr) DAECreateElement;
|
||||||
if (_elementSize == 0)
|
if (_elementSize == 0)
|
||||||
{
|
{
|
||||||
daeInt place=0;
|
daeInt place=0;
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ xmlModuleFree(xmlModulePtr module)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
#ifdef HAVE_DLOPEN
|
#ifdef HAVE_DLOPEN
|
||||||
#ifdef HAVE_DLFCN_H
|
#ifdef HAVE_DLFCN_H
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
@@ -287,6 +288,7 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
|
|||||||
|
|
||||||
#endif /* HAVE_SHLLOAD */
|
#endif /* HAVE_SHLLOAD */
|
||||||
#endif /* ! HAVE_DLOPEN */
|
#endif /* ! HAVE_DLOPEN */
|
||||||
|
#endif //0
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,10 @@
|
|||||||
# endif
|
# endif
|
||||||
/* XXX This is from Win32's <ctype.h> */
|
/* XXX This is from Win32's <ctype.h> */
|
||||||
# ifndef _WCHAR_T_DEFINED
|
# ifndef _WCHAR_T_DEFINED
|
||||||
typedef unsigned short wchar_t;
|
/* MinGW32 chokes on the next line */
|
||||||
|
#ifndef __MINGW32__
|
||||||
|
typedef unsigned short int wchar_t;
|
||||||
|
#endif //__MINGW32__
|
||||||
# define _WCHAR_T_DEFINED
|
# define _WCHAR_T_DEFINED
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
Reference in New Issue
Block a user