Merge pull request #45 from stonexjr/Jinrong

Spaceball API documentation and macros updates
This commit is contained in:
Diederick C. Niehorster 2016-01-20 20:38:07 +01:00
commit b9633f0ec9
5 changed files with 47 additions and 19 deletions

View File

@ -126,6 +126,16 @@
#define GLUT_CORE_PROFILE 0x0001 #define GLUT_CORE_PROFILE 0x0001
#define GLUT_COMPATIBILITY_PROFILE 0x0002 #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 * Process loop function, see fg_main.c
*/ */

View File

@ -632,9 +632,9 @@ enum
/* Presently ignored */ /* Presently ignored */
WCB_Select, WCB_Select,
WCB_OverlayDisplay, WCB_OverlayDisplay,
WCB_SpaceMotion, /* presently implemented only on UNIX/X11 */ WCB_SpaceMotion, /* presently implemented only on UNIX/X11 and Windows */
WCB_SpaceRotation, /* presently implemented only on UNIX/X11 */ WCB_SpaceRotation, /* presently implemented only on UNIX/X11 and Windows */
WCB_SpaceButton, /* presently implemented only on UNIX/X11 */ WCB_SpaceButton, /* presently implemented only on UNIX/X11 and Windows */
WCB_Dials, WCB_Dials,
WCB_ButtonBox, WCB_ButtonBox,
WCB_TabletMotion, WCB_TabletMotion,

View File

@ -184,9 +184,9 @@ void fgSpaceballHandleWinEvent(HWND hwnd, WPARAM wParam, LPARAM lParam)
unsigned long stateNow = dwKeystate&(1 << i); unsigned long stateNow = dwKeystate&(1 << i);
if (stateBefore && !stateNow) if (stateBefore && !stateNow)
INVOKE_WCB(*window, SpaceButton, (stateBefore, GLUT_DOWN)); INVOKE_WCB(*window, SpaceButton, (stateBefore, GLUT_UP));
if (!stateBefore && stateNow) if (!stateBefore && stateNow)
INVOKE_WCB(*window, SpaceButton, (stateNow, GLUT_UP)); INVOKE_WCB(*window, SpaceButton, (stateNow, GLUT_DOWN));
} }
} }

View File

