replaced all tabs with 4 spaces

replaced all // with /* */ block
fixed freeglut_gx.cpp file with #if TARGET_HOST_WINCE


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@488 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
drgoldie 2004-03-16 08:38:28 +00:00
parent c233e0f5db
commit 041d8017dc
8 changed files with 68 additions and 30 deletions

View File

@ -210,8 +210,19 @@ DEP_CPP_FREEGLUT_GL=\
SOURCE=.\src\freeglut_gx.cpp SOURCE=.\src\freeglut_gx.cpp
DEP_CPP_FREEGLUT_GX=\ DEP_CPP_FREEGLUT_GX=\
".\src\freeglut_internal.h"\
{$(INCLUDE)}"gx.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 # End Source File
# Begin Source File # Begin Source File
@ -240,6 +251,7 @@ SOURCE=.\src\freeglut_joystick.c
SOURCE=.\src\freeglut_main.c SOURCE=.\src\freeglut_main.c
DEP_CPP_FREEGLUT_M=\ DEP_CPP_FREEGLUT_M=\
".\src\freeglut_internal.h"\ ".\src\freeglut_internal.h"\
".\src\my_gx.h"\
{$(INCLUDE)}"GL\freeglut.h"\ {$(INCLUDE)}"GL\freeglut.h"\
{$(INCLUDE)}"GL\freeglut_ext.h"\ {$(INCLUDE)}"GL\freeglut_ext.h"\
{$(INCLUDE)}"GL\freeglut_std.h"\ {$(INCLUDE)}"GL\freeglut_std.h"\

View File

@ -113,7 +113,7 @@ static struct name_address_pair glut_functions[] =
{ "glutSpecialUpFunc", (void *) glutSpecialUpFunc }, { "glutSpecialUpFunc", (void *) glutSpecialUpFunc },
#if !TARGET_HOST_WINCE #if !TARGET_HOST_WINCE
{ "glutJoystickFunc", (void *) glutJoystickFunc }, { "glutJoystickFunc", (void *) glutJoystickFunc },
#endif //TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
{ "glutSetColor", (void *) glutSetColor }, { "glutSetColor", (void *) glutSetColor },
{ "glutGetColor", (void *) glutGetColor }, { "glutGetColor", (void *) glutGetColor },
{ "glutCopyColormap", (void *) glutCopyColormap }, { "glutCopyColormap", (void *) glutCopyColormap },
@ -160,7 +160,7 @@ static struct name_address_pair glut_functions[] =
{ "glutEnterGameMode", (void *) glutEnterGameMode }, { "glutEnterGameMode", (void *) glutEnterGameMode },
{ "glutLeaveGameMode", (void *) glutLeaveGameMode }, { "glutLeaveGameMode", (void *) glutLeaveGameMode },
{ "glutGameModeGet", (void *) glutGameModeGet }, { "glutGameModeGet", (void *) glutGameModeGet },
#endif //TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
/* freeglut extensions */ /* freeglut extensions */
{ "glutMainLoopEvent", (void *) glutMainLoopEvent }, { "glutMainLoopEvent", (void *) glutMainLoopEvent },
{ "glutLeaveMainLoop", (void *) glutLeaveMainLoop }, { "glutLeaveMainLoop", (void *) glutLeaveMainLoop },

View File

@ -26,6 +26,15 @@
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "freeglut_internal.h"
#if TARGET_HOST_WINCE
#include <windows.h> #include <windows.h>
#include <gx.h> #include <gx.h>
@ -50,3 +59,6 @@ void wince_OpenInput()
} }
} }
#endif

View File

