aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-01-25 23:01:59 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-01-25 23:01:59 +0800
commit841465ea45e56bf2f294b5cb934e5ff955c72401 (patch)
tree6ea71790c1b1c8458cdf6b2b751788ecd32943bf /include
parent1d64816653b5d1835dd60762c2bc64f000d88fa5 (diff)
downloadSMELT-841465ea45e56bf2f294b5cb934e5ff955c72401.tar.xz
Texture options.
Add smHandler* version of event handlers.
Diffstat (limited to 'include')
-rw-r--r--include/smelt.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/smelt.hpp b/include/smelt.hpp
index 4651814..bba4ff5 100644
--- a/include/smelt.hpp
+++ b/include/smelt.hpp
@@ -71,6 +71,7 @@ typedef size_t SMCHN;//Audio channel Handle
//callback function pointer
typedef bool (*smHook)();
+//Wrapper abstract class for a function that can hook into SMELT
class smHandler
{
public: virtual bool handlerFunc()=0;
@@ -87,6 +88,13 @@ class smHandler
#define PRIM_TRIANGLES 3
#define PRIM_QUADS 4
+//Texture Options
+#define TPOT_NONPOT 0
+#define TPOT_POT 1
+
+#define TFLT_LINEAR 0
+#define TFLT_NEAREST 1
+
//Texture Region structure
struct smTexRect
{
@@ -171,6 +179,11 @@ public:
* It returns true when you want to terminate the main loop.
*/
virtual void smUpdateFunc(smHook func)=0;
+ /**
+ * Sets the update function via a smHandler class.
+ * Update function is called every frame.
+ * It returns true when you want to terminate the main loop.
+ */
virtual void smUpdateFunc(smHandler* h)=0;
/**
* Sets the focus lost function.
@@ -179,6 +192,7 @@ public:
* The return value of the focus lost function has no effect.
*/
virtual void smUnFocFunc(smHook func)=0;
+ virtual void smUnFocFunc(smHandler* h)=0;
/**
* Sets the focus gain function.
* Focus gain function is called when the application window gains
@@ -186,6 +200,7 @@ public:
* The return value of the focus gain function has no effect.
*/
virtual void smFocFunc(smHook func)=0;
+ virtual void smFocFunc(smHandler* h)=0;
/**
* Sets the quit function.
* Quit function is called when the user attempts to close the
@@ -194,6 +209,7 @@ public:
* Otherwise the main loop will break.
*/
virtual void smQuitFunc(smHook func)=0;
+ virtual void smQuitFunc(smHandler* h)=0;
/**
* Sets the window title of the application window.
* The default window title is "untitled".
@@ -352,6 +368,7 @@ public:
virtual SMTEX smTextureLoad(const char *path)=0;
virtual SMTEX smTextureLoadFromMemory(const char *ptr,DWORD size)=0;
virtual void smTextureFree(SMTEX tex)=0;
+ virtual void smTextureOpt(int potopt=TPOT_NONPOT,int filter=TFLT_LINEAR)=0;
virtual int smTextureGetWidth(SMTEX tex,bool original=false)=0;
virtual int smTextureGetHeight(SMTEX tex,bool original=false)=0;
virtual DWORD* smTextureLock(SMTEX tex,int l,int t,int w,int h,bool ro=true)=0;