Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistent frame rate of GlutWindow #794

Merged
merged 4 commits into from
Oct 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ project(dart)

set(DART_MAJOR_VERSION "5")
set(DART_MINOR_VERSION "1")
set(DART_PATCH_VERSION "3")
set(DART_PATCH_VERSION "4")
set(DART_VERSION "${DART_MAJOR_VERSION}.${DART_MINOR_VERSION}.${DART_PATCH_VERSION}")
set(DART_PKG_DESC "Dynamic Animation and Robotics Toolkit.")
set(DART_PKG_EXTERNAL_DEPS "flann, ccd, fcl")
Expand Down
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### Version 5.1.4 (2016-10-14)

1. Fixed inconsistent frame rate of GlutWindow
* [Pull request #794](https://github.com/dartsim/dart/pull/794)

### Version 5.1.3 (2016-10-07)

1. Updated to support Bullet built with double precision (backport of [#660](https://github.com/dartsim/dart/pull/660))
Expand Down
4 changes: 1 addition & 3 deletions apps/addDeleteSkels/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ void MyWindow::keyboard(unsigned char _key, int _x, int _y) {
switch (_key) {
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating) {
if (mSimulating)
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'q': // Spawn a cube
case 'Q': { // Spawn a cube
Expand Down
6 changes: 0 additions & 6 deletions apps/atlasSimbicon/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,12 @@ void MyWindow::keyboard(unsigned char _key, int _x, int _y)
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating)
{
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay)
{
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating)
Expand Down
8 changes: 2 additions & 6 deletions apps/bipedStand/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,13 @@ void MyWindow::keyboard(unsigned char _key, int _x, int _y) {
switch (_key) {
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating) {
if (mSimulating)
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay) {
if (mPlay)
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating) {
Expand Down
6 changes: 0 additions & 6 deletions apps/hybridDynamics/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,12 @@ void MyWindow::keyboard(unsigned char _key, int _x, int _y)
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating)
{
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay)
{
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating)
Expand Down
6 changes: 0 additions & 6 deletions apps/jointConstraints/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,12 @@ void MyWindow::keyboard(unsigned char key, int x, int y)
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if(mSimulating)
{
mPlay = false;
glutTimerFunc( mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay)
{
mSimulating = false;
glutTimerFunc( mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating)
Expand Down
6 changes: 0 additions & 6 deletions apps/mixedChain/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,12 @@ void MyWindow::keyboard(unsigned char key, int x, int y)
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating)
{
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay)
{
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating)
Expand Down
8 changes: 2 additions & 6 deletions apps/rigidCubes/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,13 @@ void MyWindow::keyboard(unsigned char _key, int _x, int _y) {
switch (_key) {
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating) {
if (mSimulating)
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay) {
if (mPlay)
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating) {
Expand Down
6 changes: 0 additions & 6 deletions apps/rigidShapes/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,12 @@ void MyWindow::keyboard(unsigned char key, int x, int y)
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating)
{
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay)
{
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating)
Expand Down
6 changes: 0 additions & 6 deletions apps/softBodies/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,12 @@ void MyWindow::keyboard(unsigned char key, int x, int y)
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating)
{
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay)
{
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating)
Expand Down
8 changes: 2 additions & 6 deletions apps/vehicle/MyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,13 @@ void MyWindow::keyboard(unsigned char _key, int _x, int _y) {
switch (_key) {
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating) {
if (mSimulating)
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay) {
if (mPlay)
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating) {
Expand Down
3 changes: 3 additions & 0 deletions dart/gui/GlutWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ void GlutWindow::initWindow(int _w, int _h, const char* _name) {
#endif
// TODO: Disabled use of GL_MULTISAMPLE for Windows. Please see #411 for the
// detail.

glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
// Note: We book the timer id 0 for the main rendering purpose.
}

void GlutWindow::reshape(int _w, int _h) {
Expand Down
1 change: 1 addition & 0 deletions dart/gui/GlutWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class GlutWindow {
GlutWindow();
virtual ~GlutWindow();

/// \warning This function should be called once.
virtual void initWindow(int _w, int _h, const char* _name);

// callback functions
Expand Down
8 changes: 2 additions & 6 deletions dart/gui/SimWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,13 @@ void SimWindow::keyboard(unsigned char _key, int _x, int _y) {
switch (_key) {
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating) {
if (mSimulating)
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay) {
if (mPlay)
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case '[': // step backward
if (!mSimulating) {
Expand Down
6 changes: 0 additions & 6 deletions dart/gui/SoftSimWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,12 @@ void SoftSimWindow::keyboard(unsigned char key, int x, int y)
case ' ': // use space key to play or stop the motion
mSimulating = !mSimulating;
if (mSimulating)
{
mPlay = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
case 'p': // playBack
mPlay = !mPlay;
if (mPlay)
{
mSimulating = false;
glutTimerFunc(mDisplayTimeout, refreshTimer, 0);
}
break;
// case '[': // step backward
// if (!mSimulating)
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
a Catkin workspace. Catkin is not required to build DART. For more
information, see: http://ros.org/reps/rep-0136.html -->
<name>dart</name>
<version>5.1.3</version>
<version>5.1.4</version>
<description>
DART (Dynamic Animation and Robotics Toolkit) is a collaborative,
cross-platform, open source library created by the Georgia Tech Graphics
Expand Down