From 1091f89cf64d255a1fae5c331e556ec52dd6aa3c Mon Sep 17 00:00:00 2001 From: Jinrong Xie Date: Mon, 18 Jan 2016 01:16:58 -0800 Subject: [PATCH 1/8] update comments of WCB_SpaceXXX in fg_internal.h --- freeglut/freeglut/src/fg_internal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/freeglut/freeglut/src/fg_internal.h b/freeglut/freeglut/src/fg_internal.h index af226c4..2cecf71 100644 --- a/freeglut/freeglut/src/fg_internal.h +++ b/freeglut/freeglut/src/fg_internal.h @@ -632,9 +632,9 @@ enum /* Presently ignored */ WCB_Select, WCB_OverlayDisplay, - WCB_SpaceMotion, /* presently implemented only on UNIX/X11 */ - WCB_SpaceRotation, /* presently implemented only on UNIX/X11 */ - WCB_SpaceButton, /* presently implemented only on UNIX/X11 */ + WCB_SpaceMotion, /* presently implemented only on UNIX/X11 and Windows */ + WCB_SpaceRotation, /* presently implemented only on UNIX/X11 and Windows */ + WCB_SpaceButton, /* presently implemented only on UNIX/X11 and Windows */ WCB_Dials, WCB_ButtonBox, WCB_TabletMotion, From 472bc2bf627cd9a607ac6d59c8e6cb36e72e3aaf Mon Sep 17 00:00:00 2001 From: Jinrong Xie Date: Mon, 18 Jan 2016 12:54:06 -0800 Subject: [PATCH 2/8] Added API macros for Spaceball buttons. --- freeglut/freeglut/include/GL/freeglut_std.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/freeglut/freeglut/include/GL/freeglut_std.h b/freeglut/freeglut/include/GL/freeglut_std.h index a658c7c..5ffc5a0 100644 --- a/freeglut/freeglut/include/GL/freeglut_std.h +++ b/freeglut/freeglut/include/GL/freeglut_std.h @@ -407,6 +407,13 @@ #define GLUT_GAME_MODE_REFRESH_RATE 0x0005 #define GLUT_GAME_MODE_DISPLAY_CHANGED 0x0006 +/* + * GLUT API macro definitions -- Spaceball button definitions + */ + +#define GLUT_SPACEBALL_BUTTON_A 0x0001 +#define GLUT_SPACEBALL_BUTTON_B 0x0002 + /* * Initialization functions, see fglut_init.c */ From f4bc97b6d55db9d69b5a488d427f39d4a8c4ef03 Mon Sep 17 00:00:00 2001 From: Jinrong Xie Date: Mon, 18 Jan 2016 13:47:13 -0800 Subject: [PATCH 3/8] fixed php syntax error, unexpected end of file in template.php: replaced pair with short open tag --- freeglut/web-src/template.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freeglut/web-src/template.php b/freeglut/web-src/template.php index 2669407..ad101bd 100644 --- a/freeglut/web-src/template.php +++ b/freeglut/web-src/template.php @@ -40,7 +40,7 @@ function generateHeader($self) <? echo $title ?> - - freeglut logo
The Free OpenGL Utility Toolkit

-View PHP Source"; ?> - Date: Mon, 18 Jan 2016 14:46:59 -0800 Subject: [PATCH 4/8] Added API macros for additional Spaceball buttons. --- freeglut/freeglut/include/GL/freeglut_std.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/freeglut/freeglut/include/GL/freeglut_std.h b/freeglut/freeglut/include/GL/freeglut_std.h index 5ffc5a0..37d29be 100644 --- a/freeglut/freeglut/include/GL/freeglut_std.h +++ b/freeglut/freeglut/include/GL/freeglut_std.h @@ -413,6 +413,9 @@ #define GLUT_SPACEBALL_BUTTON_A 0x0001 #define GLUT_SPACEBALL_BUTTON_B 0x0002 +#define GLUT_SPACEBALL_BUTTON_C 0x0004 +#define GLUT_SPACEBALL_BUTTON_D 0x0008 +#define GLUT_SPACEBALL_BUTTON_E 0x0010 /* * Initialization functions, see fglut_init.c From 21cccdf7f36e75e4f365ce314fdbdd75ea54498a Mon Sep 17 00:00:00 2001 From: Jinrong Xie Date: Mon, 18 Jan 2016 15:42:44 -0800 Subject: [PATCH 5/8] Added API documentation for glutSpaceballXXX functions. --- freeglut/web-src/docs/api.php | 38 ++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/freeglut/web-src/docs/api.php b/freeglut/web-src/docs/api.php index 37d75e5..ffece5d 100644 --- a/freeglut/web-src/docs/api.php +++ b/freeglut/web-src/docs/api.php @@ -1326,46 +1326,53 @@ as mouse buttons.

