visibility callback happens if needed. Documented this, and added notes
on visibility/windowstatus func in callbackmaker demo
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1535
7f0cb862-5218-0410-a997-
914c9d46530a
glutPositionFunc( Position );
glutKeyboardFunc( Key );
glutSpecialFunc( Special );
- glutVisibilityFunc( Visibility );
glutKeyboardUpFunc( KeyUp );
glutSpecialUpFunc( SpecialUp );
if (first)
glutEntryFunc ( Entry ) ;
glutCloseFunc ( Close ) ;
glutOverlayDisplayFunc ( OverlayDisplay ) ;
- glutWindowStatusFunc ( WindowStatus ) ;
glutSpaceballMotionFunc ( SpaceMotion ) ;
glutSpaceballRotateFunc ( SpaceRotation ) ;
glutSpaceballButtonFunc ( SpaceButton ) ;
glutDialsFunc ( Dials ) ;
glutTabletMotionFunc ( TabletMotion ) ;
glutTabletButtonFunc ( TabletButton ) ;
+ /* glutVisibilityFunc is deprecated in favor of glutWindowStatusFunc, which provides more detail.
+ * Setting one of these overwrites the other (see docs).
+ */
+ glutVisibilityFunc ( Visibility ); /* This will thus never be called, as glutWindowStatusFunc is set afterwards */
+ glutWindowStatusFunc ( WindowStatus ) ;
}
int
/*
* Sets the Visibility callback for the current window.
+ * NB: the Visibility func is deprecated in favor of the WindowStatus func,
+ * which provides more detail. The visibility func callback is implemented
+ * as a translation step from the windowStatus func. When the user sets the
+ * windowStatus func, any visibility func is overwritten.
+ * DEVELOPER NOTE: in the library, only invoke the window status func, this
+ * gets automatically translated to the visibility func if thats what the
+ * user has set.
*/
static void fghVisibility( int status )
{
*/
while( window )
{
- if ( FETCH_WCB( *window, Visibility ) )
+ if ( FETCH_WCB( *window, WindowStatus ) )
{
SFG_Window *current_window = fgStructure.CurrentWindow ;
- INVOKE_WCB( *window, Visibility, ( window->State.Visible ) );
+ INVOKE_WCB( *window, WindowStatus, ( window->State.Visible?GLUT_FULLY_RETAINED:GLUT_HIDDEN ) );
fgSetWindow( current_window );
}
if (!lParam || !fgWindowByHandle((HWND)lParam))
/* Capture released or capture taken by non-FreeGLUT window */
setCaptureActive = 0;
- /* User has finished resizing the window, force a redraw */
- INVOKE_WCB( *window, Display, ( ) );
+ /* Docs advise a redraw */
+ InvalidateRect( hWnd, NULL, GL_FALSE );
+ UpdateWindow(hWnd);
lRet = 0; /* Per docs, should return zero */
break;