From 278fc2712f5145337e638522bb4fb0d998103900 Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Sun, 4 Dec 2011 13:34:24 +0100 Subject: [PATCH] Android first version is now ok ==> must review event and insit uninit system for android --- Makefile | 2 +- Sources/Main.cpp | 31 ++-- Sources/base/{guiAndroid.h => gui.h} | 6 +- Sources/base/guiAndroid.cpp | 204 ++++++++++++++++++++++++--- Sources/base/guiDoubleBuffer.h | 40 ------ Sources/base/guiIPhone.h | 39 ----- Sources/base/guiX11.cpp | 26 +++- Sources/base/guiX11.h | 49 ------- Sources/demo.cpp | 27 +--- Sources/etk/Stream.h | 74 +++++++++- Sources/ewol/OObject/2DText.cpp | 3 +- Sources/ewol/Widget.cpp | 1 + Sources/ewol/Windows.cpp | 22 ++- Sources/ewol/ewol.cpp | 16 +-- Sources/ewol/widget/Test.cpp | 6 +- jni/Android.mk | 3 +- 16 files changed, 333 insertions(+), 216 deletions(-) rename Sources/base/{guiAndroid.h => gui.h} (90%) delete mode 100644 Sources/base/guiDoubleBuffer.h delete mode 100644 Sources/base/guiIPhone.h delete mode 100644 Sources/base/guiX11.h diff --git a/Makefile b/Makefile index e1ffa372..a5806f41 100644 --- a/Makefile +++ b/Makefile @@ -311,7 +311,7 @@ clean: @echo ' CLEANING : $(F_VIOLET)$(OUTPUT_NAME)$(F_NORMALE)'$(CADRE_COTERS) @echo $(CADRE_HAUT_BAS) ifeq ($(PLATFORM), Android) - rm -r bin libs gen obj + rm -rf bin libs gen obj else @echo Remove Folder : $(OBJECT_DIR) @rm -rf $(OBJECT_DIR) diff --git a/Sources/Main.cpp b/Sources/Main.cpp index e39b55bf..afaf9747 100644 --- a/Sources/Main.cpp +++ b/Sources/Main.cpp @@ -87,13 +87,13 @@ class Plop :public ewol::Windows }; }; +static Plop * myWindowsExample = NULL; + /** - * @brief main input fonction + * @brief main application function Initialisation */ -int main(int argc, char *argv[]) +void APP_Init(int argc, char *argv[]) { - - ewol::Init(argc, argv); ewol::ChangeSize(800, 600); /* if (true == ewol::AddFont("dataTest/TextMonospace.ebt", true, true, true) ) { @@ -103,23 +103,18 @@ int main(int argc, char *argv[]) ewol::SetFontFolder("Font"); ewol::SetDefaultFont("freefont/FreeMono", 14); ewol::theme::LoadDefault("dataTest/exemple.eol"); - //ewol::theme::LoadDefault("dataTest/exemple.eol"); - //exit(0); - Plop * myWindowsExample = new Plop(); + myWindowsExample = new Plop(); // create the specific windows ewol::DisplayWindows(myWindowsExample); - - ewol::Run(); - - ewol::DisplayWindows(NULL); - - delete(myWindowsExample); - - ewol::UnInit(); - - - return 0; +} + +/** + * @brief main application function Un-Initialisation + */ +void APP_UnInit(void) +{ + delete(myWindowsExample); } diff --git a/Sources/base/guiAndroid.h b/Sources/base/gui.h similarity index 90% rename from Sources/base/guiAndroid.h rename to Sources/base/gui.h index 61de1e10..085e02ba 100644 --- a/Sources/base/guiAndroid.h +++ b/Sources/base/gui.h @@ -1,6 +1,6 @@ /** ******************************************************************************* - * @file guiAndroid.h + * @file gui.h * @brief Gui abstraction layer (header) * @author Edouard DUPIN * @date 20/10/2011 @@ -44,6 +44,8 @@ namespace guiAbstraction bool IsPressedInput(int32_t inputID); }; - +//!< must be define in CPP by the application ... +void APP_Init(int argc, char *argv[]); +void APP_UnInit(void); #endif diff --git a/Sources/base/guiAndroid.cpp b/Sources/base/guiAndroid.cpp index 28484803..1ced3005 100644 --- a/Sources/base/guiAndroid.cpp +++ b/Sources/base/guiAndroid.cpp @@ -33,8 +33,10 @@ #include #include #include -#include +#include +#include +#include #include @@ -50,9 +52,10 @@ static long sTimeOffset = 0; static int sTimeOffsetInit = 0; static long sTimeStopped = 0; -static int32_t currentWidth = 320; -static int32_t currentHeight = 480; +static etkFloat_t m_width = 320; +static etkFloat_t m_height = 480; +ewol::Windows* m_uniqueWindows = NULL; static long _getTime(void) { @@ -61,6 +64,9 @@ static long _getTime(void) return (long)(now.tv_sec*1000 + now.tv_usec/1000); } + +void Draw(void); + extern "C" { @@ -68,7 +74,8 @@ extern "C" void Java_com_example_ewolAbstraction_EwolRenderer_nativeInit( JNIEnv* env ) { EWOL_INFO("Init : Start All Application"); - appInit(); + ewol::Init(0, NULL); + APP_Init(0, NULL); gAppAlive = 1; sDemoStopped = 0; sTimeOffsetInit = 0; @@ -77,16 +84,24 @@ extern "C" void Java_com_example_ewolAbstraction_EwolRenderer_nativeResize( JNIEnv* env, jobject thiz, jint w, jint h ) { - currentWidth = w; - currentHeight = h; + m_width = w; + m_height = h; EWOL_INFO("Resize w=" << w << " h=" << h); + if (NULL != m_uniqueWindows) { + m_uniqueWindows->CalculateSize((etkFloat_t)m_width, (etkFloat_t)m_height); + } } /* Call to finalize the graphics state */ void Java_com_example_ewolAbstraction_EwolRenderer_nativeDone( JNIEnv* env ) { EWOL_INFO("Renderer : Close All Application"); - appDeinit(); + // unset all windows + ewol::DisplayWindows(NULL); + // call application to uninit + APP_UnInit(); + // uninit Ewol + ewol::UnInit(); } /* This is called to indicate to the render loop that it should @@ -111,7 +126,13 @@ extern "C" { EWOL_INFO("Event : Input Motion ID=" << pointerID << " x=" << x << " y=" << y); if (0 == pointerID) { - appMove(x,y); + //appMove(x,y); + if(NULL != m_uniqueWindows) { + m_uniqueWindows->GenEventInput(ewol::FLAG_EVENT_INPUT_1, ewol::EVENT_INPUT_TYPE_DOWN, (etkFloat_t)x, (etkFloat_t)y); + m_uniqueWindows->GenEventInput(ewol::FLAG_EVENT_INPUT_1 | ewol::FLAG_EVENT_INPUT_CLICKED, ewol::EVENT_INPUT_TYPE_SINGLE, (etkFloat_t)x, (etkFloat_t)y); + m_uniqueWindows->GenEventInput(ewol::FLAG_EVENT_INPUT_1, ewol::EVENT_INPUT_TYPE_UP, (etkFloat_t)x, (etkFloat_t)y); + m_uniqueWindows->CalculateSize((etkFloat_t)m_width, (etkFloat_t)m_height); + } } } @@ -148,7 +169,7 @@ extern "C" } } - appRender(curTime, currentWidth, currentHeight); + Draw(); } } @@ -156,6 +177,121 @@ extern "C" +static void Setwindow(ewol::Windows* newWindows) +{ + m_uniqueWindows = newWindows; + if (NULL != m_uniqueWindows) { + m_uniqueWindows->CalculateSize((etkFloat_t)m_width, (etkFloat_t)m_height); + } +} + + + +static etkFloat_t gTriangleVertices[] = { 0.0f, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f }; +static etkFloat_t gTriangleVertices5[] = { 200.0f, 200.0f, 100.0f, 200.0f, 200.0f, 100.0f, + 200.0f, 200.0f, 300.0f, 200.0f, 200.0f, 300.0f }; + +void Draw(void) +{ + //EWOL_DEBUG("redraw (" << m_width << "," << m_height << ")"); + if(NULL == m_uniqueWindows) { + // set the size of the open GL system + glViewport(0,0,m_width,m_height); + + // Clear the screen with transparency ... + glClearColor(0.0,0.0,0.0, 1.0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + //glOrtho(0., width, 0., -height, 1., 20.); + glOrtho(-m_width/2, m_width/2, m_height/2, -m_height/2, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + //glTranslatef(0, -height/2, -5); + glTranslatef(-m_width/2, -m_height/2, -1.0); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA); + //glBlendFunc(GL_SRC_ALPHA, GL_SRC_COLOR); + + glEnableClientState( GL_VERTEX_ARRAY ); + + //LOGI("engine_draw_frame (%d,%d)",width,height); + + glColor4f(0.0, 1.0, 1.0, 1.0); + glVertexPointer(2, oglTypeFloat_t, 0, gTriangleVertices5 ); + glDrawArrays( GL_TRIANGLES, 0, 6); + static int vallllll = 0; + static float transparency = 0.0; + if (vallllll <= 1) { + transparency +=0.025; + if (transparency >= 1.0) { + vallllll++; + transparency = 0.0; + glColor4f(1.0, 0.0, 0.0, 1.0); + } else { + glColor4f(1.0, 0.0, 0.0, transparency); + } + } else if (vallllll <= 2) { + transparency +=0.025; + if (transparency >= 1.0) { + vallllll++; + transparency = 0.0; + glColor4f(1.0, 1.0, 0.0, 1.0); + } else { + glColor4f(1.0, 1.0, 0.0, transparency); + } + } else if (vallllll <= 3) { + transparency +=0.025; + if (transparency >= 1.0) { + vallllll++; + transparency = 0.0; + glColor4f(0.0, 1.0, 0.0, 1.0); + } else { + glColor4f(0.0, 1.0, 0.0, transparency); + } + } else if (vallllll <= 4) { + transparency +=0.025; + if (transparency >= 1.0) { + vallllll++; + transparency = 0.0; + glColor4f(0.0, 1.0, 1.0, 1.0); + } else { + glColor4f(0.0, 1.0, 1.0, transparency); + } + } else if (vallllll <= 5) { + transparency +=0.025; + if (transparency >= 1.0) { + vallllll++; + transparency = 0.0; + glColor4f(0.0, 0.0, 1.0, 1.0); + } else { + glColor4f(0.0, 0.0, 1.0, transparency); + } + } else { + transparency +=0.025; + if (transparency >= 1.0) { + vallllll = 0; + transparency = 0.0; + glColor4f(1.0, 0.0, 1.0, 1.0); + } else { + glColor4f(1.0, 0.0, 1.0, transparency); + } + } + glVertexPointer(2, oglTypeFloat_t, 0, gTriangleVertices ); + glDrawArrays( GL_TRIANGLES, 0, 3); + + glDisableClientState( GL_VERTEX_ARRAY ); + + glDisable(GL_BLEND); + } else { + m_uniqueWindows->SysDraw(); + } + glFlush(); +} @@ -182,13 +318,7 @@ void guiAbstraction::Init(int32_t argc, char *argv[]) void guiAbstraction::Run(void) { - if (true == guiAbstractionIsInit) { - EWOL_INFO("Start Running"); - //myX11Access->Run(); - EWOL_INFO("Stop Running"); - } else { - EWOL_CRITICAL("Can not Run X11 ==> not init ... "); - } + EWOL_INFO("Noting to run in android mode ..."); } void guiAbstraction::Stop(void) @@ -203,7 +333,7 @@ void guiAbstraction::Stop(void) void guiAbstraction::SetDisplayOnWindows(ewol::Windows * newOne) { if (true == guiAbstractionIsInit) { - //myX11Access->Setwindow(newOne); + Setwindow(newOne); } else { EWOL_CRITICAL("Can not set Windows X11 ==> not init ... "); } @@ -277,3 +407,43 @@ bool guiAbstraction::IsPressedInput(int32_t inputID) return false; //} } + +// never had main in android ... +/* +int main(int argc, char *argv[]) +{ + return -1; +} +*/ + +void glOrtho(GLfloat left, + GLfloat right, + GLfloat bottom, + GLfloat top, + GLfloat nearVal, + GLfloat farVal) +{ + GLfloat myMatrix[4*4]; + int iii; + for(iii=0; iii<4*4 ; iii++) { + myMatrix[iii] = 0; + } + myMatrix[0] = 2.0 / (right - left); + myMatrix[5] = 2.0 / (top - bottom); + myMatrix[10] = -2.0 / (farVal - nearVal); +#if 1 + myMatrix[3] = -1*(right + left) / (right - left); + myMatrix[7] = -1*(top + bottom) / (top - bottom); + myMatrix[11] = -1*(farVal + nearVal) / (farVal - nearVal); +#else + // test if matrix is not corectly instanciate ... + myMatrix[12] = -1*(right + left) / (right - left); + myMatrix[13] = -1*(top + bottom) / (top - bottom); + myMatrix[14] = -1*(farVal + nearVal) / (farVal - nearVal); +#endif + myMatrix[15] = 1; + + glLoadMatrixf(myMatrix); + + +} diff --git a/Sources/base/guiDoubleBuffer.h b/Sources/base/guiDoubleBuffer.h deleted file mode 100644 index 5f7f3ba4..00000000 --- a/Sources/base/guiDoubleBuffer.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - ******************************************************************************* - * @file guiDoubleBuffer.h - * @brief Gui abstraction layer (header) - * @author Edouard DUPIN - * @date 20/10/2011 - * @par Project - * ewol - * - * @par Copyright - * Copyright 2011 Edouard DUPIN, all right reserved - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY. - * - * Licence summary : - * You can modify and redistribute the sources code and binaries. - * You can send me the bug-fix - * - * Term of the licence in in the file licence.txt. - * - ******************************************************************************* - */ - - -#ifndef __GUI_ABSTRACTION_H__ -#define __GUI_ABSTRACTION_H__ - -#include - -namespace guiAbstraction -{ - void Init(int32_t argc, char *argv[]); - void Run(void); - void UnInit(void); -}; - - - -#endif diff --git a/Sources/base/guiIPhone.h b/Sources/base/guiIPhone.h deleted file mode 100644 index b82f1004..00000000 --- a/Sources/base/guiIPhone.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - ******************************************************************************* - * @file guiIPhone.h - * @brief Gui abstraction layer (header) - * @author Edouard DUPIN - * @date 20/10/2011 - * @par Project - * ewol - * - * @par Copyright - * Copyright 2011 Edouard DUPIN, all right reserved - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY. - * - * Licence summary : - * You can modify and redistribute the sources code and binaries. - * You can send me the bug-fix - * - * Term of the licence in in the file licence.txt. - * - ******************************************************************************* - */ - - -#ifndef __GUI_ABSTRACTION_H__ -#define __GUI_ABSTRACTION_H__ - -#include - -namespace guiAbstraction -{ - void Init(int32_t argc, char *argv[]); - void Run(void); - void UnInit(void); -}; - - -#endif diff --git a/Sources/base/guiX11.cpp b/Sources/base/guiX11.cpp index 7a693796..61b050df 100644 --- a/Sources/base/guiX11.cpp +++ b/Sources/base/guiX11.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -876,3 +876,27 @@ bool guiAbstraction::IsPressedInput(int32_t inputID) } } +#include + + + + + +int main(int argc, char *argv[]) +{ + // init Ewol + ewol::Init(argc, argv); + // Init Application ... + APP_Init(argc, argv); + // Start Ewol diwplay while + ewol::Run(); + // unset all windows + ewol::DisplayWindows(NULL); + // call application to uninit + APP_UnInit(); + // uninit Ewol + ewol::UnInit(); + + return 0; +} + diff --git a/Sources/base/guiX11.h b/Sources/base/guiX11.h deleted file mode 100644 index e85f9358..00000000 --- a/Sources/base/guiX11.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - ******************************************************************************* - * @file guiX11.h - * @brief Gui abstraction layer (header) - * @author Edouard DUPIN - * @date 20/10/2011 - * @par Project - * ewol - * - * @par Copyright - * Copyright 2011 Edouard DUPIN, all right reserved - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY. - * - * Licence summary : - * You can modify and redistribute the sources code and binaries. - * You can send me the bug-fix - * - * Term of the licence in in the file licence.txt. - * - ******************************************************************************* - */ - - -#ifndef __GUI_ABSTRACTION_H__ -#define __GUI_ABSTRACTION_H__ - -#include -#include - -namespace guiAbstraction -{ - void Init(int32_t argc, char *argv[]); - void Run(void); - void Stop(void); - void UnInit(void); - void SetDisplayOnWindows(ewol::Windows * newOne); - void ChangeSize(int32_t w, int32_t h); - void ChangePos(int32_t x, int32_t y); - void GetAbsPos(int32_t & x, int32_t & y); - void StartResizeSystem(void); - void StartMoveSystem(void); - bool IsPressedInput(int32_t inputID); -}; - - - -#endif diff --git a/Sources/demo.cpp b/Sources/demo.cpp index e71985c2..ec06a2e7 100644 --- a/Sources/demo.cpp +++ b/Sources/demo.cpp @@ -41,32 +41,7 @@ void glOrtho(GLfloat left, GLfloat bottom, GLfloat top, GLfloat nearVal, - GLfloat farVal) -{ - GLfloat myMatrix[4*4]; - int iii; - for(iii=0; iii<4*4 ; iii++) { - myMatrix[iii] = 0; - } - myMatrix[0] = 2.0 / (right - left); - myMatrix[5] = 2.0 / (top - bottom); - myMatrix[10] = -2.0 / (farVal - nearVal); -#if 1 - myMatrix[3] = -1*(right + left) / (right - left); - myMatrix[7] = -1*(top + bottom) / (top - bottom); - myMatrix[11] = -1*(farVal + nearVal) / (farVal - nearVal); -#else - // test if matrix is not corectly instanciate ... - myMatrix[12] = -1*(right + left) / (right - left); - myMatrix[13] = -1*(top + bottom) / (top - bottom); - myMatrix[14] = -1*(farVal + nearVal) / (farVal - nearVal); -#endif - myMatrix[15] = 1; - - glLoadMatrixf(myMatrix); - - -} + GLfloat farVal); diff --git a/Sources/etk/Stream.h b/Sources/etk/Stream.h index d1d76d0d..1c9e665a 100644 --- a/Sources/etk/Stream.h +++ b/Sources/etk/Stream.h @@ -29,6 +29,14 @@ #include #include +#if defined(__PLATFORM__Android) +# include +# include +# define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "====> EWOL", __VA_ARGS__)) +# define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "====> EWOL", __VA_ARGS__)) +# define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "====> EWOL", __VA_ARGS__)) +#endif + namespace etk{ class CEndl{}; class CHex{}; @@ -36,12 +44,75 @@ namespace etk{ private: bool hex; public: +#if defined(__PLATFORM__Android) + private: + char m_tmpChar[2048]; + public: + CCout(){ + hex=false; + memset(m_tmpChar, 0, 2048*sizeof(char)); + }; + ~CCout() { }; + CCout& operator << (int t) { + char tmp[256]; + sprintf(tmp,"%d", t); + strcat(m_tmpChar, tmp); + return *this; + } + CCout& operator << (unsigned int t) { + char tmp[256]; + sprintf(tmp, "%d", t); + strcat(m_tmpChar, tmp); + return *this; + } + CCout& operator << (long t) { + char tmp[256]; + sprintf(tmp, "%ld", t); + strcat(m_tmpChar, tmp); + return *this; + } + CCout& operator << (double t) { + char tmp[256]; + sprintf(tmp, "%f", t); + strcat(m_tmpChar, tmp); + return *this; + } + CCout& operator << (float t) { + char tmp[256]; + sprintf(tmp, "%f", t); + strcat(m_tmpChar, tmp); + return *this; + } + CCout& operator << (char * t) { + char tmp[256]; + sprintf(tmp, "%s", t); + strcat(m_tmpChar, tmp); + return *this; + } + CCout& operator << (const char * t) { + char tmp[256]; + sprintf(tmp, "%s", t); + strcat(m_tmpChar, tmp); + return *this; + } + CCout& operator << (char t) { + char tmp[256]; + sprintf(tmp, "%c", t); + strcat(m_tmpChar, tmp); + return *this; + } + CCout& operator << (etk::CEndl t) { + strcat(m_tmpChar, "\n"); + LOGI("%s", m_tmpChar); + memset(m_tmpChar, 0, 2048*sizeof(char)); + return *this; + } +#else CCout(){ hex=false; }; ~CCout() { }; - CCout& operator << (int t) { printf("%d", t); return *this; @@ -78,6 +149,7 @@ namespace etk{ printf("\n"); return *this; } +#endif }; extern etk::CCout cout; extern etk::CEndl endl; diff --git a/Sources/ewol/OObject/2DText.cpp b/Sources/ewol/OObject/2DText.cpp index a31c9b86..7a92298e 100644 --- a/Sources/ewol/OObject/2DText.cpp +++ b/Sources/ewol/OObject/2DText.cpp @@ -58,7 +58,8 @@ ewol::OObject2DText::~OObject2DText(void) void ewol::OObject2DText::Draw(void) { if (m_coord.Size()<=0) { - EWOL_WARNING("Nothink to draw..."); + // TODO : a remètre ... + //EWOL_WARNING("Nothink to draw..."); return; } // TODO : Android does not support GL_QUADS ... diff --git a/Sources/ewol/Widget.cpp b/Sources/ewol/Widget.cpp index e3d3790a..70ed39b1 100644 --- a/Sources/ewol/Widget.cpp +++ b/Sources/ewol/Widget.cpp @@ -68,6 +68,7 @@ bool ewol::Widget::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) bool ewol::Widget::GenEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y) { bool ended = false; + EWOL_WARNING("Input event : " << IdInput << " pos(" << x << "," << y << ")"); for(int32_t iii=m_inputEvent.Size()-1; iii>=0; iii--) { if (EWOL_EVENT_AREA == m_inputEvent[iii].mode) { if( m_inputEvent[iii].area.origin.x <= x diff --git a/Sources/ewol/Windows.cpp b/Sources/ewol/Windows.cpp index 1eabb8c6..fb274833 100644 --- a/Sources/ewol/Windows.cpp +++ b/Sources/ewol/Windows.cpp @@ -134,6 +134,24 @@ bool ewol::Windows::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, e void ewol::Windows::SysDraw(void) { +#if defined(__PLATFORM__Android) + // set the size of the open GL system + glViewport(0,0,m_size.x,m_size.y); + + // Clear the screen with transparency ... + glClearColor(0.0,0.0,0.0, 1.0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + //glOrtho(0., width, 0., -height, 1., 20.); + glOrtho(-m_size.x/2, m_size.x/2, m_size.y/2, -m_size.y/2, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + //glTranslatef(0, -height/2, -5); + glTranslatef(-m_size.x/2, -m_size.y/2, -1.0); +#else //EWOL_DEBUG("Drow on (" << m_size.x << "," << m_size.y << ")"); // set the size of the open GL system glViewport(0,0,m_size.x,m_size.y); @@ -149,13 +167,13 @@ void ewol::Windows::SysDraw(void) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0, -m_size.y, -5); - +#endif //http://www.khronos.org/opengles/documentation/opengles1_0/html/glBlendFunc.html glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA); //glBlendFunc(GL_SRC_ALPHA, GL_SRC_COLOR); - + GenDraw(); glDisable(GL_BLEND); diff --git a/Sources/ewol/ewol.cpp b/Sources/ewol/ewol.cpp index e06fd98a..f8c672db 100644 --- a/Sources/ewol/ewol.cpp +++ b/Sources/ewol/ewol.cpp @@ -28,21 +28,7 @@ #include #include -#if defined(__PLATFORM__X11) - #include -#elif defined(__PLATFORM__DoubleBuffer) - #include -#elif defined(__PLATFORM__Android) - #include -#elif defined(__PLATFORM__AndroidTablet) - #include -#elif defined(__PLATFORM__IPhone) - #include -#elif defined(__PLATFORM__IPad) - #include -#else - #error you need to specify a platform ... -#endif +#include #undef __class__ #define __class__ "ewol" diff --git a/Sources/ewol/widget/Test.cpp b/Sources/ewol/widget/Test.cpp index 47a8600f..bf9564e1 100644 --- a/Sources/ewol/widget/Test.cpp +++ b/Sources/ewol/widget/Test.cpp @@ -137,11 +137,11 @@ void ewol::Test::OnRegenerateDisplay(void) AddOObject(tmpOObjects, "BouttonDecoration"); - tmpOObjects = new ewol::OObject2DColored; + //tmpOObjects = new ewol::OObject2DColored; - ewol::theme::Generate(0, 0, *tmpOObjects, 50, 50, m_size.x*0.75, m_size.y*0.75); + //ewol::theme::Generate(0, 0, *tmpOObjects, 50, 50, m_size.x*0.75, m_size.y*0.75); - AddOObject(tmpOObjects, "themeObject"); + //AddOObject(tmpOObjects, "themeObject"); diff --git a/jni/Android.mk b/jni/Android.mk index e81b9984..cfd6c72c 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -8,7 +8,7 @@ LOCAL_MODULE := ewolabstraction LOCAL_C_INCLUDES := $(LOCAL_PATH)/../Sources -LOCAL_CFLAGS := -D__PLATFORM__Android -Wno-write-strings +LOCAL_CFLAGS := -D__PLATFORM__Android -Wno-write-strings -DETK_DEBUG_LEVEL=3 -DEWOL_DEBUG_LEVEL=3 -DEWOL_VERSION_TAG_NAME="\"UNKNOW-debug\"" -DVERSION_BUILD_TIME="\"pasd_heure\"" #enable io stream in the STL ... #APP_STL := gnustl_static @@ -16,6 +16,7 @@ LOCAL_CFLAGS := -D__PLATFORM__Android -Wno-write-strings LOCAL_SRC_FILES := \ ../Sources/demo.cpp \ + ../Sources/Main.cpp \ ../Sources/base/guiAndroid.cpp \ ../Sources/tinyXML/tinyxml.cpp \ ../Sources/tinyXML/tinyxmlparser.cpp \