aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index cac8b7f..60ce863 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3,7 +3,7 @@
*
* The Top Level Source File
*
- * (c) 2008 Thomas White <taw27@srcf.ucam.org>
+ * (c) 2008-2009 Thomas White <taw@bitwiz.org.uk>
*
* This file is part of OpenMooCow - accelerometer moobox simulator
*
@@ -44,21 +44,21 @@ int main(int argc, char *argv[]) {
int graphics = 0;
GThread *accel_thread;
int finished = 0;
-
+
g_thread_init(NULL);
-
+
if ( gtk_init_check(&argc, &argv) ) {
graphics = 1;
}
-
+
if ( SDL_Init(SDL_INIT_AUDIO) < 0 ) {
fprintf(stderr, "Couldn't initialise SDL: %s\n", SDL_GetError());
return 1;
}
-
+
/* Start the accelerometer thread */
accel_thread = accelerometer_start(&finished);
-
+
if ( graphics ) {
/* Open the window */
mw = mainwindow_open();
@@ -68,12 +68,11 @@ int main(int argc, char *argv[]) {
sleep(10);
}
}
-
+
finished = 1;
g_thread_join(accel_thread);
SDL_Quit();
-
+
return 0;
-
-}
+}