From f6b4653a850141545c4cc8bdb3d837c3cfead0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20R=C3=B8nning?= Date: Fri, 12 Jul 2019 14:27:11 +0200 Subject: [PATCH] Include linc_glfw.h as header --- glfw/GLFW.hx | 20 +++++++++----------- linc/linc_glfw.h | 5 +++++ linc/linc_glfw.xml | 5 +++-- 3 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 linc/linc_glfw.h 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 @@ + - + - +