Skip to content

Commit

Permalink
Fix new mingw compile issues (except OpenAL)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcclure committed Jun 30, 2012
1 parent acd72ad commit 286943b
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions CMake/ExternalOggVorbis.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ EXTERNALPROJECT_ADD(libogg

ExternalProject_Get_Property(libogg install_dir)

# Kludge: Shouldn't be necessary if FIND_LIBRARY were working on mingw.
IF (MINGW)
SET(oggvorbis_CMAKE_ARGS ${oggvorbis_CMAKE_ARGS}
-DOGG_LIBRARY=libogg
Expand Down
2 changes: 1 addition & 1 deletion CMake/ExternalOpenAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SET(openal_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/openal)
SET(openal_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_DEBUG_POSTFIX=d
)
Expand Down
1 change: 1 addition & 0 deletions CMake/ExternalPNG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ EXTERNALPROJECT_ADD(zlib

ExternalProject_Get_Property(zlib install_dir)

# Kludge: Shouldn't be necessary if FIND_LIBRARY were working on mingw.
IF (MINGW)
SET(libpng_CMAKE_ARGS ${libpng_CMAKE_ARGS}
-DZLIB_LIBRARY=zlib
Expand Down
1 change: 1 addition & 0 deletions CMake/physfs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ ENDIF(PHYSFS_ARCHIVE_QPAK)
IF(PHYSFS_NEED_ZLIB)
FIND_PACKAGE(ZLIB)

# Kludge: Shouldn't be necessary if FIND_LIBRARY were working on mingw.
IF(MINGW)
SET(ZLIB_FOUND 1)
SET(ZLIB_LIBRARY zlib)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ SET(CMAKE_PREFIX_PATH
MESSAGE(DEBUG " CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}")

# If the following large ugly mess is not present, failures can occur with -G "Unix Makefiles".
# FIXME: cmake should be finding ALL of the following things by way of CMAKE_PREFIX_PATH
# FIXME: Shouldn't be necessary if FIND_LIBRARY were working on mingw.
IF (MINGW)
LINK_DIRECTORIES(${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/lib)
LINK_DIRECTORIES(${POLYCODE_RELEASE_DIR}/Framework/Modules/Dependencies/lib)
Expand Down
1 change: 1 addition & 0 deletions Core/Contents/Include/PolyGLHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ typedef GLEEPFNGLBINDATTRIBLOCATIONPROC PFNGLBINDATTRIBLOCATIONPROC;
typedef GLEEPFNGLVERTEXATTRIBPOINTERPROC PFNGLVERTEXATTRIBPOINTERPROC;
typedef GLEEPFNGLENABLEVERTEXATTRIBARRAYARBPROC PFNGLENABLEVERTEXATTRIBARRAYARBPROC;
typedef GLEEPFNGLBINDATTRIBLOCATIONPROC PFNGLBINDATTRIBLOCATIONPROC;
typedef GLEEPFNGLUNIFORM2FPROC PFNGLUNIFORM2FPROC;
#endif

#if defined(__APPLE__) && defined(__MACH__)
Expand Down
7 changes: 6 additions & 1 deletion Core/Contents/Include/PolyWinCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@

#define EXTENDED_KEYMASK (1<<24)

#ifdef _MINGW
#define NO_TOUCH_API 1
#endif

namespace Polycode {

class _PolyExport Win32Mutex : public CoreMutex {
Expand Down Expand Up @@ -256,12 +260,13 @@ class Gamepad_devicePrivate {
// Tracks whether the system supports multitouch at runtime
bool hasMultiTouch;

#ifndef NO_TOUCH_API
// Create generic reference to any multitouch functions we need, so that we
// can make them available at runtime if the operating system supports it
// while still allowing fallback for older systems
// See: http://msdn.microsoft.com/en-us/library/ms683212(v=vs.85).aspx
typedef bool (WINAPI *GetTouchInputInfoType)(HTOUCHINPUT,UINT,PTOUCHINPUT,int);
GetTouchInputInfoType GetTouchInputInfoFunc;
#endif
};
}
1 change: 0 additions & 1 deletion Core/Contents/Source/PolyGLSLShaderModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ GLSLShaderModule::GLSLShaderModule() : PolycodeShaderModule() {
glUniform1f = (PFNGLUNIFORM1FPROC)wglGetProcAddress("glUniform1f");
glUniform2f = (PFNGLUNIFORM2FPROC)wglGetProcAddress("glUniform2f");
glUniform3f = (PFNGLUNIFORM3FPROC)wglGetProcAddress("glUniform3f");
glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONARBPROC)wglGetProcAddress("glGetUniformLocation");
glCreateShader = (PFNGLCREATESHADERPROC)wglGetProcAddress("glCreateShader");
glShaderSource = (PFNGLSHADERSOURCEPROC)wglGetProcAddress("glShaderSource");
glCompileShader = (PFNGLCOMPILESHADERPROC)wglGetProcAddress("glCompileShader");
Expand Down
8 changes: 6 additions & 2 deletions Core/Contents/Source/PolyWinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ void Win32Core::handleKeyUp(LPARAM lParam, WPARAM wParam) {
unlockMutex(eventMutex);
}

#ifndef NO_TOUCH_API
void Win32Core::handleTouchEvent(LPARAM lParam, WPARAM wParam) {

// Bail out now if multitouch is not available on this system
Expand Down Expand Up @@ -490,6 +491,7 @@ void Win32Core::handleTouchEvent(LPARAM lParam, WPARAM wParam) {
}
unlockMutex(eventMutex);
}
#endif

void Win32Core::handleMouseMove(LPARAM lParam, WPARAM wParam) {
lockMutex(eventMutex);
Expand Down Expand Up @@ -809,7 +811,9 @@ void Win32Core::shutdownGamepad() {
}

void Win32Core::initTouch() {

#ifdef NO_TOUCH_API
hasMultiTouch = false;
#else
// Check for windows multitouch support at runtime
// This could be done easily during preprocessing but would require building
// multiple releases of polycode for both winxp/vista and win7
Expand All @@ -818,7 +822,7 @@ void Win32Core::initTouch() {
// If the above multitouch functions were found, then set a flag so we don't
// have to check again later
hasMultiTouch = ( GetTouchInputInfoFunc == NULL ) ? false : true;
#endif
}


Expand Down
5 changes: 4 additions & 1 deletion Modules/Contents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ ENDIF(FREENECT_FOUND)

ADD_SUBDIRECTORY(UI)
ADD_SUBDIRECTORY(Networking)
ADD_SUBDIRECTORY(TUIO)

IF (NOT MINGW)
ADD_SUBDIRECTORY(TUIO)
ENDIF (NOT MINGW)

0 comments on commit 286943b

Please sign in to comment.