some cleanup: on window creation, don't have to zero variables that

already set to zero by calloc
in windowproc, don't have handlers that only forward the message to
defwindowproc


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1544 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2013-03-01 17:22:34 +00:00
parent 78707f3e63
commit 4edd89470b
2 changed files with 3 additions and 40 deletions

View File

@ -72,7 +72,7 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
GLboolean gameMode, GLboolean isMenu ) GLboolean gameMode, GLboolean isMenu )
{ {
/* Have the window object created */ /* Have the window object created */
SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 ); SFG_Window *window = (SFG_Window *)calloc( 1, sizeof(SFG_Window) );
fgPlatformCreateWindow ( window ); fgPlatformCreateWindow ( window );
@ -90,17 +90,10 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
else else
fgListAppend( &fgStructure.Windows, &window->Node ); fgListAppend( &fgStructure.Windows, &window->Node );
/* Set the default mouse cursor and reset the modifiers value */ /* Set the default mouse cursor */
window->State.Cursor = GLUT_CURSOR_INHERIT; window->State.Cursor = GLUT_CURSOR_INHERIT;
window->State.IgnoreKeyRepeat = GL_FALSE;
window->State.KeyRepeating = GL_FALSE;
window->State.IsFullscreen = GL_FALSE;
window->State.VisualizeNormals= GL_FALSE;
window->State.pWState.WindowTitle = NULL;
window->State.pWState.IconTitle = NULL;
/* Mark window as menu if a menu is to be created */
window->IsMenu = isMenu; window->IsMenu = isMenu;
/* /*

View File

@ -928,30 +928,6 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
lRet = 0; /* Per docs, should return zero */ lRet = 0; /* Per docs, should return zero */
break; break;
/* Other messages that I have seen and which are not handled already */
case WM_SETTEXT: /* 0x000c */
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
/* Pass it on to "DefWindowProc" to set the window text */
break;
case WM_GETTEXT: /* 0x000d */
/* Ideally we would copy the title of the window into "lParam" */
/* strncpy ( (char *)lParam, "Window Title", wParam );
lRet = ( wParam > 12 ) ? 12 : wParam; */
/* the number of characters copied */
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
break;
case WM_GETTEXTLENGTH: /* 0x000e */
/* Ideally we would get the length of the title of the window */
lRet = 12;
/* the number of characters in "Window Title\0" (see above) */
break;
case WM_ERASEBKGND: /* 0x0014 */
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
break;
#if !defined(_WIN32_WCE) #if !defined(_WIN32_WCE)
case WM_SYNCPAINT: /* 0x0088 */ case WM_SYNCPAINT: /* 0x0088 */
/* Another window has moved, need to update this one */ /* Another window has moved, need to update this one */
@ -960,12 +936,6 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
/* Help screen says this message must be passed to "DefWindowProc" */ /* Help screen says this message must be passed to "DefWindowProc" */
break; break;
case WM_NCPAINT: /* 0x0085 */
/* Need to update the border of this window */
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
/* Pass it on to "DefWindowProc" to repaint a standard border */
break;
case WM_SYSCOMMAND : /* 0x0112 */ case WM_SYSCOMMAND : /* 0x0112 */
{ {
/* /*