@ -213,7 +213,7 @@ void fgInitialize( const char* displayName )
#if !TARGET_HOST_WINCE #if !TARGET_HOST_WINCE
fgJoystickInit( 0 ); fgJoystickInit( 0 );
fgJoystickInit( 1 ); fgJoystickInit( 1 );
#endif //!TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
fgState.Initialised = GL_TRUE; fgState.Initialised = GL_TRUE;
} }
@ -259,7 +259,7 @@ void fgDeinitialize( void )
#if !TARGET_HOST_WINCE #if !TARGET_HOST_WINCE
fgJoystickClose( ); fgJoystickClose( );
#endif //!TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
fgState.Initialised = GL_FALSE; fgState.Initialised = GL_FALSE;
@ -623,7 +623,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
} }
} }
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
/* /*
* Have the display created now. If there wasn't a "-display" * Have the display created now. If there wasn't a "-display"

View File

@ -62,8 +62,22 @@ struct GXKeyList {
short vkStart; short vkStart;
POINT ptStart; 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_GetDefaultKeys(void* nData, int iOptions);
extern void wince_OpenInput(); extern void wince_OpenInput();
/*void wince_GetDefaultKeys(void* nData, int iOptions)
{
*(struct GXKeyList*)nData = GXGetDefaultKeys(iOptions);
}
void wince_OpenInput()
{
GXOpenInput();
}*/
#endif #endif
#ifndef MAX #ifndef MAX
@ -157,7 +171,7 @@ static void fghReshapeWindowByHandle ( SFG_WindowHandleType handle,
SWP_NOZORDER SWP_NOZORDER
); );
} }
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
/* /*
* XXX Should update {window->State.OldWidth, window->State.OldHeight} * XXX Should update {window->State.OldWidth, window->State.OldHeight}
@ -290,7 +304,7 @@ static void fghcbCheckJoystickPolls( SFG_Window *window,
{ {
#if !TARGET_HOST_WINCE #if !TARGET_HOST_WINCE
fgJoystickPollWindow( window ); fgJoystickPollWindow( window );
#endif //!TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
window->State.JoystickLastPoll = checkTime; window->State.JoystickLastPoll = checkTime;
} }
@ -1287,7 +1301,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
#if TARGET_HOST_WINCE #if TARGET_HOST_WINCE
// Take over button handling // Take over button handling
wince_OpenInput(); wince_OpenInput();
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
break; break;
case WM_SIZE: case WM_SIZE:
@ -1305,7 +1319,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
#else #else
window->State.Width = LOWORD(lParam); window->State.Width = LOWORD(lParam);
window->State.Height = HIWORD(lParam); window->State.Height = HIWORD(lParam);
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
} }
break; break;
@ -1405,7 +1419,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
#else #else
window->State.MouseX = LOWORD( lParam ); window->State.MouseX = LOWORD( lParam );
window->State.MouseY = HIWORD( lParam ); window->State.MouseY = HIWORD( lParam );
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
if ( window->ActiveMenu ) if ( window->ActiveMenu )
{ {
@ -1445,7 +1459,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
#else #else
window->State.MouseX = LOWORD( lParam ); window->State.MouseX = LOWORD( lParam );
window->State.MouseY = HIWORD( lParam ); window->State.MouseY = HIWORD( lParam );
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
switch( uMsg ) switch( uMsg )
{ {
@ -1488,7 +1502,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
if( button == GLUT_RIGHT_BUTTON ) if( button == GLUT_RIGHT_BUTTON )
button = GLUT_LEFT_BUTTON; button = GLUT_LEFT_BUTTON;
} }
#endif //!TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
if( button == -1 ) if( button == -1 )
return DefWindowProc( hWnd, uMsg, lParam, wParam ); return DefWindowProc( hWnd, uMsg, lParam, wParam );
@ -1650,7 +1664,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
{ {
#if TARGET_HOST_WINCE #if TARGET_HOST_WINCE
struct GXKeyList gxKeyList; struct GXKeyList gxKeyList;
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
int keypress = -1; int keypress = -1;
POINT mouse_pos ; POINT mouse_pos ;
@ -1812,7 +1826,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
( (char)wParam, ( (char)wParam,
window->State.MouseX, window->State.MouseY ) window->State.MouseX, window->State.MouseY )
); );
#endif //!TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
} }
} }
@ -1952,7 +1966,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
break ; break ;
} }
} }
#endif //!TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
/* We need to pass the message on to the operating system as well */ /* We need to pass the message on to the operating system as well */
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );

View File

