From e88c8b4ce11ef7e780cdec8a42edcaa72cf4595b Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Sun, 30 Mar 2008 22:27:27 +0000 Subject: [PATCH] 2008-03-30 Neil Roberts * clutter/win32/clutter-backend-win32.c (clutter_backend_win32_init): Added a call to timeBeginPeriod. Without this the frame rates are terrible because the glib timeouts are not accurate enough. However this requires Glib >= 2.16.0 to take any effect because of a change in the way g_poll is implemented. See revision 6597 of glib. (clutter_backend_win32_finalize): Added a call to timeEndPeriod. * configure.ac: Added -lwinmm to the library dependencies for the Win32 backend. --- ChangeLog | 13 +++++++++++++ clutter/win32/clutter-backend-win32.c | 7 +++++++ configure.ac | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 49de87a29..e220f21ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-03-30 Neil Roberts + + * clutter/win32/clutter-backend-win32.c + (clutter_backend_win32_init): Added a call to + timeBeginPeriod. Without this the frame rates are terrible because + the glib timeouts are not accurate enough. However this requires + Glib >= 2.16.0 to take any effect because of a change in the way + g_poll is implemented. See revision 6597 of glib. + (clutter_backend_win32_finalize): Added a call to timeEndPeriod. + + * configure.ac: Added -lwinmm to the library dependencies for the + Win32 backend. + 2008-03-30 Neil Roberts * clutter/win32/clutter-win32.h: diff --git a/clutter/win32/clutter-backend-win32.c b/clutter/win32/clutter-backend-win32.c index 9b5d938ad..3de069f15 100644 --- a/clutter/win32/clutter-backend-win32.c +++ b/clutter/win32/clutter-backend-win32.c @@ -89,6 +89,8 @@ clutter_backend_win32_finalize (GObject *gobject) { backend_singleton = NULL; + timeEndPeriod (1); + G_OBJECT_CLASS (clutter_backend_win32_parent_class)->finalize (gobject); } @@ -299,6 +301,11 @@ clutter_backend_win32_init (ClutterBackendWin32 *backend_win32) clutter_backend_set_double_click_time (backend, 250); clutter_backend_set_double_click_distance (backend, 5); clutter_backend_set_resolution (backend, 96.0); + + /* Set the maximum precision for Windows time functions. Without + this glib will not be able to sleep accurately enough to give a + reasonable frame rate */ + timeBeginPeriod (1); } GType diff --git a/configure.ac b/configure.ac index a56672aa1..dd2d089ba 100644 --- a/configure.ac +++ b/configure.ac @@ -292,7 +292,7 @@ case $clutterbackend in fi WIN32_CFLAGS="-D_WIN32_WINNT=0x0500" - WIN32_LIBS="-lGLee -lopengl32 -lgdi32" + WIN32_LIBS="-lGLee -lopengl32 -lgdi32 -lwinmm" CLUTTER_LT_LDFLAGS="$CLUTTER_LT_LDFLAGS -no-undefined" ;;