Zoadian 11 年 前
コミット
bdbe891792
6 ファイル変更523 行追加0 行削除
  1. 23 0
      LICENSE.txt
  2. 1 0
      README.md
  3. 14 0
      package.json
  4. 136 0
      source/anttweakbar/anttweakbar.d
  5. 170 0
      source/anttweakbar/functions.d
  6. 179 0
      source/anttweakbar/types.d

+ 23 - 0
LICENSE.txt

@@ -0,0 +1,23 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.

+ 1 - 0
README.md

@@ -0,0 +1 @@
+

+ 14 - 0
package.json

@@ -0,0 +1,14 @@
+{
+	"name": "derelict_extras-anttweakbar",
+	"license": "BSL-1.0",
+	"description": "A dynamic binding binding to the AntTweakBar library.",
+	"copyright": "Copyright © 2014, Felix 'Zoadian' Hufnagel",
+	"authors": ["Felix 'Zoadian' Hufnagel"],
+	
+	"targetPath": "bin",
+	"targetType": "library",
+	
+	"dependencies": {
+		"derelict-util" : "~master"
+	}
+}

+ 136 - 0
source/anttweakbar/anttweakbar.d

@@ -0,0 +1,136 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+module derelict.anttweakbar.anttweakbar;
+
+public
+{
+    import derelict.anttweakbar.types;
+    import derelict.anttweakbar.functions;
+}
+
+private
+{
+    import derelict.util.loader;
+    import derelict.util.system;
+
+    static if(Derelict_OS_Windows)
+		enum libNames = "AntTweakBar.dll";
+    //~ else static if(Derelict_OS_Mac)
+        //~ enum libNames = "libglfw.3.dylib";
+    //~ else static if(Derelict_OS_Posix)
+        //~ enum libNames = "libglfw3.so,libglfw.so.3,/usr/local/lib/libglfw3.so,/usr/local/lib/libglfw.so.3";
+    else
+        static assert(0, "Need to implement AntTweakBar libNames for this operating system.");
+}
+
+class DerelictAntTweakBarLoader : SharedLibLoader
+{
+    protected
+    {
+        override void loadSymbols()
+        {
+			bindFunc(cast(void**)&TwNewBar                   , "_TwNewBar@4");
+			bindFunc(cast(void**)&TwDeleteBar                , "_TwDeleteBar@4");
+			bindFunc(cast(void**)&TwDeleteAllBars            , "_TwDeleteAllBars@0");
+			bindFunc(cast(void**)&TwSetTopBar                , "_TwSetTopBar@4");
+			bindFunc(cast(void**)&TwGetTopBar                , "_TwGetTopBar@0");
+			bindFunc(cast(void**)&TwSetBottomBar             , "_TwSetBottomBar@4");
+			bindFunc(cast(void**)&TwGetBottomBar             , "_TwGetBottomBar@0");
+			bindFunc(cast(void**)&TwGetBarName               , "_TwGetBarName@4");
+			bindFunc(cast(void**)&TwGetBarCount              , "_TwGetBarCount@0");
+			bindFunc(cast(void**)&TwGetBarByIndex            , "_TwGetBarByIndex@4");
+			bindFunc(cast(void**)&TwGetBarByName             , "_TwGetBarByName@4");
+			bindFunc(cast(void**)&TwRefreshBar               , "_TwRefreshBar@4");
+			bindFunc(cast(void**)&TwAddVarRW                 , "_TwAddVarRW@20");
+			bindFunc(cast(void**)&TwAddVarRO                 , "_TwAddVarRO@20");
+			bindFunc(cast(void**)&TwAddVarCB                 , "_TwAddVarCB@28");
+			bindFunc(cast(void**)&TwAddButton                , "_TwAddButton@20");
+			bindFunc(cast(void**)&TwAddSeparator             , "_TwAddSeparator@12");
+			bindFunc(cast(void**)&TwRemoveVar                , "_TwRemoveVar@8");
+			bindFunc(cast(void**)&TwRemoveAllVars            , "_TwRemoveAllVars@4");
+			bindFunc(cast(void**)&TwDefine                   , "_TwDefine@4");
+			bindFunc(cast(void**)&TwDefineEnum               , "_TwDefineEnum@12");
+			bindFunc(cast(void**)&TwDefineEnumFromString     , "_TwDefineEnumFromString@8");
+			bindFunc(cast(void**)&TwDefineStruct             , "_TwDefineStruct@24");
+			bindFunc(cast(void**)&TwCopyCDStringToClientFunc , "_TwCopyCDStringToClientFunc@4");
+			bindFunc(cast(void**)&TwCopyCDStringToLibrary    , "_TwCopyCDStringToLibrary@8");
+			bindFunc(cast(void**)&TwGetParam                 , "_TwGetParam@24");
+			bindFunc(cast(void**)&TwSetParam                 , "_TwSetParam@24");
+			bindFunc(cast(void**)&TwInit                     , "_TwInit@8");
+			bindFunc(cast(void**)&TwTerminate                , "_TwTerminate@0");
+			bindFunc(cast(void**)&TwDraw                     , "_TwDraw@0");
+			bindFunc(cast(void**)&TwWindowSize               , "_TwWindowSize@8");
+			bindFunc(cast(void**)&TwSetCurrentWindow         , "_TwSetCurrentWindow@4");
+			bindFunc(cast(void**)&TwGetCurrentWindow         , "_TwGetCurrentWindow@0");
+			bindFunc(cast(void**)&TwWindowExists             , "_TwWindowExists@4");
+			bindFunc(cast(void**)&TwKeyPressed               , "_TwKeyPressed@8");
+			bindFunc(cast(void**)&TwKeyTest                  , "_TwKeyTest@8");
+			bindFunc(cast(void**)&TwMouseButton              , "_TwMouseButton@8");
+			bindFunc(cast(void**)&TwMouseMotion              , "_TwMouseMotion@8");
+			bindFunc(cast(void**)&TwMouseWheel               , "_TwMouseWheel@4");
+			bindFunc(cast(void**)&TwGetLastError             , "_TwGetLastError@0");
+			bindFunc(cast(void**)&TwHandleErrors             , "_TwHandleErrors@4");
+			bindFunc(cast(void**)&TwEventWin                 , "_TwEventWin@16");
+			bindFunc(cast(void**)&TwEventSDL                 , "_TwEventSDL@12");
+			bindFunc(cast(void**)&TwEventMouseButtonGLFW     , "_TwEventMouseButtonGLFW@8");
+			bindFunc(cast(void**)&TwEventKeyGLFW             , "_TwEventKeyGLFW@8");
+			bindFunc(cast(void**)&TwEventCharGLFW            , "_TwEventCharGLFW@8");
+			
+			bindFunc(cast(void**)&TwEventMouseButtonGLUT , "TwEventMouseButtonGLUT");
+			bindFunc(cast(void**)&TwEventMouseMotionGLUT , "TwEventMouseMotionGLUT");
+			bindFunc(cast(void**)&TwEventKeyboardGLUT    , "TwEventKeyboardGLUT");
+			bindFunc(cast(void**)&TwEventSpecialGLUT     , "TwEventSpecialGLUT");
+//			bindFunc(cast(void**)&TwGLUTModifiersFunc    , "TwGLUTModifiersFunc");
+//			bindFunc(cast(void**)&TwEventSFML            , "TwEventSFML");
+			
+			bindFunc(cast(void**)&TwEventMouseButtonGLFWcdecl , "TwEventMouseButtonGLFWcdecl");
+			bindFunc(cast(void**)&TwEventKeyGLFWcdecl         , "TwEventKeyGLFWcdecl");
+			bindFunc(cast(void**)&TwEventCharGLFWcdecl        , "TwEventCharGLFWcdecl");
+			bindFunc(cast(void**)&TwEventMousePosGLFWcdecl    , "TwEventMousePosGLFWcdecl");
+        }
+    }
+    public
+    {
+        this()
+        {
+            super(libNames);
+        }
+    }
+}
+
+__gshared DerelictAntTweakBarLoader DerelictAntTweakBar;
+
+shared static this()
+{
+    DerelictAntTweakBar = new DerelictAntTweakBarLoader();
+}
+
+shared static ~this()
+{
+    DerelictAntTweakBar.unload();
+}