@ -1326,46 +1326,53 @@ as mouse buttons.
<p> <p>
The <tt>glutSpaceballMotionFunc</tt> function is implemented in The <tt>glutSpaceballMotionFunc</tt> function is implemented in
<i>freeglut</i> on X11 only. On other platforms, function stubs are <i>freeglut</i> on X11 and Windows only. On other platforms, function stubs are
provided so that GLUT-based programs can compile and link against provided so that GLUT-based programs can compile and link against
<i>freeglut</i> without modification. <i>freeglut</i> without modification.
</p> </p>
<p>The <tt>glutSpaceballMotionFunc</tt> function sets the window's Spaceball motion callback. <i>Freeglut</i> invokes this callback when the user push/pull Spaceball cap in <i>x</i>, <i>y</i>, and <i>z</i> directions.
</p>
<p><b>Usage</b></p> <p><b>Usage</b></p>
<p><tt>void glutSpaceballMotionFunc ( void <p><tt>void glutSpaceballMotionFunc ( void (* callback)( int x, int y, int z ) );</tt></p>
(* callback)( int x, int y, int z )</tt><tt> );</tt></p>
<p><b>Description</b></p> <p><b>Description</b></p>
<p>TODO</p> <p>The <i>x</i>, <i>y</i>, and <i>z</i> arguments indicate the amount of translation in integer along x, y, and z axis respectively.</p>
<p>The x, y, and z axes form a common OpenGL right-handed coordinate system. A positive value of <i>x</i>, <i>y</i>, or <i>z</i> indicates movement along the positive direction of the respective axis, while the negative one denotes movement along negative direction.</p>
<h2>12.16 glutSpaceballRotateFunc</h2> <h2>12.16 glutSpaceballRotateFunc</h2>
<p> <p>
The <tt>glutSpaceballRotateFunc</tt> function is implemented in The <tt>glutSpaceballRotateFunc</tt> function is implemented in
<i>freeglut</i> on X11 only. On other platforms, function stubs are <i>freeglut</i> on X11 and Windows only. On other platforms, function stubs are
provided so that GLUT-based programs can compile and link against provided so that GLUT-based programs can compile and link against
<i>freeglut</i> without modification. <i>freeglut</i> without modification.
</p> </p>
<p>The <tt>glutSpaceballRotateFunc</tt> function sets the window's Spaceball rotation callback. <i>Freeglut</i> invokes this callback when the user rotates/twists Spaceball cap.
</p>
<p><b>Usage</b></p> <p><b>Usage</b></p>
<p><tt>void glutSpaceballRotateFunc ( void <p><tt>void glutSpaceballRotateFunc ( void (* callback)( int rx, int ry, int rz ) );</tt></p>
(* callback)( int x, int y, int z )</tt><tt> );</tt></p>
<p><b>Description</b></p> <p><b>Description</b></p>
<p>TODO</p> <p>The <i>rx</i>, <i>ry</i>, and <i>rz</i> arguments indicate the amount of rotation in integer with respect to x, y, and z axis respectively.</p>
<p>The x, y, and z axes form a common OpenGL right-handed coordinate system. Positive value of <i>rx</i>, <i>ry</i>, or <i>rz</i> indicates counter-clock wise rotation along the respective axis, while negative one denotes clock wise rotation.</p>
<h2>12.17 glutSpaceballButtonFunc</h2> <h2>12.17 glutSpaceballButtonFunc</h2>
<p> <p>
The <tt>glutSpaceballButtonFunc</tt> function is implemented in The <tt>glutSpaceballButtonFunc</tt> function is implemented in
<i>freeglut</i> on X11 only. On other platforms, function stubs are <i>freeglut</i> on X11 and Windows only. On other platforms, function stubs are
provided so that GLUT-based programs can compile and link against provided so that GLUT-based programs can compile and link against
<i>freeglut</i> without modification. <i>freeglut</i> without modification.
</p> </p>
<p>
The <tt>glutSpaceballButtonFunc</tt> function sets the window's Spaceball button callback. <i>Freeglut</i> invokes this callback when the user presses/releases one of the Spaceball buttons.
</p>
<p><b>Usage</b></p> <p><b>Usage</b></p>
@ -1374,7 +1381,18 @@ provided so that GLUT-based programs can compile and link against
<p><b>Description</b></p> <p><b>Description</b></p>
<p>TODO</p> <p>The <i>button</i> argument may take one of the following defined constant values</p>
<ul>
<li>
GLUT_SPACEBALL_BUTTON_A(0x00000001), GLUT_SPACEBALL_BUTTON_B(0x00000002),..., GLUT_SPACEBALL_BUTTON_E(0x00000010)
</li>
</ul>
<p>The <i>updown</i> argument may take one of the two defined constant values</p>
<ul>
<li>
GLUT_DOWN, GLUT_UP indicating if button is pressed or released.
</li>
</ul>
<h2>12.18 glutButtonBoxFunc</h2> <h2>12.18 glutButtonBoxFunc</h2>

View File

@ -40,7 +40,7 @@ function generateHeader($self)
<title><? echo $title ?></title> <title><? echo $title ?></title>
</head> </head>
<body> <body>
<? <?php
generateSideBar($self); generateSideBar($self);
} }
@ -49,7 +49,7 @@ function generateFooter()
?> ?>
</body> </body>
</html> </html>
<? <?php
} }
function printMenuItem($item, $current_page) function printMenuItem($item, $current_page)
@ -71,7 +71,7 @@ function generateSideBar($current_page)
<div class="navbar-left"> <div class="navbar-left">
<span class="navbar-header"><a href="/"><img src="/images/freeglut_logo.png" alt="freeglut logo" style="border: 0;" /></a></span><br/> <span class="navbar-header"><a href="/"><img src="/images/freeglut_logo.png" alt="freeglut logo" style="border: 0;" /></a></span><br/>
<span class="navbar-smalltext">The Free OpenGL Utility Toolkit</span><br/><br/> <span class="navbar-smalltext">The Free OpenGL Utility Toolkit</span><br/><br/>
<? <?php
# Print out each sidebar entry one by one... # Print out each sidebar entry one by one...
reset($sidebarentries); reset($sidebarentries);
while (next($sidebarentries)) while (next($sidebarentries))
@ -101,7 +101,7 @@ function generateSideBar($current_page)
<? echo "\t<a href=\"$svn_location\">View PHP Source</a>"; ?> <? echo "\t<a href=\"$svn_location\">View PHP Source</a>"; ?>
</span> </span>
</div> </div>
<? <?php
} }
function setPageTitle($title_inc) function setPageTitle($title_inc)