use hgw_context_destroy with HGW_BYE_INACTIVE to indicate game is closed
authorReto Zingg <g.d0b3rm4n@gmail.com>
Mon, 28 Dec 2009 12:36:57 +0000 (14:36 +0200)
committerReto Zingg <g.d0b3rm4n@gmail.com>
Mon, 28 Dec 2009 12:36:57 +0000 (14:36 +0200)
src/callbacks.c
src/play.c

index 0b0e6cf..cbfe07d 100644 (file)
 
 // Pause the game
 int exit_callback(int errcode) {
-    printf("exit_callback called...\n");
+       printf("exit_callback called...\n");
+       hgw_context_destroy(hgw_context, HGW_BYE_INACTIVE);
        return 0;
 }
 
 // Quit game
 int quit_callback(int errcode) {
-    printf("quit_callback called...\n");
-       hgw_context_compat_destroy_quit(hgw_context);
+       printf("quit_callback called...\n");
+       hgw_context_destroy(hgw_context, HGW_BYE_INACTIVE);
        return 0;
 }
 
 int flush_callback(int errcode) {
-    printf("quit_callback called...\n");
+       printf("quit_callback called...\n");
+       hgw_context_destroy(hgw_context, HGW_BYE_INACTIVE);
        return 0;
 }
index baa3c56..e18b642 100644 (file)
@@ -440,9 +440,10 @@ int main(int argc, char **argv) {
     // Main game
     play();
 
-    hgw_context_compat_destroy_deinit(hgw_context);
+    // hgw_context_compat_destroy_deinit(hgw_context);
     // hgw_context_compat_destroy_quit(hgw_context);
     // hgw_context_destroy(hgw_context);
+    hgw_context_destroy(hgw_context, HGW_BYE_INACTIVE);
 
     return 0;
 }