The glutSpaceballMotionFunc function is implemented in -freeglut on X11 only. On other platforms, function stubs are +freeglut on X11 and Windows only. On other platforms, function stubs are provided so that GLUT-based programs can compile and link against freeglut without modification.

+

The glutSpaceballMotionFunc function sets the window's Spaceball motion callback. Freeglut invokes this callback when the user push/pull Spaceball cap in x, y, and z directions. +

Usage

-

void glutSpaceballMotionFunc ( void -(* callback)( int x, int y, int z ) );

+

void glutSpaceballMotionFunc ( void (* callback)( int x, int y, int z ) );

Description

-

TODO

+

The x, y, and z arguments indicate the amount of translation in integer along x, y, and z axis respectively.

+

The x, y, and z axes form a common OpenGL right-handed coordinate system. A positive value of x, y, or z indicates movement along the positive direction of the respective axis, while the negative one denotes movement along negative direction.

12.16 glutSpaceballRotateFunc

The glutSpaceballRotateFunc function is implemented in -freeglut on X11 only. On other platforms, function stubs are +freeglut on X11 and Windows only. On other platforms, function stubs are provided so that GLUT-based programs can compile and link against freeglut without modification.

+

The glutSpaceballRotateFunc function sets the window's Spaceball rotation callback. Freeglut invokes this callback when the user rotates/twists Spaceball cap. +

Usage

-

void glutSpaceballRotateFunc ( void -(* callback)( int x, int y, int z ) );

+

void glutSpaceballRotateFunc ( void (* callback)( int rx, int ry, int rz ) );

Description

-

TODO

+

The rx, ry, and rz arguments indicate the amount of rotation in integer with respect to x, y, and z axis respectively.

+

The x, y, and z axes form a common OpenGL right-handed coordinate system. Positive value of rx, ry, or rz indicates counter-clock wise rotation along the respective axis, while negative one denotes clock wise rotation.

12.17 glutSpaceballButtonFunc

The glutSpaceballButtonFunc function is implemented in -freeglut on X11 only. On other platforms, function stubs are +freeglut on X11 and Windows only. On other platforms, function stubs are provided so that GLUT-based programs can compile and link against freeglut without modification.

+

+The glutSpaceballButtonFunc function sets the window's Spaceball button callback. Freeglut invokes this callback when the user presses/releases one of the Spaceball buttons. +

Usage

@@ -1374,7 +1381,18 @@ provided so that GLUT-based programs can compile and link against

Description

-

TODO

+

The button argument may take one of the following defined constant values

+
    +
  • + GLUT_SPACEBALL_BUTTON_A, GLUT_SPACEBALL_BUTTON_B,..., GLUT_SPACEBALL_BUTTON_E +
  • +
+

The updown argument may take one of the two defined constant values

+
    +
  • + GLUT_DOWN, GLUT_UP indicating if button is pressed or released. +
  • +

12.18 glutButtonBoxFunc

