diff --git a/.gitattributes b/.gitattributes index 531a13d..2148e2e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -68,7 +68,6 @@ freeglut/freeglut/src/freeglut_font_data.c svn_keywords=Author+Date+Id+Revision freeglut/freeglut/src/freeglut_gamemode.c svn_keywords=Author+Date+Id+Revision freeglut/freeglut/src/freeglut_geometry.c svn_keywords=Author+Date+Id+Revision freeglut/freeglut/src/freeglut_glutfont_definitions.c svn_keywords=Author+Date+Id+Revision -freeglut/freeglut/src/freeglut_gx.cpp svn_keywords=Author+Date+Id+Revision freeglut/freeglut/src/freeglut_init.c svn_keywords=Author+Date+Id+Revision freeglut/freeglut/src/freeglut_internal.h svn_keywords=Author+Date+Id+Revision freeglut/freeglut/src/freeglut_joystick.c svn_keywords=Author+Date+Id+Revision diff --git a/freeglut/freeglut/freeglut_evc4.vcp b/freeglut/freeglut/freeglut_evc4.vcp index 296765e..1bc8044 100644 --- a/freeglut/freeglut/freeglut_evc4.vcp +++ b/freeglut/freeglut/freeglut_evc4.vcp @@ -208,24 +208,6 @@ DEP_CPP_FREEGLUT_GL=\ # End Source File # Begin Source File -SOURCE=.\src\freeglut_gx.cpp -DEP_CPP_FREEGLUT_GX=\ - ".\src\freeglut_internal.h"\ - {$(INCLUDE)}"gx.h"\ - -NODEP_CPP_FREEGLUT_GX=\ - ".\src\config.h"\ - - -!IF "$(CFG)" == "freeglut - Win32 (WCE ARMV4) Release" - -!ELSEIF "$(CFG)" == "freeglut - Win32 (WCE ARMV4) Debug" - -!ENDIF - -# End Source File -# Begin Source File - SOURCE=.\src\freeglut_init.c DEP_CPP_FREEGLUT_I=\ ".\src\freeglut_internal.h"\ @@ -255,6 +237,7 @@ DEP_CPP_FREEGLUT_M=\ {$(INCLUDE)}"GL\freeglut.h"\ {$(INCLUDE)}"GL\freeglut_ext.h"\ {$(INCLUDE)}"GL\freeglut_std.h"\ + {$(INCLUDE)}"gx.h"\ NODEP_CPP_FREEGLUT_M=\ ".\src\config.h"\ diff --git a/freeglut/freeglut/src/freeglut_gx.cpp b/freeglut/freeglut/src/freeglut_gx.cpp deleted file mode 100644 index bdbcd47..0000000 --- a/freeglut/freeglut/src/freeglut_gx.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * freeglut_gx.cpp - * - * WindowsCE specific file - * - * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. - * Written by Pawel W. Olszta, - * Creation date: Fri Dec 3 1999 - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "freeglut_internal.h" - -#if TARGET_HOST_WINCE - - -#include -#include - -#pragma comment( lib, "gx.lib" ) - -// Microsoft decided that gapi should only work in C++ (thanks...) -// so we need a c-wrapper for it... -// - -extern "C" -{ - -void wince_GetDefaultKeys(void* nData, int iOptions) -{ - *(GXKeyList*)nData = GXGetDefaultKeys(iOptions); -}; - - -void wince_OpenInput() -{ - GXOpenInput(); -} - -} - - -#endif diff --git a/freeglut/freeglut/src/freeglut_init.c b/freeglut/freeglut/src/freeglut_init.c index 43d3e25..36e3498 100644 --- a/freeglut/freeglut/src/freeglut_init.c +++ b/freeglut/freeglut/src/freeglut_init.c @@ -176,7 +176,7 @@ void fgInitialize( const char* displayName ) wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; if (!wc.hIcon) wc.hIcon = LoadIcon( NULL, IDI_WINLOGO ); -#else //TARGET_HOST_WINCE +#else /* TARGET_HOST_WINCE */ wc.style = CS_HREDRAW | CS_VREDRAW; #endif diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index 25c8e38..72ef45d 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -42,41 +42,18 @@ #include #elif TARGET_HOST_WIN32 #elif TARGET_HOST_WINCE - // including gx.h does only work in c++ (thanks MS...), - // so we define this on our own... -struct GXKeyList { - short vkUp; // key for up - POINT ptUp; // x,y position of key/button. Not on screen but in screen coordinates. - short vkDown; - POINT ptDown; - short vkLeft; - POINT ptLeft; - short vkRight; - POINT ptRight; - short vkA; - POINT ptA; - short vkB; - POINT ptB; - short vkC; - POINT ptC; - short vkStart; - POINT ptStart; -}; -/*__declspec(dllimport) struct GXKeyList GXGetDefaultKeys(int iOptions); -__declspec(dllimport) int GXOpenInput(); -#include "my_gx.h"*/ -extern void wince_GetDefaultKeys(void* nData, int iOptions); -extern void wince_OpenInput(); +typedef struct GXDisplayProperties GXDisplayProperties; +typedef struct GXKeyList GXKeyList; +#include -/*void wince_GetDefaultKeys(void* nData, int iOptions) -{ - *(struct GXKeyList*)nData = GXGetDefaultKeys(iOptions); -} -void wince_OpenInput() -{ - GXOpenInput(); -}*/ +typedef struct GXKeyList (*GXGETDEFAULTKEYS)(int); +typedef int (*GXOPENINPUT)(); + +GXGETDEFAULTKEYS GXGetDefaultKeys_ = NULL; +GXOPENINPUT GXOpenInput_ = NULL; + +struct GXKeyList gxKeyList; #endif @@ -1302,8 +1279,21 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, ReleaseDC( window->Window.Handle, window->Window.Device ); #if TARGET_HOST_WINCE - // Take over button handling - wince_OpenInput(); + /* Take over button handling */ + { + HINSTANCE dxDllLib=LoadLibrary(_T("gx.dll")); + if (dxDllLib) + { + GXGetDefaultKeys_=(GXGETDEFAULTKEYS)GetProcAddress(dxDllLib, _T("?GXGetDefaultKeys@@YA?AUGXKeyList@@H@Z")); + GXOpenInput_=(GXOPENINPUT)GetProcAddress(dxDllLib, _T("?GXOpenInput@@YAHXZ")); + } + + if(GXOpenInput_) + (*GXOpenInput_)(); + if(GXGetDefaultKeys_) + gxKeyList = (*GXGetDefaultKeys_)(GX_LANDSCAPEKEYS); + } + #endif /* TARGET_HOST_WINCE */ break; @@ -1665,9 +1655,6 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, case WM_SYSKEYDOWN: case WM_KEYDOWN: { -#if TARGET_HOST_WINCE - struct GXKeyList gxKeyList; -#endif /* TARGET_HOST_WINCE */ int keypress = -1; POINT mouse_pos ; @@ -1725,10 +1712,8 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, } #if TARGET_HOST_WINCE - if(!(lParam & 0x40000000)) // Prevent auto-repeat + if(!(lParam & 0x40000000)) /* Prevent auto-repeat */ { - wince_GetDefaultKeys(&gxKeyList, 0x03); - if(wParam==(unsigned)gxKeyList.vkRight) keypress = GLUT_KEY_RIGHT; else if(wParam==(unsigned)gxKeyList.vkLeft)