+ 170 - 0
source/anttweakbar/functions.d

@@ -0,0 +1,170 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+module derelict.anttweakbar.functions;
+
+private
+{
+    import core.stdc.config;
+    import derelict.anttweakbar.types;
+}
+
+
+
+extern(System)
+{
+	alias nothrow TwBar* function(const(char)* barName) da_TwNewBar;
+	alias nothrow int function(TwBar* bar) da_TwDeleteBar;
+	alias nothrow int function() da_TwDeleteAllBars;
+	alias nothrow int function(const(TwBar)* bar) da_TwSetTopBar;
+	alias nothrow TwBar* function() da_TwGetTopBar;
+	alias nothrow int function(const(TwBar)* bar) da_TwSetBottomBar;
+	alias nothrow TwBar* function() da_TwGetBottomBar;
+	alias nothrow const(char)* function(const(TwBar)* bar) da_TwGetBarName;
+	alias nothrow int function() da_TwGetBarCount;
+	alias nothrow TwBar* function(int barIndex) da_TwGetBarByIndex;
+	alias nothrow TwBar* function(const(char)* barName) da_TwGetBarByName;
+	alias nothrow int function(TwBar* bar) da_TwRefreshBar;
+	alias nothrow int function(TwBar* bar, const(char)* name, TwType type, void* var, const(char)* def) da_TwAddVarRW;
+	alias nothrow int function(TwBar* bar, const(char)* name, TwType type, const(void)* var, const(char)* def) da_TwAddVarRO;
+	alias nothrow int function(TwBar* bar, const(char)* name, TwType type, TwSetVarCallback setCallback, TwGetVarCallback getCallback, void* clientData, const(char)* def) da_TwAddVarCB;
+	alias nothrow int function(TwBar* bar, const(char)* name, TwButtonCallback callback, void* clientData, const(char)* def) da_TwAddButton;
+	alias nothrow int function(TwBar* bar, const(char)* name, const(char)* def) da_TwAddSeparator;
+	alias nothrow int function(TwBar* bar, const(char)* name) da_TwRemoveVar;
+	alias nothrow int function(TwBar* bar) da_TwRemoveAllVars;
+	alias nothrow int function(const(char)* def) da_TwDefine;
+	alias nothrow TwType function(const(char)* name, const(TwEnumVal)* enumValues, uint nbValues) da_TwDefineEnum;
+	alias nothrow TwType function(const(char)* name, const(char)* enumString) da_TwDefineEnumFromString;
+	alias nothrow TwType function(const(char)* name, const(TwStructMember)* structMembers, uint nbMembers, size_t structSize, TwSummaryCallback summaryCallback, void* summaryClientData) da_TwDefineStruct;
+	alias nothrow void function(TwCopyCDStringToClient copyCDStringFunc) da_TwCopyCDStringToClientFunc;
+	alias nothrow void function(char** destinationLibraryStringPtr, const(char)* sourceClientString) da_TwCopyCDStringToLibrary;
+	alias nothrow int function(TwBar* bar, const(char)* varName, const(char)* paramName, TwParamValueType paramValueType, uint outValueMaxCount, void* outValues) da_TwGetParam;
+	alias nothrow int function(TwBar* bar, const(char)* varName, const(char)* paramName, TwParamValueType paramValueType, uint inValueCount, const(void)* inValues) da_TwSetParam;
+	alias nothrow int function(TwGraphAPI graphAPI, void* device) da_TwInit;
+	alias nothrow int function() da_TwTerminate;
+	alias nothrow int function() da_TwDraw;
+	alias nothrow int function(int width, int height) da_TwWindowSize;
+	alias nothrow int function(int windowID) da_TwSetCurrentWindow;
+	alias nothrow int function() da_TwGetCurrentWindow;
+	alias nothrow int function(int windowID) da_TwWindowExists;
+	alias nothrow int function(int key, int modifiers) da_TwKeyPressed;
+	alias nothrow int function(int key, int modifiers) da_TwKeyTest;
+	alias nothrow int function(TwMouseAction action, TwMouseButtonID button) da_TwMouseButton;
+	alias nothrow int function(int mouseX, int mouseY) da_TwMouseMotion;
+	alias nothrow int function(int pos) da_TwMouseWheel;
+	alias nothrow const(char)* function() da_TwGetLastError;
+	alias nothrow void function(TwErrorHandler errorHandler) da_TwHandleErrors;
+	alias nothrow int function(void* wnd, uint msg, uint wParam, int lParam) da_TwEventWin;
+	alias nothrow int function(const(void)* sdlEvent, ubyte sdlMajorVersion, ubyte sdlMinorVersion) da_TwEventSDL;
+	alias nothrow int function(int glfwButton, int glfwAction) da_TwEventMouseButtonGLFW;
+	alias nothrow int function(int glfwKey, int glfwAction) da_TwEventKeyGLFW;
+	alias nothrow int function(int glfwChar, int glfwAction) da_TwEventCharGLFW;
+}
+
+extern(C)
+{
+	alias nothrow int function(int glutButton, int glutState, int mouseX, int mouseY) da_TwEventMouseButtonGLUT;
+	alias nothrow int function(int mouseX, int mouseY) da_TwEventMouseMotionGLUT;
+	alias nothrow int function(ubyte glutKey, int mouseX, int mouseY) da_TwEventKeyboardGLUT;
+	alias nothrow int function(int glutKey, int mouseX, int mouseY) da_TwEventSpecialGLUT;
+//	alias nothrow int function(int function() glutGetModifiersFunc) da_TwGLUTModifiersFunc;
+//	alias nothrow int function(const(void)* sfmlEvent, ubyte sfmlMajorVersion, ubyte sfmlMinorVersion) da_TwEventSFML;
+
+	/**
+		Note: The following expect GLFW2 bindings, not GLFW3.
+		In particular GLFW2 keys do not match GLFW3 keys,
+		you'll have to translate them if you want to use these functions.
+	*/
+	alias nothrow int function(int glfwButton, int glfwAction) da_TwEventMouseButtonGLFWcdecl;
+	alias nothrow int function(int glfwKey, int glfwAction) da_TwEventKeyGLFWcdecl;
+	alias nothrow int function(int glfwChar, int glfwAction) da_TwEventCharGLFWcdecl;
+	alias nothrow int function(int mouseX, int mouseY) da_TwEventMousePosGLFWcdecl;
+	alias nothrow int function(int wheelPos) da_TwEventMouseWheelGLFWcdecl;
+}
+
+
+__gshared
+{
+    da_TwNewBar TwNewBar;
+	da_TwDeleteBar TwDeleteBar;
+	da_TwDeleteAllBars TwDeleteAllBars;
+	da_TwSetTopBar TwSetTopBar;
+	da_TwGetTopBar TwGetTopBar;
+	da_TwSetBottomBar TwSetBottomBar;
+	da_TwGetBottomBar TwGetBottomBar;
+	da_TwGetBarName TwGetBarName;
+	da_TwGetBarCount TwGetBarCount;
+	da_TwGetBarByIndex TwGetBarByIndex;
+	da_TwGetBarByName TwGetBarByName;
+	da_TwRefreshBar TwRefreshBar;
+	da_TwAddVarRW TwAddVarRW;
+	da_TwAddVarRO TwAddVarRO;
+	da_TwAddVarCB TwAddVarCB;
+	da_TwAddButton TwAddButton;
+	da_TwAddSeparator TwAddSeparator;
+	da_TwRemoveVar TwRemoveVar;
+	da_TwRemoveAllVars TwRemoveAllVars;
+	da_TwDefine TwDefine;
+	da_TwDefineEnum TwDefineEnum;
+	da_TwDefineEnumFromString TwDefineEnumFromString;
+	da_TwDefineStruct TwDefineStruct;
+	da_TwCopyCDStringToClientFunc TwCopyCDStringToClientFunc;
+	da_TwCopyCDStringToLibrary TwCopyCDStringToLibrary;
+	da_TwGetParam TwGetParam;
+	da_TwSetParam TwSetParam;
+	da_TwInit TwInit;
+	da_TwTerminate TwTerminate;
+	da_TwDraw TwDraw;
+	da_TwWindowSize TwWindowSize;
+	da_TwSetCurrentWindow TwSetCurrentWindow;
+	da_TwGetCurrentWindow TwGetCurrentWindow;
+	da_TwWindowExists TwWindowExists;
+	da_TwKeyPressed TwKeyPressed;
+	da_TwKeyTest TwKeyTest;
+	da_TwMouseButton TwMouseButton;
+	da_TwMouseMotion TwMouseMotion;
+	da_TwMouseWheel TwMouseWheel;
+	da_TwGetLastError TwGetLastError;
+	da_TwHandleErrors TwHandleErrors;
+	da_TwEventWin TwEventWin;
+	da_TwEventSDL TwEventSDL;
+	da_TwEventMouseButtonGLFW TwEventMouseButtonGLFW;
+	da_TwEventKeyGLFW TwEventKeyGLFW;
+	da_TwEventCharGLFW TwEventCharGLFW;
+	
+	da_TwEventMouseButtonGLUT TwEventMouseButtonGLUT;
+	da_TwEventMouseMotionGLUT TwEventMouseMotionGLUT;
+	da_TwEventKeyboardGLUT TwEventKeyboardGLUT;
+	da_TwEventSpecialGLUT TwEventSpecialGLUT;
+//	da_TwGLUTModifiersFunc TwGLUTModifiersFunc;
+//	da_TwEventSFML TwEventSFML;
+	
+	da_TwEventMouseButtonGLFWcdecl TwEventMouseButtonGLFWcdecl;
+	da_TwEventKeyGLFWcdecl TwEventKeyGLFWcdecl;
+	da_TwEventCharGLFWcdecl TwEventCharGLFWcdecl;
+	da_TwEventMousePosGLFWcdecl TwEventMousePosGLFWcdecl;
+}

