diff options
author | Jean-Luc Peurière <jlp@nerim.net> | 2007-06-03 01:42:54 +0400 |
---|---|---|
committer | Jean-Luc Peurière <jlp@nerim.net> | 2007-06-03 01:42:54 +0400 |
commit | 6cc1269d976641e6fdac59d1c1afbc96ae3aab8b (patch) | |
tree | 02bc32f07419e48a1492bc09609d5186fc095df6 /intern/ghost | |
parent | 16340dfe1235391bb675a633a099c17af3a731c7 (diff) | |
parent | c6158b9293d6c5ea15c323fea44138d3563d1a12 (diff) |
merge from trunk up to rev [10858]
WIP in the NDOF part, dont work yet
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/GHOST_Types.h | 1 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_NDOFManager.cpp | 7 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCarbon.cpp | 14 |
3 files changed, 14 insertions, 8 deletions
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index c0f7245eff1..f8f9a8d4735 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -343,6 +343,7 @@ typedef void (*GHOST_NDOFLibraryShutdown_fp)(void* deviceHandle); typedef void* (*GHOST_NDOFDeviceOpen_fp)(void* platformData); typedef int (*GHOST_NDOFEventHandler_fp)(float* result7, void* deviceHandle, unsigned int message, unsigned int* wParam, unsigned long* lParam); +/* original patch used floats, but the driver return ints and uns. We will calibrate in view, no sense on doing conversions twice */ typedef struct { /** N-degree of freedom device data */ float tx, ty, tz; /** -x left, +y up, +z forward */ diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp b/intern/ghost/intern/GHOST_NDOFManager.cpp index 86a9b56c7cc..3ac3d483d18 100644 --- a/intern/ghost/intern/GHOST_NDOFManager.cpp +++ b/intern/ghost/intern/GHOST_NDOFManager.cpp @@ -46,6 +46,7 @@ GHOST_NDOFManager::GHOST_NDOFManager() ndofLibraryShutdown = 0; ndofDeviceOpen = 0; ndofEventHandler = 0; + // available = 0; } GHOST_NDOFManager::~GHOST_NDOFManager() @@ -69,9 +70,9 @@ GHOST_NDOFManager::deviceOpen(GHOST_IWindow* window, ndofDeviceOpen = setNdofDeviceOpen; ndofEventHandler = setNdofEventHandler; - if (ndofLibraryInit) + if (ndofLibraryInit && ndofDeviceOpen) { - ndofLibraryInit(); + printf("%i client \n", ndofLibraryInit()); } /* if (ndofDeviceOpen) @@ -96,6 +97,7 @@ GHOST_NDOFManager::handle(unsigned int message, unsigned int* wParam, unsigned l { handled = ndofEventHandler(&sbdata.tx, m_DeviceHandle, message, wParam, lParam); } + printf("handled %i\n", handled); return handled ? &sbdata : 0; } @@ -105,3 +107,4 @@ GHOST_NDOFManager::available() { return m_DeviceHandle != 0; } + diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp index 9b0ccf37ef0..04debe36191 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.cpp +++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp @@ -49,20 +49,22 @@ AGLContext GHOST_WindowCarbon::s_firstaglCtx = NULL; const GHOST_TInt32 GHOST_WindowCarbon::s_sizeRectSize = 16; #endif //GHOST_DRAW_CARBON_GUTTER -static const GLint sPreferredFormatWindow[9] = { -AGL_RGBA, GL_TRUE, -AGL_DOUBLEBUFFER, GL_TRUE, -AGL_DEPTH_SIZE, 16, +static const GLint sPreferredFormatWindow[8] = { +AGL_RGBA, +AGL_DOUBLEBUFFER, +AGL_ACCELERATED, +AGL_DEPTH_SIZE, 32, AGL_AUX_BUFFERS, 1, AGL_NONE, }; -static const GLint sPreferredFormatFullScreen[7] = { +static const GLint sPreferredFormatFullScreen[9] = { AGL_RGBA, AGL_DOUBLEBUFFER, AGL_ACCELERATED, AGL_FULLSCREEN, -AGL_DEPTH_SIZE, 16, +AGL_DEPTH_SIZE, 32, +AGL_AUX_BUFFERS, 1, AGL_NONE, }; |