@ -142,7 +142,7 @@ void FGAPIENTRY glutForceJoystickFunc( void )
freeglut_return_if_fail( fgStructure.Window != NULL ); freeglut_return_if_fail( fgStructure.Window != NULL );
freeglut_return_if_fail( FETCH_WCB( *( fgStructure.Window ), Joystick ) ); freeglut_return_if_fail( FETCH_WCB( *( fgStructure.Window ), Joystick ) );
fgJoystickPollWindow( fgStructure.Window ); fgJoystickPollWindow( fgStructure.Window );
#endif //!TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
} }
/* /*

View File

@ -386,7 +386,7 @@ int FGAPIENTRY glutGet( GLenum eWhat )
winRect.top += GetSystemMetrics( SM_CYSIZEFRAME ) + GetSystemMetrics( SM_CYCAPTION ); winRect.top += GetSystemMetrics( SM_CYSIZEFRAME ) + GetSystemMetrics( SM_CYCAPTION );
winRect.bottom -= GetSystemMetrics( SM_CYSIZEFRAME ); winRect.bottom -= GetSystemMetrics( SM_CYSIZEFRAME );
} }
#endif //TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
switch( eWhat ) switch( eWhat )
{ {
@ -403,14 +403,14 @@ int FGAPIENTRY glutGet( GLenum eWhat )
return 0; return 0;
#else #else
return GetSystemMetrics( SM_CXSIZEFRAME ); return GetSystemMetrics( SM_CXSIZEFRAME );
#endif //TARGET_HOST_WINCE #endif /* !TARGET_HOST_WINCE */
case GLUT_WINDOW_HEADER_HEIGHT : case GLUT_WINDOW_HEADER_HEIGHT :
#if TARGET_HOST_WINCE #if TARGET_HOST_WINCE
return 0; return 0;
#else #else
return GetSystemMetrics( SM_CYCAPTION ); return GetSystemMetrics( SM_CYCAPTION );
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
case GLUT_DISPLAY_MODE_POSSIBLE: case GLUT_DISPLAY_MODE_POSSIBLE:
#if TARGET_HOST_WINCE #if TARGET_HOST_WINCE
@ -418,14 +418,14 @@ int FGAPIENTRY glutGet( GLenum eWhat )
#else #else
return fgSetupPixelFormat( fgStructure.Window, GL_TRUE, return fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
PFD_MAIN_PLANE ); PFD_MAIN_PLANE );
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
case GLUT_WINDOW_FORMAT_ID: case GLUT_WINDOW_FORMAT_ID:
#if !TARGET_HOST_WINCE #if !TARGET_HOST_WINCE
if( fgStructure.Window != NULL ) if( fgStructure.Window != NULL )
return GetPixelFormat( fgStructure.Window->Window.Device ); return GetPixelFormat( fgStructure.Window->Window.Device );
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
return 0; return 0;
#endif #endif
@ -538,7 +538,7 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat )
return 1; return 1;
#else #else
return GetSystemMetrics( SM_CMOUSEBUTTONS ); return GetSystemMetrics( SM_CMOUSEBUTTONS );
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
#endif #endif

View File

@ -47,7 +47,7 @@ wchar_t* wstr_from_str(const char* str)
} }
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
/* /*
* TODO BEFORE THE STABLE RELEASE: * TODO BEFORE THE STABLE RELEASE:
@ -231,7 +231,7 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
if( checkOnly ) if( checkOnly )
return GL_TRUE; return GL_TRUE;
return SetPixelFormat( window->Window.Device, pixelformat, ppfd ); return SetPixelFormat( window->Window.Device, pixelformat, ppfd );
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
} }
#endif #endif
@ -456,7 +456,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
sizeHints.y = y; sizeHints.y = y;
sizeHints.width = w; sizeHints.width = w;
sizeHints.height = h; sizeHints.height = h;
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
wmHints.flags = StateHint; wmHints.flags = StateHint;
wmHints.initial_state = fgState.ForceIconic ? IconicState : NormalState; wmHints.initial_state = fgState.ForceIconic ? IconicState : NormalState;
@ -521,7 +521,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
h += (GetSystemMetrics( SM_CYSIZEFRAME ) )*2 + h += (GetSystemMetrics( SM_CYSIZEFRAME ) )*2 +
GetSystemMetrics( SM_CYCAPTION ); GetSystemMetrics( SM_CYCAPTION );
} }
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
if( ! fgState.Position.Use ) if( ! fgState.Position.Use )
{ {
@ -589,7 +589,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
fgDisplay.Instance, fgDisplay.Instance,
(LPVOID) window (LPVOID) window
); );
#endif TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
if( !( window->Window.Handle ) ) if( !( window->Window.Handle ) )
fgError( "Failed to create a window (%s)!", title ); fgError( "Failed to create a window (%s)!", title );
@ -599,7 +599,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
#else #else
ShowWindow( window->Window.Handle, ShowWindow( window->Window.Handle,
fgState.ForceIconic ? SW_SHOWMINIMIZED : SW_SHOW ); fgState.ForceIconic ? SW_SHOWMINIMIZED : SW_SHOW );
#endif //TARGET_HOST_WINCE #endif /* TARGET_HOST_WINCE */
UpdateWindow( window->Window.Handle ); UpdateWindow( window->Window.Handle );
ShowCursor( TRUE ); /* XXX Old comments say "hide cusror"! */ ShowCursor( TRUE ); /* XXX Old comments say "hide cusror"! */