+ 179 - 0
source/anttweakbar/types.d

@@ -0,0 +1,179 @@
+/*
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+module derelict.anttweakbar.types;
+
+import core.stdc.config;
+
+alias CTwBar TwBar;
+alias ETwType TwType;
+alias void function(const(void)*, void*) TwSetVarCallback;
+alias void function(void*, void*) TwGetVarCallback;
+alias void function(void*) TwButtonCallback;
+alias CTwEnumVal TwEnumVal;
+alias CTwStructMember TwStructMember;
+alias void function(char*, c_ulong, const(void)*, void*) TwSummaryCallback;
+alias void function(char**, const(char)*) TwCopyCDStringToClient;
+alias ETwParamValueType TwParamValueType;
+alias ETwGraphAPI TwGraphAPI;
+alias ETwKeyModifier TwKeyModifier;
+alias EKeySpecial TwKeySpecial;
+alias ETwMouseAction TwMouseAction;
+alias ETwMouseButtonID TwMouseButtonID;
+alias void function(const(char)*) TwErrorHandler;
+alias void function(int, int, int, int) GLUTmousebuttonfun;
+alias void function(int, int) GLUTmousemotionfun;
+alias void function(ubyte, int, int) GLUTkeyboardfun;
+alias void function(int, int, int) GLUTspecialfun;
+
+alias ETwType = int;
+enum : ETwType
+{
+    TW_TYPE_UNDEF    = 0,
+    TW_TYPE_BOOL8    = 2,
+    TW_TYPE_BOOL16   = 3,
+    TW_TYPE_BOOL32   = 4,
+    TW_TYPE_CHAR     = 5,
+    TW_TYPE_INT8     = 6,
+    TW_TYPE_UINT8    = 7,
+    TW_TYPE_INT16    = 8,
+    TW_TYPE_UINT16   = 9,
+    TW_TYPE_INT32    = 10,
+    TW_TYPE_UINT32   = 11,
+    TW_TYPE_FLOAT    = 12,
+    TW_TYPE_DOUBLE   = 13,
+    TW_TYPE_COLOR32  = 14,
+    TW_TYPE_COLOR3F  = 15,
+    TW_TYPE_COLOR4F  = 16,
+    TW_TYPE_CDSTRING = 17,
+    TW_TYPE_QUAT4F   = 19,
+    TW_TYPE_QUAT4D   = 20,
+    TW_TYPE_DIR3F    = 21,
+    TW_TYPE_DIR3D    = 22
+}
+
+alias ETwParamValueType = int;
+enum : ETwParamValueType
+{
+    TW_PARAM_INT32   = 0,
+    TW_PARAM_FLOAT   = 1,
+    TW_PARAM_DOUBLE  = 2,
+    TW_PARAM_CSTRING = 3
+}
+
+
+alias ETwGraphAPI = int;
+enum : ETwGraphAPI
+{
+    TW_OPENGL      = 1,
+    TW_DIRECT3D9   = 2,
+    TW_DIRECT3D10  = 3,
+    TW_DIRECT3D11  = 4,
+    TW_OPENGL_CORE = 5  // NOTE: Use this one when using a CORE OpenGL profile, TW_OPENGL will not work!
+}
+
+alias ETwKeyModifier = int;
+enum : ETwKeyModifier
+{
+    TW_KMOD_NONE  = 0,
+    TW_KMOD_SHIFT = 3,
+    TW_KMOD_CTRL  = 192,
+    TW_KMOD_ALT   = 256,
+    TW_KMOD_META  = 3072
+}
+
+alias EKeySpecial = int;
+enum : EKeySpecial
+{
+    TW_KEY_BACKSPACE = 8,
+    TW_KEY_TAB       = 9,
+    TW_KEY_CLEAR     = 12,
+    TW_KEY_RETURN    = 13,
+    TW_KEY_PAUSE     = 19,
+    TW_KEY_ESCAPE    = 27,
+    TW_KEY_SPACE     = 32,
+    TW_KEY_DELETE    = 127,
+    TW_KEY_UP        = 273,
+    TW_KEY_DOWN      = 274,
+    TW_KEY_RIGHT     = 275,
+    TW_KEY_LEFT      = 276,
+    TW_KEY_INSERT    = 277,
+    TW_KEY_HOME      = 278,
+    TW_KEY_END       = 279,
+    TW_KEY_PAGE_UP   = 280,
+    TW_KEY_PAGE_DOWN = 281,
+    TW_KEY_F1        = 282,
+    TW_KEY_F2        = 283,
+    TW_KEY_F3        = 284,
+    TW_KEY_F4        = 285,
+    TW_KEY_F5        = 286,
+    TW_KEY_F6        = 287,
+    TW_KEY_F7        = 288,
+    TW_KEY_F8        = 289,
+    TW_KEY_F9        = 290,
+    TW_KEY_F10       = 291,
+    TW_KEY_F11       = 292,
+    TW_KEY_F12       = 293,
+    TW_KEY_F13       = 294,
+    TW_KEY_F14       = 295,
+    TW_KEY_F15       = 296,
+    TW_KEY_LAST      = 297
+}
+
+alias ETwMouseAction = int;
+enum : ETwMouseAction
+{
+    TW_MOUSE_RELEASED = 0,
+    TW_MOUSE_PRESSED  = 1
+}
+
+alias ETwMouseButtonID = int;
+enum : ETwMouseButtonID
+{
+    TW_MOUSE_LEFT   = 1,
+    TW_MOUSE_MIDDLE = 2,
+    TW_MOUSE_RIGHT  = 3
+}
+
+
+struct CTwEnumVal
+{
+    int Value;
+    const(char)*Label;
+}
+
+
+struct CTwStructMember
+{
+    const(char)*Name;
+    TwType Type;
+    size_t Offset;
+    const(char)*DefString;
+}
+
+
+struct CTwBar;