From 2e32e892540d1afbb59ea056cfe80226174a8f6f Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Tue, 11 Aug 2015 21:39:36 +0000
Subject: [PATCH] base implementation of player fullscreen and volume callbacks into the game

---
 client/library/humble_api.h |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/client/library/humble_api.h b/client/library/humble_api.h
index cfd611b..a6b3e78 100644
--- a/client/library/humble_api.h
+++ b/client/library/humble_api.h
@@ -22,6 +22,30 @@
      */
     void humble_fetch_asset_data(const char* url, void *arg, em_async_wget_onload_func onload, em_arg_callback_func onerror);
 
+    typedef enum {
+        /**
+         * This callback is passed a float volume (between 0.0 and 1.0) as well as the data parameter when registered.
+         *
+         * callback prototype: void (*)(float volume, void* data);
+         */
+        HUMBLE_API_CALLBACK_SET_PLAYER_VOLUME = 1,
+        /**
+         * This callback is passed an int value which is either 1 for fullscreen or 0 for windowed as well as the data parameter when registered.
+         * when going windowed, the application should use and respect the humble_get_player_size values
+         *
+         * callback prototype: void (*)(int fullscreen, void* data);
+         */
+        HUMBLE_API_CALLBACK_SET_PLAYER_FULLSCREEN      = 2,
+    } HUMBLE_API_CALLBACK;
+
+    /**
+     * Register a callback for the specified callback type
+     * If a callback is already registered, it will be replaced with the new callback
+     * passing a NUL for callback will unregister the callback for that type
+     * data will be passed along to the callback function as the last parameter
+     */
+    int humble_set_callback(HUMBLE_API_CALLBACK type, void *callback, void* data);
+
     /**
      * Gets the allowable player size of the humble player.  Use this to restrict the size of the game in windowed mode.
      * returns 1 if the restriction should be enforced.. 0 otherwise

--
Gitblit v1.9.3