projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixing 'GLUT_BORDERLESS' on Windows per e-mail from Eero Pajarre dated 4/24/2011...
[freeglut]
/
src
/
freeglut_menu.c
diff --git
a/src/freeglut_menu.c
b/src/freeglut_menu.c
index
ec2ff45
..
ea5837e
100644
(file)
--- a/
src/freeglut_menu.c
+++ b/
src/freeglut_menu.c
@@
-25,6
+25,7
@@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#define FREEGLUT_BUILDING_LIB
#include <GL/freeglut.h>
#include "freeglut_internal.h"
#include <GL/freeglut.h>
#include "freeglut_internal.h"
@@
-263,9
+264,13
@@
static GLboolean fghCheckMenuStatus( SFG_Menu* menu )
menuEntry->SubMenu->X = menu->X - menuEntry->SubMenu->Width;
if( menuEntry->SubMenu->Y + menuEntry->SubMenu->Height > max_y )
menuEntry->SubMenu->X = menu->X - menuEntry->SubMenu->Width;
if( menuEntry->SubMenu->Y + menuEntry->SubMenu->Height > max_y )
+ {
menuEntry->SubMenu->Y -= ( menuEntry->SubMenu->Height -
FREEGLUT_MENU_HEIGHT -
2 * FREEGLUT_MENU_BORDER );
menuEntry->SubMenu->Y -= ( menuEntry->SubMenu->Height -
FREEGLUT_MENU_HEIGHT -
2 * FREEGLUT_MENU_BORDER );
+ if( menuEntry->SubMenu->Y < 0 )
+ menuEntry->SubMenu->Y = 0;
+ }
fgSetWindow( menuEntry->SubMenu->Window );
glutPositionWindow( menuEntry->SubMenu->X,
fgSetWindow( menuEntry->SubMenu->Window );
glutPositionWindow( menuEntry->SubMenu->X,
@@
-552,7
+557,11
@@
static void fghActivateMenu( SFG_Window* window, int button )
menu->X -=menu->Width;
if( menu->Y + menu->Height > max_y )
menu->X -=menu->Width;
if( menu->Y + menu->Height > max_y )
+ {
menu->Y -=menu->Height;
menu->Y -=menu->Height;
+ if( menu->Y < 0 )
+ menu->Y = 0;
+ }
menu->Window->State.MouseX =
window->State.MouseX + glutGet( GLUT_WINDOW_X ) - menu->X;
menu->Window->State.MouseX =
window->State.MouseX + glutGet( GLUT_WINDOW_X ) - menu->X;
@@
-770,6
+779,14
@@
int FGAPIENTRY glutCreateMenu( void(* callback)( int ) )
return fgCreateMenu( callback )->ID;
}
return fgCreateMenu( callback )->ID;
}
+#if TARGET_HOST_MS_WINDOWS
+int FGAPIENTRY __glutCreateMenuWithExit( void(* callback)( int ), void (__cdecl *exit_function)(int) )
+{
+ __glutExitFunc = exit_function;
+ return glutCreateMenu( callback );
+}
+#endif
+
/*
* Destroys a menu object, removing all references to it
*/
/*
* Destroys a menu object, removing all references to it
*/