From 13e6cf15916b12166fb98aaac6f3360c2e044f01 Mon Sep 17 00:00:00 2001 From: Jinrong Xie Date: Mon, 18 Jan 2016 17:44:53 -0800 Subject: [PATCH 6/8] moved spaceball macros from freeglut_std.h to freeglut_ext.h --- freeglut/freeglut/include/GL/freeglut_ext.h | 10 ++++++++++ freeglut/freeglut/include/GL/freeglut_std.h | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/freeglut/freeglut/include/GL/freeglut_ext.h b/freeglut/freeglut/include/GL/freeglut_ext.h index 4fc33ec..2ef96c2 100644 --- a/freeglut/freeglut/include/GL/freeglut_ext.h +++ b/freeglut/freeglut/include/GL/freeglut_ext.h @@ -126,6 +126,16 @@ #define GLUT_CORE_PROFILE 0x0001 #define GLUT_COMPATIBILITY_PROFILE 0x0002 +/* +* GLUT API Extension macro definitions -- Spaceball button definitions +*/ + +#define GLUT_SPACEBALL_BUTTON_A 0x0001 +#define GLUT_SPACEBALL_BUTTON_B 0x0002 +#define GLUT_SPACEBALL_BUTTON_C 0x0004 +#define GLUT_SPACEBALL_BUTTON_D 0x0008 +#define GLUT_SPACEBALL_BUTTON_E 0x0010 + /* * Process loop function, see fg_main.c */ diff --git a/freeglut/freeglut/include/GL/freeglut_std.h b/freeglut/freeglut/include/GL/freeglut_std.h index 37d29be..a658c7c 100644 --- a/freeglut/freeglut/include/GL/freeglut_std.h +++ b/freeglut/freeglut/include/GL/freeglut_std.h @@ -407,16 +407,6 @@ #define GLUT_GAME_MODE_REFRESH_RATE 0x0005 #define GLUT_GAME_MODE_DISPLAY_CHANGED 0x0006 -/* - * GLUT API macro definitions -- Spaceball button definitions - */ - -#define GLUT_SPACEBALL_BUTTON_A 0x0001 -#define GLUT_SPACEBALL_BUTTON_B 0x0002 -#define GLUT_SPACEBALL_BUTTON_C 0x0004 -#define GLUT_SPACEBALL_BUTTON_D 0x0008 -#define GLUT_SPACEBALL_BUTTON_E 0x0010 - /* * Initialization functions, see fglut_init.c */ From 9dfba8b7de677ee4deaeb1b64d4a426ca7a24260 Mon Sep 17 00:00:00 2001 From: Jinrong Xie Date: Mon, 18 Jan 2016 23:25:47 -0800 Subject: [PATCH 7/8] bug fix --- freeglut/freeglut/src/mswin/fg_spaceball_mswin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freeglut/freeglut/src/mswin/fg_spaceball_mswin.c b/freeglut/freeglut/src/mswin/fg_spaceball_mswin.c index 00e42f6..0dfa3e9 100644 --- a/freeglut/freeglut/src/mswin/fg_spaceball_mswin.c +++ b/freeglut/freeglut/src/mswin/fg_spaceball_mswin.c @@ -184,9 +184,9 @@ void fgSpaceballHandleWinEvent(HWND hwnd, WPARAM wParam, LPARAM lParam) unsigned long stateNow = dwKeystate&(1 << i); if (stateBefore && !stateNow) - INVOKE_WCB(*window, SpaceButton, (stateBefore, GLUT_DOWN)); + INVOKE_WCB(*window, SpaceButton, (stateBefore, GLUT_UP)); if (!stateBefore && stateNow) - INVOKE_WCB(*window, SpaceButton, (stateNow, GLUT_UP)); + INVOKE_WCB(*window, SpaceButton, (stateNow, GLUT_DOWN)); } } From 5f6e4fbe6895104f092267307495b3e2887d6d9e Mon Sep 17 00:00:00 2001 From: Jinrong Xie Date: Tue, 19 Jan 2016 19:03:41 -0800 Subject: [PATCH 8/8] Noted the numerical value for spaceball button macro --- freeglut/web-src/docs/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freeglut/web-src/docs/api.php b/freeglut/web-src/docs/api.php index ffece5d..9cfeacd 100644 --- a/freeglut/web-src/docs/api.php +++ b/freeglut/web-src/docs/api.php @@ -1384,7 +1384,7 @@ The glutSpaceballButtonFunc function sets the window's Spaceball button

The button argument may take one of the following defined constant values

  • - GLUT_SPACEBALL_BUTTON_A, GLUT_SPACEBALL_BUTTON_B,..., GLUT_SPACEBALL_BUTTON_E + GLUT_SPACEBALL_BUTTON_A(0x00000001), GLUT_SPACEBALL_BUTTON_B(0x00000002),..., GLUT_SPACEBALL_BUTTON_E(0x00000010)

The updown argument may take one of the two defined constant values