diff --git a/glfw/GLFW.hx b/glfw/GLFW.hx index 3fc7c65..e79a194 100644 --- a/glfw/GLFW.hx +++ b/glfw/GLFW.hx @@ -11,17 +11,17 @@ typedef HWND = cpp.Pointer; @:keep @:native("GLFWwindow") -@:include("GLFW/glfw3.h") +@:include("linc_glfw.h") extern class GLFWwindow {} @:keep @:native("GLFWcursor") -@:include("GLFW/glfw3.h") +@:include("linc_glfw.h") extern class GLFWcursor {} @:keep @:native("GLFWmonitor") -@:include("GLFW/glfw3.h") +@:include("linc_glfw.h") extern class GLFWmonitor {} typedef GLFWerrorfun = Int -> String -> Void; @@ -175,15 +175,10 @@ extern class GLFWvidmode { public var refreshRate: Int; } +// See https://www.glfw.org/docs/latest/group__native.html @:keep +@:include('linc_glfw.h') #if !display -@:cppFileCode(" -#include -#ifdef HX_WINDOWS -#define GLFW_EXPOSE_NATIVE_WIN32 -#include -#endif -") @:build(linc.Linc.touch()) @:build(linc.Linc.xml('glfw')) #end @@ -191,7 +186,10 @@ extern class GLFW { //Bindings @:native('glfwInit') - static function glfwInit() : Int; + static inline function glfwInit() : Int{ + force_include(); + return untyped __cpp__('glfwInit()'); + } @:native('glfwTerminate') static function glfwTerminate() : Void; diff --git a/linc/linc_glfw.h b/linc/linc_glfw.h new file mode 100644 index 0000000..aad4bb4 --- /dev/null +++ b/linc/linc_glfw.h @@ -0,0 +1,5 @@ +#include +#ifdef HX_WINDOWS +#define GLFW_EXPOSE_NATIVE_WIN32 +#include +#endif \ No newline at end of file diff --git a/linc/linc_glfw.xml b/linc/linc_glfw.xml index e412b59..018b157 100644 --- a/linc/linc_glfw.xml +++ b/linc/linc_glfw.xml @@ -6,11 +6,12 @@ + - + - +