From 4edd89470b5ccf3e93328ec7bd1cde2ddff6cd6d Mon Sep 17 00:00:00 2001 From: dcnieho Date: Fri, 1 Mar 2013 17:22:34 +0000 Subject: [PATCH] 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 --- freeglut/freeglut/src/fg_structure.c | 13 +++------ freeglut/freeglut/src/mswin/fg_main_mswin.c | 30 --------------------- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/freeglut/freeglut/src/fg_structure.c b/freeglut/freeglut/src/fg_structure.c index 88b2614..e779037 100644 --- a/freeglut/freeglut/src/fg_structure.c +++ b/freeglut/freeglut/src/fg_structure.c @@ -72,7 +72,7 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title, GLboolean gameMode, GLboolean isMenu ) { /* 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 ); @@ -90,17 +90,10 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title, else 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.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; /* diff --git a/freeglut/freeglut/src/mswin/fg_main_mswin.c b/freeglut/freeglut/src/mswin/fg_main_mswin.c index 3cbac50..4bd7039 100644 --- a/freeglut/freeglut/src/mswin/fg_main_mswin.c +++ b/freeglut/freeglut/src/mswin/fg_main_mswin.c @@ -928,30 +928,6 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR lRet = 0; /* Per docs, should return zero */ 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) case WM_SYNCPAINT: /* 0x0088 */ /* 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" */ 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 */ { /*