From 7e2cae472ee7774c69e4ad0000bdb31dd3ef5036 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sun, 15 Feb 2015 21:52:20 +0100 Subject: [PATCH] [DEV] set it work on MacOs & IOs again --- build | 2 +- external/etk | 2 +- external/ewolsa | 2 +- sources/ewol/context/IOs/Context.cpp | 12 +++++++----- sources/ewol/context/IOs/Interface.m | 6 ++++-- sources/ewol/context/IOs/OpenglView.h | 8 ++++---- sources/ewol/context/MacOs/Interface.h | 2 +- sources/ewol/context/MacOs/Interface.mm | 2 +- sources/ewol/context/MacOs/Windows.h | 2 +- sources/ewol/context/MacOs/Windows.mm | 2 +- sources/ewol/openGL/openGL.h | 12 +++++++++--- 11 files changed, 31 insertions(+), 21 deletions(-) diff --git a/build b/build index 03e67ae8..512651e7 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 03e67ae8d6ab62536437c246548d047bbd2565a4 +Subproject commit 512651e746dfe3318308ffae94aeca731078baff diff --git a/external/etk b/external/etk index 44dd675e..e6a829fd 160000 --- a/external/etk +++ b/external/etk @@ -1 +1 @@ -Subproject commit 44dd675eb8c2b2a635f3bd691b015b792b1be8bd +Subproject commit e6a829fd2aff0f55022c92192a95a35ff8993be1 diff --git a/external/ewolsa b/external/ewolsa index 23467923..af355c40 160000 --- a/external/ewolsa +++ b/external/ewolsa @@ -1 +1 @@ -Subproject commit 23467923b4917aa7db24f262b3129ac5f58803c5 +Subproject commit af355c40510498c052e9fab8b5f2ea134e752235 diff --git a/sources/ewol/context/IOs/Context.cpp b/sources/ewol/context/IOs/Context.cpp index 60eb2702..f5eaaa02 100644 --- a/sources/ewol/context/IOs/Context.cpp +++ b/sources/ewol/context/IOs/Context.cpp @@ -232,6 +232,7 @@ void IOs::foreground() { static int l_argc = 0; static const char **l_argv = nullptr; +static ewol::context::Application* l_application; /** * @brief Main of the program * @param std IO @@ -240,14 +241,16 @@ static const char **l_argv = nullptr; int ewol::run(ewol::context::Application* _application, int _argc, const char *_argv[]) { l_argc = _argc; l_argv = _argv; - return mm_main(_application, _argc, _argv); + l_application = _application; + return mm_main(_argc, _argv); } // Creat and relaese ewol::Context interface: void IOs::createInterface() { etk::setArgZero(l_argv[0]); EWOL_INFO("Create new interface"); - interface = new MacOSInterface(l_argc, l_argv); + interface = new MacOSInterface(l_application, l_argc, l_argv); + l_application = nullptr; if (nullptr == interface) { EWOL_CRITICAL("Can not create the X11 interface ... MEMORY allocation error"); return; @@ -255,10 +258,9 @@ void IOs::createInterface() { } void IOs::releaseInterface() { - if (interface == nullptr) { - return; + if (interface != nullptr) { + EWOL_INFO("Remove interface"); } - EWOL_INFO("Remove interface"); delete(interface); interface = nullptr; } diff --git a/sources/ewol/context/IOs/Interface.m b/sources/ewol/context/IOs/Interface.m index 0e3a9226..681e44c1 100644 --- a/sources/ewol/context/IOs/Interface.m +++ b/sources/ewol/context/IOs/Interface.m @@ -15,7 +15,8 @@ int mm_main(int argc, const char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, (char**)argv, nil, NSStringFromClass([AppDelegate class])); - } // return no error + } + // return no error return 0; } @@ -24,6 +25,7 @@ void mm_exit(void) { } void mm_openURL(const char *_url) { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:_url]]; + NSString* url = [[NSString alloc] initWithUTF8String:_url]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; } diff --git a/sources/ewol/context/IOs/OpenglView.h b/sources/ewol/context/IOs/OpenglView.h index da41a096..2cf99c46 100644 --- a/sources/ewol/context/IOs/OpenglView.h +++ b/sources/ewol/context/IOs/OpenglView.h @@ -34,8 +34,8 @@ int deltaDisplay; int displayCounter; } -- ()stopDisplayLink; -- ()startDisplayLink; -- ()speedSlow; -- ()speedNormal; +- (void)stopDisplayLink; +- (void)startDisplayLink; +- (void)speedSlow; +- (void)speedNormal; @end diff --git a/sources/ewol/context/MacOs/Interface.h b/sources/ewol/context/MacOs/Interface.h index d3bb38e8..3a412b21 100644 --- a/sources/ewol/context/MacOs/Interface.h +++ b/sources/ewol/context/MacOs/Interface.h @@ -14,7 +14,7 @@ extern "C" { #endif int mm_main(int argc, const char *argv[]); -int mm_run(); +int mm_run(void); #ifdef __cplusplus } diff --git a/sources/ewol/context/MacOs/Interface.mm b/sources/ewol/context/MacOs/Interface.mm index 30af278a..5f0e855d 100644 --- a/sources/ewol/context/MacOs/Interface.mm +++ b/sources/ewol/context/MacOs/Interface.mm @@ -84,7 +84,7 @@ int mm_main(int argc, const char *argv[]) { //[window addChildWindow:view]; //[window makeKeyAndVisible]; - [window setDelegate:view]; + //[window setDelegate:view]; #else @autoreleasepool { diff --git a/sources/ewol/context/MacOs/Windows.h b/sources/ewol/context/MacOs/Windows.h index 63881597..43f9340f 100644 --- a/sources/ewol/context/MacOs/Windows.h +++ b/sources/ewol/context/MacOs/Windows.h @@ -13,7 +13,7 @@ } + (id)alloc; - (id)init; -+ ()dealloc; ++ (void)dealloc; @end diff --git a/sources/ewol/context/MacOs/Windows.mm b/sources/ewol/context/MacOs/Windows.mm index 50939ec1..0fb8a7a5 100644 --- a/sources/ewol/context/MacOs/Windows.mm +++ b/sources/ewol/context/MacOs/Windows.mm @@ -60,7 +60,7 @@ //[window addChildWindow:view]; //[window makeKeyAndVisible]; - [windowsID setDelegate:view]; + //[windowsID setDelegate:view]; EWOL_DEBUG("ALLOCATE ..."); return windowsID; } diff --git a/sources/ewol/openGL/openGL.h b/sources/ewol/openGL/openGL.h index 48e73ad2..5a880fd1 100644 --- a/sources/ewol/openGL/openGL.h +++ b/sources/ewol/openGL/openGL.h @@ -149,9 +149,15 @@ namespace ewol { renderTriangle = GL_TRIANGLES, renderTriangleStrip = GL_TRIANGLE_STRIP, //!< Not supported in EWOL (TODO : Later) renderTriangleFan = GL_TRIANGLE_FAN, //!< Not supported in EWOL (TODO : Later) - renderQuad = GL_QUADS, //!< Not supported in OpenGL-ES2 - renderQuadStrip = GL_QUAD_STRIP, //!< Not supported in OpenGL-ES2 - renderPolygon = GL_POLYGON //!< Not supported in OpenGL-ES2 + #if (!defined(__TARGET_OS__IOs) && !defined(__TARGET_OS__Android)) + renderQuad = GL_QUADS, //!< Not supported in OpenGL-ES2 + renderQuadStrip = GL_QUAD_STRIP, //!< Not supported in OpenGL-ES2 + renderPolygon = GL_POLYGON //!< Not supported in OpenGL-ES2 + #else + renderQuad, //!< Not supported in OpenGL-ES2 + renderQuadStrip, //!< Not supported in OpenGL-ES2 + renderPolygon //!< Not supported in OpenGL-ES2 + #endif }; /**