[DEV] change getting tag policy and remove choice of openGL-ES1

This commit is contained in:
Edouard DUPIN 2012-11-09 01:40:45 +01:00
parent 14f878bdd2
commit 9cf545c434
40 changed files with 591 additions and 968 deletions

4
CreateTagEwol.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo $* > Sources/libewol/tag
git tag $*

@ -1 +1 @@
Subproject commit 9ca566ed85228973d9e442ee41d14d59e494a087 Subproject commit 197525dfc6cbe138767392466ad4f450aa7b2bd6

View File

@ -214,6 +214,7 @@ namespace etk
bool FileOpenWrite(void); bool FileOpenWrite(void);
bool FileClose(void); bool FileClose(void);
char* FileGets(char * elementLine, int32_t maxData); char* FileGets(char * elementLine, int32_t maxData);
// TODO : Set the return and the size of block in 64 bits
int32_t FileRead(void * data, int32_t blockSize, int32_t nbBlock); int32_t FileRead(void * data, int32_t blockSize, int32_t nbBlock);
int32_t FileWrite(void * data, int32_t blockSize, int32_t nbBlock); int32_t FileWrite(void * data, int32_t blockSize, int32_t nbBlock);
bool FileSeek(long int offset, int origin); bool FileSeek(long int offset, int origin);

View File

@ -8,9 +8,8 @@ LOCAL_MODULE := ewol
LOCAL_CONFIG_FILES := Config.in ConfigAndroid.in LOCAL_CONFIG_FILES := Config.in ConfigAndroid.in
# get the tag of the current project : # get the tag of the current project :
LOCAL_VERSION_TAG=$(shell cd $(LOCAL_PATH) ; git describe --tags) LOCAL_VERSION=$(shell cat $(LOCAL_PATH)/tag)
LOCAL_VERSION_TAG_SHORT=$(shell cd $(LOCAL_PATH) ; git describe --tags --abbrev=0) $(info [TAG:$(LOCAL_MODULE)] $(LOCAL_VERSION))
$(info $(LOCAL_MODULE) version TAG : $(LOCAL_VERSION_TAG))
# name of the dependency # name of the dependency
LOCAL_LIBRARIES := etk freetype tinyxml libpng parsersvg lua libzip LOCAL_LIBRARIES := etk freetype tinyxml libpng parsersvg lua libzip
@ -20,14 +19,10 @@ LOCAL_C_INCLUDES :=
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_CFLAGS := -Wno-write-strings \ LOCAL_CFLAGS := -Wno-write-strings \
-DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\"" \ -DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG)-$(BUILD_DIRECTORY_MODE)\"" \
-DDATA_IN_APK -DDATA_IN_APK
ifeq ("$(CONFIG___VIDEO__OPENGL_ES_2)","y")
LOCAL_EXPORT_LDLIBS := -lGLESv2 LOCAL_EXPORT_LDLIBS := -lGLESv2
else
LOCAL_EXPORT_LDLIBS := -lGLESv1_CM
endif
LOCAL_EXPORT_LDLIBS += -ldl -llog LOCAL_EXPORT_LDLIBS += -ldl -llog

View File

@ -1,17 +1,4 @@
menu "General" menu "General"
choice
prompt "OpenGl mode"
default __VIDEO__OPENGL_ES_1
help
OpenGL mode possible :
0 : openGL basic mode, vertex buffer.
1 : OpenGl 2 ==> no vertex bufffer but enable Shader system
config __VIDEO__OPENGL_ES_1
bool "0: openGl ES 1.0"
config __VIDEO__OPENGL_ES_2
bool "1: openGl ES 2.0"
endchoice
config __EWOL_APPL_BASIC_TITLE__ config __EWOL_APPL_BASIC_TITLE__
prompt "Application Title" prompt "Application Title"
string string

View File

@ -8,9 +8,8 @@ LOCAL_MODULE := ewol
LOCAL_CONFIG_FILES := Config.in LOCAL_CONFIG_FILES := Config.in
# get the tag of the current project : # get the tag of the current project :
LOCAL_VERSION_TAG=$(shell cd $(LOCAL_PATH) ; git describe --tags) LOCAL_VERSION=$(shell cat $(LOCAL_PATH)/tag)
LOCAL_VERSION_TAG_SHORT=$(shell cd $(LOCAL_PATH) ; git describe --tags --abbrev=0) $(info [TAG:$(LOCAL_MODULE)] $(LOCAL_VERSION))
$(info $(LOCAL_MODULE) version TAG : $(LOCAL_VERSION_TAG))
# name of the dependency # name of the dependency
LOCAL_LIBRARIES := etk freetype tinyxml libzip libpng parsersvg lua portaudio LOCAL_LIBRARIES := etk freetype tinyxml libzip libpng parsersvg lua portaudio
@ -25,14 +24,10 @@ LOCAL_EXPORT_LDLIBS := -lGL -lX11
LOCAL_CFLAGS := -Wno-write-strings \ LOCAL_CFLAGS := -Wno-write-strings \
-DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\"" \ -DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG)-$(BUILD_DIRECTORY_MODE)\"" \
-Wall -Wall
#ifneq ("$(CONFIG__VIDEO__OPENGL_ES_2)","") LOCAL_EXPORT_CFLAGS :=
LOCAL_CFLAGS += -D__VIDEO__OPENGL_ES_2
LOCAL_EXPORT_CFLAGS := -D__VIDEO__OPENGL_ES_2
$(info Compilation For openGL-ES-v2 compatibility)
#endif
# load the common sources file of the platform # load the common sources file of the platform
include $(LOCAL_PATH)/file.mk include $(LOCAL_PATH)/file.mk

View File

@ -8,9 +8,8 @@ LOCAL_MODULE := ewol
LOCAL_CONFIG_FILES := Config.in LOCAL_CONFIG_FILES := Config.in
# get the tag of the current project : # get the tag of the current project :
LOCAL_VERSION_TAG=$(shell cd $(LOCAL_PATH) ; git describe --tags) LOCAL_VERSION=$(shell cat $(LOCAL_PATH)/tag)
LOCAL_VERSION_TAG_SHORT=$(shell cd $(LOCAL_PATH) ; git describe --tags --abbrev=0) $(info [TAG:$(LOCAL_MODULE)] $(LOCAL_VERSION))
$(info $(LOCAL_MODULE) version TAG : $(LOCAL_VERSION_TAG))
# name of the dependency # name of the dependency
LOCAL_LIBRARIES := etk freetype tinyxml libzip libpng parsersvg lua zlib glew LOCAL_LIBRARIES := etk freetype tinyxml libzip libpng parsersvg lua zlib glew
@ -21,7 +20,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_LDLIBS := LOCAL_EXPORT_LDLIBS :=
LOCAL_CFLAGS := -Wno-write-strings \ LOCAL_CFLAGS := -Wno-write-strings \
-DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\"" \ -DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG)-$(BUILD_DIRECTORY_MODE)\"" \
-Wall -Wall
# load the common sources file of the platform # load the common sources file of the platform

View File

@ -32,18 +32,16 @@ ewol::Mesh::Mesh(etk::UString genName) :
ewol::Resource(genName), ewol::Resource(genName),
m_texture1(NULL) m_texture1(NULL)
{ {
#ifdef __VIDEO__OPENGL_ES_2 etk::UString tmpString("textured3D.prog");
etk::UString tmpString("textured3D.prog"); // get the shader resource :
// get the shader resource : m_GLPosition = 0;
m_GLPosition = 0; if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) {
if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord3d");
m_GLPosition = m_GLprogram->GetAttribute("EW_coord3d"); m_GLColor = m_GLprogram->GetAttribute("EW_color");
m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d");
m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation");
m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); m_GLtexID = m_GLprogram->GetUniform("EW_texID");
m_GLtexID = m_GLprogram->GetUniform("EW_texID"); }
}
#endif
} }
ewol::Mesh::~Mesh(void) ewol::Mesh::~Mesh(void)
@ -52,9 +50,7 @@ ewol::Mesh::~Mesh(void)
if(NULL!=m_texture1) { if(NULL!=m_texture1) {
ewol::resource::Release(m_texture1); ewol::resource::Release(m_texture1);
} }
#ifdef __VIDEO__OPENGL_ES_2 ewol::resource::Release(m_GLprogram);
ewol::resource::Release(m_GLprogram);
#endif
} }
@ -73,51 +69,31 @@ void ewol::Mesh::Draw(void)
EWOL_WARNING("Texture does not exist ..."); EWOL_WARNING("Texture does not exist ...");
return; return;
} }
#ifdef __VIDEO__OPENGL_ES_2 if (m_GLprogram==NULL) {
if (m_GLprogram==NULL) { EWOL_ERROR("No shader ...");
EWOL_ERROR("No shader ..."); return;
return; }
} //EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" ); m_GLprogram->Use();
m_GLprogram->Use(); // set Matrix : translation/positionMatrix
// set Matrix : translation/positionMatrix etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix();
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix(); tmpMatrix = etk::matrix::Scale(100,100,100)
tmpMatrix = etk::matrix::Scale(100,100,100) * etk::matrix::rotate(1,0,0,rotx)
* etk::matrix::rotate(1,0,0,rotx) * etk::matrix::rotate(0,1,0,roty)/*
* etk::matrix::rotate(0,1,0,roty)/* * etk::matrix::Translate(0.01,0,0)
* etk::matrix::Translate(0.01,0,0) * etk::matrix::rotate(0,0,1,rotz)*/
* etk::matrix::rotate(0,0,1,rotz)*/ * tmpMatrix;
* tmpMatrix; m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // TextureID
// TextureID m_GLprogram->SetTexture0(m_GLtexID, m_texture1->GetId());
m_GLprogram->SetTexture0(m_GLtexID, m_texture1->GetId()); // position :
// position : m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z*/, &m_vertices[0]);
m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z*/, &m_vertices[0]); // Texture :
// Texture : m_GLprogram->SendAttribute(m_GLtexture, 2/*u,v*/, &m_uvTextures[0]);
m_GLprogram->SendAttribute(m_GLtexture, 2/*u,v*/, &m_uvTextures[0]); // color :
// color : m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]);
m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]); // Request the draw od the elements :
// Request the draw od the elements : glDrawArrays(GL_TRIANGLES, 0, m_vertices.Size());
glDrawArrays(GL_TRIANGLES, 0, m_vertices.Size()); m_GLprogram->UnUse();
m_GLprogram->UnUse();
#else
/*
glColor4f(1.0, 1.0, 1.0, 1.0);
glEnable(GL_TEXTURE_2D);
//EWOL_WARNING("Draw with texture : " << m_textureId << " ==> ogl=" << ewol::texture::GetGLID(m_textureId));
glBindTexture(GL_TEXTURE_2D, m_resource->GetId() );
glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays
glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays
glEnableClientState( GL_COLOR_ARRAY ); // Enable Color Arrays
glVertexPointer( 3, GL_FLOAT, 0, &m_coord[0] );
glTexCoordPointer( 2, GL_FLOAT, 0, &m_coordTex[0] );
glColorPointer( 4, GL_UNSIGNED_BYTE, 0, &m_coordColor[0] );
glDrawArrays( GL_TRIANGLES, 0, m_coord.Size());
//EWOL_DEBUG("request draw of " << m_coord.Size() << " elements");
glDisableClientState( GL_COLOR_ARRAY ); // Disable Color Arrays
glDisableClientState( GL_VERTEX_ARRAY ); // Disable Vertex Arrays
glDisableClientState( GL_TEXTURE_COORD_ARRAY ); // Disable Texture Coord Arrays
glDisable(GL_TEXTURE_2D);
*/
#endif
} }

View File

@ -36,24 +36,18 @@ namespace ewol
class Mesh : public ewol::Resource class Mesh : public ewol::Resource
{ {
protected: protected:
#ifdef __VIDEO__OPENGL_ES_2 ewol::Program* m_GLprogram;
ewol::Program* m_GLprogram; int32_t m_GLPosition;
int32_t m_GLPosition; int32_t m_GLMatrix;
int32_t m_GLMatrix; int32_t m_GLColor;
int32_t m_GLColor; int32_t m_GLtexture;
int32_t m_GLtexture; int32_t m_GLtexID;
int32_t m_GLtexID;
#endif
etk::Vector<uint32_t> m_indices; etk::Vector<uint32_t> m_indices;
etk::Vector< etk::Vector3D<float> > m_vertices; etk::Vector< etk::Vector3D<float> > m_vertices;
etk::Vector< etk::Vector2D<float> > m_uvTextures; etk::Vector< etk::Vector2D<float> > m_uvTextures;
etk::Vector< etk::Vector3D<float> > m_normals; etk::Vector< etk::Vector3D<float> > m_normals;
ewol::TextureFile* m_texture1; ewol::TextureFile* m_texture1;
#ifdef __VIDEO__OPENGL_ES_2 etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
#else
etk::Vector<draw::Color> m_coordColor; //!< internal color of the different point
#endif
public: public:
Mesh(etk::UString genName); Mesh(etk::UString genName);
virtual ~Mesh(void); virtual ~Mesh(void);

View File

@ -237,62 +237,56 @@ bool ewol::resource::Keep(etk::UString& filename, ewol::Font*& object)
return true; return true;
} }
#ifdef __VIDEO__OPENGL_ES_2 bool ewol::resource::Keep(etk::UString& filename, ewol::Program*& object)
bool ewol::resource::Keep(etk::UString& filename, ewol::Program*& object) {
{ EWOL_VERBOSE("KEEP : Program : file : \"" << filename << "\"");
EWOL_VERBOSE("KEEP : Program : file : \"" << filename << "\""); object = static_cast<ewol::Program*>(LocalKeep(filename));
object = static_cast<ewol::Program*>(LocalKeep(filename)); if (NULL != object) {
if (NULL != object) {
return true;
}
// need to crate a new one ...
object = new ewol::Program(filename);
if (NULL == object) {
EWOL_ERROR("allocation error of a resource : " << filename);
return false;
}
LocalAdd(object);
return true; return true;
} }
#endif // need to crate a new one ...
object = new ewol::Program(filename);
if (NULL == object) {
EWOL_ERROR("allocation error of a resource : " << filename);
return false;
}
LocalAdd(object);
return true;
}
#ifdef __VIDEO__OPENGL_ES_2 bool ewol::resource::Keep(etk::UString& filename, ewol::Shader*& object)
bool ewol::resource::Keep(etk::UString& filename, ewol::Shader*& object) {
{ EWOL_VERBOSE("KEEP : Shader : file : \"" << filename << "\"");
EWOL_VERBOSE("KEEP : Shader : file : \"" << filename << "\""); object = static_cast<ewol::Shader*>(LocalKeep(filename));
object = static_cast<ewol::Shader*>(LocalKeep(filename)); if (NULL != object) {
if (NULL != object) {
return true;
}
// need to crate a new one ...
object = new ewol::Shader(filename);
if (NULL == object) {
EWOL_ERROR("allocation error of a resource : " << filename);
return false;
}
LocalAdd(object);
return true; return true;
} }
#endif // need to crate a new one ...
object = new ewol::Shader(filename);
if (NULL == object) {
EWOL_ERROR("allocation error of a resource : " << filename);
return false;
}
LocalAdd(object);
return true;
}
#ifdef __VIDEO__OPENGL_ES_2 bool ewol::resource::Keep(etk::UString& filename, ewol::DistantFieldFont*& object)
bool ewol::resource::Keep(etk::UString& filename, ewol::DistantFieldFont*& object) {
{ EWOL_VERBOSE("KEEP : DistanceFieldFont : file : \"" << filename << "\"");
EWOL_VERBOSE("KEEP : DistanceFieldFont : file : \"" << filename << "\""); object = static_cast<ewol::DistantFieldFont*>(LocalKeep(filename));
object = static_cast<ewol::DistantFieldFont*>(LocalKeep(filename)); if (NULL != object) {
if (NULL != object) {
return true;
}
// need to crate a new one ...
object = new ewol::DistantFieldFont(filename);
if (NULL == object) {
EWOL_ERROR("allocation error of a resource : " << filename);
return false;
}
LocalAdd(object);
return true; return true;
} }
#endif // need to crate a new one ...
object = new ewol::DistantFieldFont(filename);
if (NULL == object) {
EWOL_ERROR("allocation error of a resource : " << filename);
return false;
}
LocalAdd(object);
return true;
}
bool ewol::resource::Keep(ewol::Texture*& object) bool ewol::resource::Keep(ewol::Texture*& object)
{ {
@ -439,30 +433,24 @@ void ewol::resource::Release(ewol::Font*& object)
Release(object2); Release(object2);
object = NULL; object = NULL;
} }
#ifdef __VIDEO__OPENGL_ES_2 void ewol::resource::Release(ewol::Program*& object)
void ewol::resource::Release(ewol::Program*& object) {
{ ewol::Resource* object2 = static_cast<ewol::Resource*>(object);
ewol::Resource* object2 = static_cast<ewol::Resource*>(object); Release(object2);
Release(object2); object = NULL;
object = NULL; }
} void ewol::resource::Release(ewol::Shader*& object)
#endif {
#ifdef __VIDEO__OPENGL_ES_2 ewol::Resource* object2 = static_cast<ewol::Resource*>(object);
void ewol::resource::Release(ewol::Shader*& object) Release(object2);
{ object = NULL;
ewol::Resource* object2 = static_cast<ewol::Resource*>(object); }
Release(object2); void ewol::resource::Release(ewol::DistantFieldFont*& object)
object = NULL; {
} ewol::Resource* object2 = static_cast<ewol::Resource*>(object);
#endif Release(object2);
#ifdef __VIDEO__OPENGL_ES_2 object = NULL;
void ewol::resource::Release(ewol::DistantFieldFont*& object) }
{
ewol::Resource* object2 = static_cast<ewol::Resource*>(object);
Release(object2);
object = NULL;
}
#endif
void ewol::resource::Release(ewol::Texture*& object) void ewol::resource::Release(ewol::Texture*& object)
{ {
ewol::Resource* object2 = static_cast<ewol::Resource*>(object); ewol::Resource* object2 = static_cast<ewol::Resource*>(object);

View File

@ -57,11 +57,9 @@ namespace ewol
// return the type of the resource ... // return the type of the resource ...
bool Keep(etk::UString& filename, ewol::TexturedFont*& object); bool Keep(etk::UString& filename, ewol::TexturedFont*& object);
bool Keep(etk::UString& filename, ewol::Font*& object); bool Keep(etk::UString& filename, ewol::Font*& object);
#ifdef __VIDEO__OPENGL_ES_2 bool Keep(etk::UString& filename, ewol::Program*& object);
bool Keep(etk::UString& filename, ewol::Program*& object); bool Keep(etk::UString& filename, ewol::Shader*& object);
bool Keep(etk::UString& filename, ewol::Shader*& object); bool Keep(etk::UString& filename, ewol::DistantFieldFont*& object);
bool Keep(etk::UString& filename, ewol::DistantFieldFont*& object);
#endif
bool Keep(ewol::Texture*& object); // no name needed here ... bool Keep(ewol::Texture*& object); // no name needed here ...
bool Keep(etk::UString& filename, ewol::TextureFile*& object, etk::Vector2D<int32_t> size); bool Keep(etk::UString& filename, ewol::TextureFile*& object, etk::Vector2D<int32_t> size);
bool Keep(etk::UString& accesMode, ewol::VirtualBufferObject*& object); bool Keep(etk::UString& accesMode, ewol::VirtualBufferObject*& object);
@ -71,11 +69,9 @@ namespace ewol
void Release(ewol::Resource*& object); void Release(ewol::Resource*& object);
void Release(ewol::TexturedFont*& object); void Release(ewol::TexturedFont*& object);
void Release(ewol::Font*& object); void Release(ewol::Font*& object);
#ifdef __VIDEO__OPENGL_ES_2 void Release(ewol::Program*& object);
void Release(ewol::Program*& object); void Release(ewol::Shader*& object);
void Release(ewol::Shader*& object); void Release(ewol::DistantFieldFont*& object);
void Release(ewol::DistantFieldFont*& object);
#endif
void Release(ewol::Texture*& object); void Release(ewol::Texture*& object);
void Release(ewol::TextureFile*& object); void Release(ewol::TextureFile*& object);
void Release(ewol::VirtualBufferObject*& object); void Release(ewol::VirtualBufferObject*& object);

View File

@ -35,16 +35,14 @@ ewol::OObject2DColored::OObject2DColored(void)
{ {
m_triElement = 0; m_triElement = 0;
SetColor(1.0, 1.0, 1.0, 1.0); SetColor(1.0, 1.0, 1.0, 1.0);
#ifdef __VIDEO__OPENGL_ES_2 etk::UString tmpString("DATA:color.prog");
etk::UString tmpString("DATA:color.prog"); // get the shader resource :
// get the shader resource : m_GLPosition = 0;
m_GLPosition = 0; if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) {
if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d");
m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d"); m_GLColor = m_GLprogram->GetAttribute("EW_color");
m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation");
m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); }
}
#endif
} }
@ -52,9 +50,7 @@ ewol::OObject2DColored::~OObject2DColored(void)
{ {
m_coord.Clear(); m_coord.Clear();
m_coordColor.Clear(); m_coordColor.Clear();
#ifdef __VIDEO__OPENGL_ES_2 ewol::resource::Release(m_GLprogram);
ewol::resource::Release(m_GLprogram);
#endif
} }
@ -63,44 +59,22 @@ void ewol::OObject2DColored::Draw(void)
if (m_coord.Size()<=0) { if (m_coord.Size()<=0) {
return; return;
} }
#ifdef __VIDEO__OPENGL_ES_2 if (m_GLprogram==NULL) {
if (m_GLprogram==NULL) { EWOL_ERROR("No shader ...");
EWOL_ERROR("No shader ..."); return;
return; }
} //glScalef(m_scaling.x, m_scaling.y, 1.0);
//glScalef(m_scaling.x, m_scaling.y, 1.0); m_GLprogram->Use();
m_GLprogram->Use(); // set Matrix : translation/positionMatrix
// set Matrix : translation/positionMatrix etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix();
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix(); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // position :
// position : m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, &m_coord[0]);
m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, &m_coord[0]); // color :
// color : m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]);
m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]); // Request the draw of the elements :
// Request the draw of the elements : glDrawArrays(GL_TRIANGLES, 0, m_coord.Size());
glDrawArrays(GL_TRIANGLES, 0, m_coord.Size()); m_GLprogram->UnUse();
m_GLprogram->UnUse();
#else
glPushMatrix();
// Enable Pointers
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_COLOR_ARRAY );
glScalef(m_scaling.x, m_scaling.y, 1.0);
// Set the vertex pointer to our vertex data
glVertexPointer(2, GL_FLOAT, 0, &m_coord[0] );
glColorPointer(4, GL_UNSIGNED_BYTE, 0, &m_coordColor[0] );
// Render : draw all of the triangles at once
glDrawArrays( GL_TRIANGLES, 0, m_coord.Size());
//glDrawElements( GL_TRIANGLES, 0, m_coord.Size());
//EWOL_DEBUG("Draw ..." << m_coord.Size()/3 << " triangle(s)");
// Disable Pointers
glDisableClientState( GL_COLOR_ARRAY );
glDisableClientState( GL_VERTEX_ARRAY );
glPopMatrix();
#endif
} }
void ewol::OObject2DColored::Clear(void) void ewol::OObject2DColored::Clear(void)

View File

@ -37,22 +37,15 @@ namespace ewol {
public: public:
virtual void Draw(void); virtual void Draw(void);
protected: protected:
#ifdef __VIDEO__OPENGL_ES_2 ewol::Program* m_GLprogram;
ewol::Program* m_GLprogram; int32_t m_GLPosition;
int32_t m_GLPosition; int32_t m_GLMatrix;
int32_t m_GLMatrix; int32_t m_GLColor;
int32_t m_GLColor; etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object
#endif etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object draw::Colorf m_color[3];
#ifdef __VIDEO__OPENGL_ES_2 int32_t m_triElement;
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point etk::Vector2D<float> m_triangle[3];
draw::Colorf m_color[3];
#else
etk::Vector<draw::Color> m_coordColor; //!< internal color of the different point
draw::Color m_color[3];
#endif
int32_t m_triElement;
etk::Vector2D<float> m_triangle[3];
void GenerateTriangle(void); void GenerateTriangle(void);
void ResetCount(void); void ResetCount(void);
public: public:

View File

@ -72,18 +72,16 @@ ewol::OObject2DTextColored::OObject2DTextColored(etk::UString fontName, int32_t
{ {
m_color = draw::color::black; m_color = draw::color::black;
SetFontProperty(fontName, size); SetFontProperty(fontName, size);
#ifdef __VIDEO__OPENGL_ES_2 etk::UString tmpString("DATA:textured.prog");
etk::UString tmpString("DATA:textured.prog"); // get the shader resource :
// get the shader resource : m_GLPosition = 0;
m_GLPosition = 0; if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) {
if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d");
m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d"); m_GLColor = m_GLprogram->GetAttribute("EW_color");
m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d");
m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation");
m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); m_GLtexID = m_GLprogram->GetUniform("EW_texID");
m_GLtexID = m_GLprogram->GetUniform("EW_texID"); }
}
#endif
} }
@ -94,17 +92,15 @@ ewol::OObject2DTextColored::OObject2DTextColored(void) :
m_color = draw::color::black; m_color = draw::color::black;
SetFontProperty(ewol::font::GetDefaultFont(), ewol::font::GetDefaultSize()); SetFontProperty(ewol::font::GetDefaultFont(), ewol::font::GetDefaultSize());
etk::UString tmpString("DATA:textured.prog"); etk::UString tmpString("DATA:textured.prog");
#ifdef __VIDEO__OPENGL_ES_2 // get the shader resource :
// get the shader resource : m_GLPosition = 0;
m_GLPosition = 0; if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) {
if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d");
m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d"); m_GLColor = m_GLprogram->GetAttribute("EW_color");
m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d");
m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation");
m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); m_GLtexID = m_GLprogram->GetUniform("EW_texID");
m_GLtexID = m_GLprogram->GetUniform("EW_texID"); }
}
#endif
} }
@ -114,9 +110,7 @@ ewol::OObject2DTextColored::~OObject2DTextColored(void)
ewol::resource::Release(m_font); ewol::resource::Release(m_font);
m_font = NULL; m_font = NULL;
} }
#ifdef __VIDEO__OPENGL_ES_2 ewol::resource::Release(m_GLprogram);
ewol::resource::Release(m_GLprogram);
#endif
} }
void ewol::OObject2DTextColored::Draw(void) void ewol::OObject2DTextColored::Draw(void)
@ -130,42 +124,25 @@ void ewol::OObject2DTextColored::Draw(void)
EWOL_WARNING("no font..."); EWOL_WARNING("no font...");
return; return;
} }
#ifdef __VIDEO__OPENGL_ES_2 if (m_GLprogram==NULL) {
if (m_GLprogram==NULL) { EWOL_ERROR("No shader ...");
EWOL_ERROR("No shader ..."); return;
return; }
} m_GLprogram->Use();
m_GLprogram->Use(); // set Matrix : translation/positionMatrix
// set Matrix : translation/positionMatrix etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix();
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix(); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // TextureID
// TextureID m_GLprogram->SetTexture0(m_GLtexID, m_font->GetId());
m_GLprogram->SetTexture0(m_GLtexID, m_font->GetId()); // position :
// position : m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, &m_coord[0]);
m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, &m_coord[0]); // Texture :
// Texture : m_GLprogram->SendAttribute(m_GLtexture, 2/*u,v*/, &m_coordTex[0]);
m_GLprogram->SendAttribute(m_GLtexture, 2/*u,v*/, &m_coordTex[0]); // color :
// color : m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]);
m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]); // Request the draw od the elements :
// Request the draw od the elements : glDrawArrays(GL_TRIANGLES, 0, m_coord.Size());
glDrawArrays(GL_TRIANGLES, 0, m_coord.Size()); m_GLprogram->UnUse();
m_GLprogram->UnUse();
#else
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, m_font->GetId());
glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays
glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays
glEnableClientState( GL_COLOR_ARRAY ); // Enable Color Arrays
glVertexPointer( 2, GL_FLOAT, 0, &m_coord[0] );
glTexCoordPointer( 2, GL_FLOAT, 0, &m_coordTex[0] );
glColorPointer( 4, GL_UNSIGNED_BYTE, 0, &m_coordColor[0] );
glDrawArrays( GL_TRIANGLES, 0, m_coord.Size());
//EWOL_DEBUG("request draw of " << m_coord.Size() << " elements");
glDisableClientState( GL_COLOR_ARRAY ); // Disable Color Arrays
glDisableClientState( GL_VERTEX_ARRAY ); // Disable Vertex Arrays
glDisableClientState( GL_TEXTURE_COORD_ARRAY ); // Disable Texture Coord Arrays
glDisable(GL_TEXTURE_2D);
#endif
} }
void ewol::OObject2DTextColored::Clear(void) void ewol::OObject2DTextColored::Clear(void)

View File

@ -45,23 +45,17 @@ namespace ewol {
int32_t Text(etk::Vector2D<float> textPos, const etk::UString& unicodeString); int32_t Text(etk::Vector2D<float> textPos, const etk::UString& unicodeString);
int32_t Text(etk::Vector2D<float> textPos, const uniChar_t unicodeChar); int32_t Text(etk::Vector2D<float> textPos, const uniChar_t unicodeChar);
protected: protected:
#ifdef __VIDEO__OPENGL_ES_2 ewol::Program* m_GLprogram;
ewol::Program* m_GLprogram; int32_t m_GLPosition;
int32_t m_GLPosition; int32_t m_GLMatrix;
int32_t m_GLMatrix; int32_t m_GLColor;
int32_t m_GLColor; int32_t m_GLtexture;
int32_t m_GLtexture; int32_t m_GLtexID;
int32_t m_GLtexID; ewol::TexturedFont* m_font; //!< ewol font system
#endif draw::Color m_color; //!< tmp text color ...
ewol::TexturedFont* m_font; //!< ewol font system
draw::Color m_color; //!< tmp text color ...
etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object
etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
#ifdef __VIDEO__OPENGL_ES_2 etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
#else
etk::Vector<draw::Color> m_coordColor; //!< internal color of the different point
#endif
public: public:
void SetFont(etk::UString fontName); void SetFont(etk::UString fontName);
void SetSize(int32_t fontSize); void SetSize(int32_t fontSize);

View File

@ -21,7 +21,6 @@
* *
******************************************************************************* *******************************************************************************
*/ */
#ifdef __VIDEO__OPENGL_ES_2
#include <ewol/oObject/2DTextShader.h> #include <ewol/oObject/2DTextShader.h>
#include <ewol/openGL/openGL.h> #include <ewol/openGL/openGL.h>
@ -238,4 +237,3 @@ etk::Vector2D<float> ewol::OObject2DTextShader::GetSize(const etk::UString& unic
return m_font->GetSize(unicodeString); return m_font->GetSize(unicodeString);
} }
#endif

View File

@ -25,8 +25,6 @@
#ifndef __EWOL_O_OBJECT_2D_TEXT_SHADER_H__ #ifndef __EWOL_O_OBJECT_2D_TEXT_SHADER_H__
#define __EWOL_O_OBJECT_2D_TEXT_SHADER_H__ #define __EWOL_O_OBJECT_2D_TEXT_SHADER_H__
#ifdef __VIDEO__OPENGL_ES_2
#include <ewol/oObject/OObject.h> #include <ewol/oObject/OObject.h>
#include <ewol/font/DistantFieldFont.h> #include <ewol/font/DistantFieldFont.h>
#include <ewol/ResourceManager.h> #include <ewol/ResourceManager.h>
@ -76,5 +74,3 @@ namespace ewol {
}; };
#endif #endif
#endif

View File

@ -38,18 +38,16 @@ ewol::OObject2DTextured::OObject2DTextured(etk::UString textureName, float sizeX
EWOL_CRITICAL("can not get a resource Texture"); EWOL_CRITICAL("can not get a resource Texture");
} }
m_resource = resourceFile; m_resource = resourceFile;
#ifdef __VIDEO__OPENGL_ES_2 etk::UString tmpString("DATA:textured.prog");
etk::UString tmpString("DATA:textured.prog"); // get the shader resource :
// get the shader resource : m_GLPosition = 0;
m_GLPosition = 0; if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) {
if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d");
m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d"); m_GLColor = m_GLprogram->GetAttribute("EW_color");
m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d");
m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation");
m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); m_GLtexID = m_GLprogram->GetUniform("EW_texID");
m_GLtexID = m_GLprogram->GetUniform("EW_texID"); }
}
#endif
} }
ewol::OObject2DTextured::OObject2DTextured( float sizeX, float sizeY) ewol::OObject2DTextured::OObject2DTextured( float sizeX, float sizeY)
@ -64,18 +62,16 @@ ewol::OObject2DTextured::OObject2DTextured( float sizeX, float sizeY)
tmpImage.Clear(); tmpImage.Clear();
m_resource->Flush(); m_resource->Flush();
} }
#ifdef __VIDEO__OPENGL_ES_2 etk::UString tmpString("DATA:textured.prog");
etk::UString tmpString("DATA:textured.prog"); // get the shader resource :
// get the shader resource : m_GLPosition = 0;
m_GLPosition = 0; if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) {
if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d");
m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d"); m_GLColor = m_GLprogram->GetAttribute("EW_color");
m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d");
m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation");
m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); m_GLtexID = m_GLprogram->GetUniform("EW_texID");
m_GLtexID = m_GLprogram->GetUniform("EW_texID"); }
}
#endif
} }
@ -84,9 +80,7 @@ ewol::OObject2DTextured::~OObject2DTextured(void)
if (NULL != m_resource) { if (NULL != m_resource) {
ewol::resource::Release(m_resource); ewol::resource::Release(m_resource);
} }
#ifdef __VIDEO__OPENGL_ES_2 ewol::resource::Release(m_GLprogram);
ewol::resource::Release(m_GLprogram);
#endif
} }
void ewol::OObject2DTextured::Draw(void) void ewol::OObject2DTextured::Draw(void)
@ -98,44 +92,25 @@ void ewol::OObject2DTextured::Draw(void)
EWOL_WARNING("Texture does not exist ..."); EWOL_WARNING("Texture does not exist ...");
return; return;
} }
#ifdef __VIDEO__OPENGL_ES_2 if (m_GLprogram==NULL) {
if (m_GLprogram==NULL) { EWOL_ERROR("No shader ...");
EWOL_ERROR("No shader ..."); return;
return; }
} m_GLprogram->Use();
m_GLprogram->Use(); // set Matrix : translation/positionMatrix
// set Matrix : translation/positionMatrix etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix();
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix(); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // TextureID
// TextureID m_GLprogram->SetTexture0(m_GLtexID, m_resource->GetId());
m_GLprogram->SetTexture0(m_GLtexID, m_resource->GetId()); // position :
// position : m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, &m_coord[0]);
m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, &m_coord[0]); // Texture :
// Texture : m_GLprogram->SendAttribute(m_GLtexture, 2/*u,v*/, &m_coordTex[0]);
m_GLprogram->SendAttribute(m_GLtexture, 2/*u,v*/, &m_coordTex[0]); // color :
// color : m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]);
m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]); // Request the draw od the elements :
// Request the draw od the elements : glDrawArrays(GL_TRIANGLES, 0, m_coord.Size());
glDrawArrays(GL_TRIANGLES, 0, m_coord.Size()); m_GLprogram->UnUse();
m_GLprogram->UnUse();
#else
glColor4f(1.0, 1.0, 1.0, 1.0);
glEnable(GL_TEXTURE_2D);
//EWOL_WARNING("Draw with texture : " << m_textureId << " ==> ogl=" << ewol::texture::GetGLID(m_textureId));
glBindTexture(GL_TEXTURE_2D, m_resource->GetId() );
glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays
glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays
glEnableClientState( GL_COLOR_ARRAY ); // Enable Color Arrays
glVertexPointer( 2, GL_FLOAT, 0, &m_coord[0] );
glTexCoordPointer( 2, GL_FLOAT, 0, &m_coordTex[0] );
glColorPointer( 4, GL_UNSIGNED_BYTE, 0, &m_coordColor[0] );
glDrawArrays( GL_TRIANGLES, 0, m_coord.Size());
//EWOL_DEBUG("request draw of " << m_coord.Size() << " elements");
glDisableClientState( GL_COLOR_ARRAY ); // Disable Color Arrays
glDisableClientState( GL_VERTEX_ARRAY ); // Disable Vertex Arrays
glDisableClientState( GL_TEXTURE_COORD_ARRAY ); // Disable Texture Coord Arrays
glDisable(GL_TEXTURE_2D);
#endif
} }
void ewol::OObject2DTextured::Clear(void) void ewol::OObject2DTextured::Clear(void)

View File

@ -41,22 +41,16 @@ namespace ewol {
void Rectangle(float x, float y, float w, float h, float texX=0.0, float texY=0.0, float texSX=1.0, float texSY=1.0, draw::Color tmpColor=draw::color::white); void Rectangle(float x, float y, float w, float h, float texX=0.0, float texY=0.0, float texSX=1.0, float texSY=1.0, draw::Color tmpColor=draw::color::white);
void Rectangle(float x, float y, float w, float h, draw::Color tmpColor); void Rectangle(float x, float y, float w, float h, draw::Color tmpColor);
protected: protected:
#ifdef __VIDEO__OPENGL_ES_2 ewol::Program* m_GLprogram;
ewol::Program* m_GLprogram; int32_t m_GLPosition;
int32_t m_GLPosition; int32_t m_GLMatrix;
int32_t m_GLMatrix; int32_t m_GLColor;
int32_t m_GLColor; int32_t m_GLtexture;
int32_t m_GLtexture; int32_t m_GLtexID;
int32_t m_GLtexID;
#endif
ewol::Texture* m_resource; //!< texture resources ewol::Texture* m_resource; //!< texture resources
etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object
etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
#ifdef __VIDEO__OPENGL_ES_2 etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
#else
etk::Vector<draw::Color> m_coordColor; //!< internal color of the different point
#endif
public: public:
draw::Image* GetImage(void) draw::Image* GetImage(void)
{ {

View File

@ -36,18 +36,16 @@ ewol::OObject3DTextured::OObject3DTextured(etk::UString textureName, float sizeX
if (false == ewol::resource::Keep(textureName, m_resource, etk::Vector2D<int32_t>(sizeX,sizeY)) ) { if (false == ewol::resource::Keep(textureName, m_resource, etk::Vector2D<int32_t>(sizeX,sizeY)) ) {
EWOL_CRITICAL("can not get a resource Texture"); EWOL_CRITICAL("can not get a resource Texture");
} }
#ifdef __VIDEO__OPENGL_ES_2 etk::UString tmpString("textured3D.prog");
etk::UString tmpString("textured3D.prog"); // get the shader resource :
// get the shader resource : m_GLPosition = 0;
m_GLPosition = 0; if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) {
if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord3d");
m_GLPosition = m_GLprogram->GetAttribute("EW_coord3d"); m_GLColor = m_GLprogram->GetAttribute("EW_color");
m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d");
m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation");
m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); m_GLtexID = m_GLprogram->GetUniform("EW_texID");
m_GLtexID = m_GLprogram->GetUniform("EW_texID"); }
}
#endif
} }
@ -56,9 +54,7 @@ ewol::OObject3DTextured::~OObject3DTextured(void)
if (NULL != m_resource) { if (NULL != m_resource) {
ewol::resource::Release(m_resource); ewol::resource::Release(m_resource);
} }
#ifdef __VIDEO__OPENGL_ES_2 ewol::resource::Release(m_GLprogram);
ewol::resource::Release(m_GLprogram);
#endif
} }
void ewol::OObject3DTextured::Draw(void) void ewol::OObject3DTextured::Draw(void)
@ -70,45 +66,26 @@ void ewol::OObject3DTextured::Draw(void)
EWOL_WARNING("Texture does not exist ..."); EWOL_WARNING("Texture does not exist ...");
return; return;
} }
#ifdef __VIDEO__OPENGL_ES_2 if (m_GLprogram==NULL) {
if (m_GLprogram==NULL) { EWOL_ERROR("No shader ...");
EWOL_ERROR("No shader ..."); return;
return; }
} //EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" ); m_GLprogram->Use();
m_GLprogram->Use(); // set Matrix : translation/positionMatrix
// set Matrix : translation/positionMatrix etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix();
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix(); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // TextureID
// TextureID m_GLprogram->SetTexture0(m_GLtexID, m_resource->GetId());
m_GLprogram->SetTexture0(m_GLtexID, m_resource->GetId()); // position :
// position : m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z*/, &m_coord[0]);
m_GLprogram->SendAttribute(m_GLPosition, 3/*x,y,z*/, &m_coord[0]); // Texture :
// Texture : m_GLprogram->SendAttribute(m_GLtexture, 2/*u,v*/, &m_coordTex[0]);
m_GLprogram->SendAttribute(m_GLtexture, 2/*u,v*/, &m_coordTex[0]); // color :
// color : m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]);
m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]); // Request the draw od the elements :
// Request the draw od the elements : glDrawArrays(GL_TRIANGLES, 0, m_coord.Size());
glDrawArrays(GL_TRIANGLES, 0, m_coord.Size()); m_GLprogram->UnUse();
m_GLprogram->UnUse();
#else
glColor4f(1.0, 1.0, 1.0, 1.0);
glEnable(GL_TEXTURE_2D);
//EWOL_WARNING("Draw with texture : " << m_textureId << " ==> ogl=" << ewol::texture::GetGLID(m_textureId));
glBindTexture(GL_TEXTURE_2D, m_resource->GetId() );
glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays
glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays
glEnableClientState( GL_COLOR_ARRAY ); // Enable Color Arrays
glVertexPointer( 3, GL_FLOAT, 0, &m_coord[0] );
glTexCoordPointer( 2, GL_FLOAT, 0, &m_coordTex[0] );
glColorPointer( 4, GL_UNSIGNED_BYTE, 0, &m_coordColor[0] );
glDrawArrays( GL_TRIANGLES, 0, m_coord.Size());
//EWOL_DEBUG("request draw of " << m_coord.Size() << " elements");
glDisableClientState( GL_COLOR_ARRAY ); // Disable Color Arrays
glDisableClientState( GL_VERTEX_ARRAY ); // Disable Vertex Arrays
glDisableClientState( GL_TEXTURE_COORD_ARRAY ); // Disable Texture Coord Arrays
glDisable(GL_TEXTURE_2D);
#endif
} }
void ewol::OObject3DTextured::Clear(void) void ewol::OObject3DTextured::Clear(void)

View File

@ -40,22 +40,16 @@ namespace ewol {
void Rectangle(float x, float y, float w, float h, float texX=0.0, float texY=0.0, float texSX=1.0, float texSY=1.0, draw::Color tmpColor=draw::color::white); void Rectangle(float x, float y, float w, float h, float texX=0.0, float texY=0.0, float texSX=1.0, float texSY=1.0, draw::Color tmpColor=draw::color::white);
void Rectangle(float x, float y, float w, float h, draw::Color tmpColor); void Rectangle(float x, float y, float w, float h, draw::Color tmpColor);
protected: protected:
#ifdef __VIDEO__OPENGL_ES_2 ewol::Program* m_GLprogram;
ewol::Program* m_GLprogram; int32_t m_GLPosition;
int32_t m_GLPosition; int32_t m_GLMatrix;
int32_t m_GLMatrix; int32_t m_GLColor;
int32_t m_GLColor; int32_t m_GLtexture;
int32_t m_GLtexture; int32_t m_GLtexID;
int32_t m_GLtexID;
#endif
ewol::TextureFile* m_resource; //!< texture resources ewol::TextureFile* m_resource; //!< texture resources
etk::Vector<etk::Vector3D<float> > m_coord; //!< internal coord of the object etk::Vector<etk::Vector3D<float> > m_coord; //!< internal coord of the object
etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
#ifdef __VIDEO__OPENGL_ES_2 etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
#else
etk::Vector<draw::Color> m_coordColor; //!< internal color of the different point
#endif
}; };
}; };

View File

@ -73,7 +73,4 @@ namespace ewol {
#include <ewol/oObject/2DTextured.h> #include <ewol/oObject/2DTextured.h>
#include <ewol/oObject/2DColored.h> #include <ewol/oObject/2DColored.h>
#include <ewol/oObject/2DTextColored.h> #include <ewol/oObject/2DTextColored.h>
#ifdef __VIDEO__OPENGL_ES_2
#include <ewol/oObject/2DTextShader.h> #include <ewol/oObject/2DTextShader.h>
#endif

View File

@ -83,11 +83,7 @@ void ewol::Sprite::Element(etk::Vector3D<float> pos, float size, float angle, dr
texD.u = 1.0; texD.u = 1.0;
texD.v = 0.0; texD.v = 0.0;
#ifdef __VIDEO__OPENGL_ES_2 draw::Colorf localColor = tmpColor;
draw::Colorf localColor = tmpColor;
#else
draw::Color localColor = tmpColor;
#endif
etk::Vector3D<float> point = pos; etk::Vector3D<float> point = pos;
float yyySin = sin(angle) * size; float yyySin = sin(angle) * size;
float xxxCos = cos(angle) * size; float xxxCos = cos(angle) * size;

View File

@ -22,7 +22,6 @@
******************************************************************************* *******************************************************************************
*/ */
#ifdef __VIDEO__OPENGL_ES_2
#include <etk/Types.h> #include <etk/Types.h>
#include <ewol/Debug.h> #include <ewol/Debug.h>
@ -645,4 +644,3 @@ void ewol::Program::UnUse(void)
} }
#endif

View File

@ -24,71 +24,70 @@
#ifndef __OPEN_GL__PROGRAM_H__ #ifndef __OPEN_GL__PROGRAM_H__
#define __OPEN_GL__PROGRAM_H__ #define __OPEN_GL__PROGRAM_H__
#ifdef __VIDEO__OPENGL_ES_2 #include <etk/Types.h>
#include <etk/Types.h> #include <ewol/Debug.h>
#include <ewol/Debug.h> #include <ewol/Resource.h>
#include <ewol/Resource.h> #include <ewol/openGL/openGL.h>
#include <ewol/openGL/openGL.h> #include <ewol/openGL/Shader.h>
#include <ewol/openGL/Shader.h>
namespace ewol
namespace ewol {
{ class progAttributeElement
class progAttributeElement {
{ public :
public : etk::UString m_name;
etk::UString m_name; GLint m_elementId;
GLint m_elementId; bool m_isAttribute;
bool m_isAttribute; bool m_isLinked;
bool m_isLinked; };
};
class Program : public ewol::Resource
{
private :
bool m_exist;
GLuint m_program;
etk::Vector<ewol::Shader*> m_shaderList;
etk::Vector<ewol::progAttributeElement> m_elementList;
bool m_hasTexture;
public:
Program(etk::UString& filename);
virtual ~Program(void);
const char* GetType(void) { return "ewol::Program"; };
int32_t GetAttribute(etk::UString tmpElement);
void SendAttribute(int32_t idElem, int32_t nbElement, void* pointer, int32_t jumpBetweenSample=0);
int32_t GetUniform(etk::UString tmpElement);
class Program : public ewol::Resource void UniformMatrix4fv(int32_t idElem, int32_t nbElement, etk::Matrix4 pointer, bool transpose=true);
{
private : void Uniform1f(int32_t idElem, float value1);
bool m_exist; void Uniform2f(int32_t idElem, float value1, float value2);
GLuint m_program; void Uniform3f(int32_t idElem, float value1, float value2, float value3);
etk::Vector<ewol::Shader*> m_shaderList; void Uniform4f(int32_t idElem, float value1, float value2, float value3, float value4);
etk::Vector<ewol::progAttributeElement> m_elementList;
bool m_hasTexture; void Uniform1i(int32_t idElem, int32_t value1);
public: void Uniform2i(int32_t idElem, int32_t value1, int32_t value2);
Program(etk::UString& filename); void Uniform3i(int32_t idElem, int32_t value1, int32_t value2, int32_t value3);
virtual ~Program(void); void Uniform4i(int32_t idElem, int32_t value1, int32_t value2, int32_t value3, int32_t value4);
const char* GetType(void) { return "ewol::Program"; };
int32_t GetAttribute(etk::UString tmpElement); void Uniform1fv(int32_t idElem, int32_t nbElement, float *value);
void SendAttribute(int32_t idElem, int32_t nbElement, void* pointer, int32_t jumpBetweenSample=0); void Uniform2fv(int32_t idElem, int32_t nbElement, float *value);
int32_t GetUniform(etk::UString tmpElement); void Uniform3fv(int32_t idElem, int32_t nbElement, float *value);
void Uniform4fv(int32_t idElem, int32_t nbElement, float *value);
void UniformMatrix4fv(int32_t idElem, int32_t nbElement, etk::Matrix4 pointer, bool transpose=true);
void Uniform1iv(int32_t idElem, int32_t nbElement, int32_t *value);
void Uniform1f(int32_t idElem, float value1); void Uniform2iv(int32_t idElem, int32_t nbElement, int32_t *value);
void Uniform2f(int32_t idElem, float value1, float value2); void Uniform3iv(int32_t idElem, int32_t nbElement, int32_t *value);
void Uniform3f(int32_t idElem, float value1, float value2, float value3); void Uniform4iv(int32_t idElem, int32_t nbElement, int32_t *value);
void Uniform4f(int32_t idElem, float value1, float value2, float value3, float value4);
void Use(void);
void Uniform1i(int32_t idElem, int32_t value1); void SetTexture0(int32_t idElem, GLint textureOpenGlID);
void Uniform2i(int32_t idElem, int32_t value1, int32_t value2); void UnUse(void);
void Uniform3i(int32_t idElem, int32_t value1, int32_t value2, int32_t value3); void UpdateContext(void);
void Uniform4i(int32_t idElem, int32_t value1, int32_t value2, int32_t value3, int32_t value4); void RemoveContext(void);
void RemoveContextToLate(void);
void Uniform1fv(int32_t idElem, int32_t nbElement, float *value); void Reload(void);
void Uniform2fv(int32_t idElem, int32_t nbElement, float *value); };
void Uniform3fv(int32_t idElem, int32_t nbElement, float *value); };
void Uniform4fv(int32_t idElem, int32_t nbElement, float *value);
void Uniform1iv(int32_t idElem, int32_t nbElement, int32_t *value);
void Uniform2iv(int32_t idElem, int32_t nbElement, int32_t *value);
void Uniform3iv(int32_t idElem, int32_t nbElement, int32_t *value);
void Uniform4iv(int32_t idElem, int32_t nbElement, int32_t *value);
void Use(void);
void SetTexture0(int32_t idElem, GLint textureOpenGlID);
void UnUse(void);
void UpdateContext(void);
void RemoveContext(void);
void RemoveContextToLate(void);
void Reload(void);
};
};
#endif
#endif #endif

View File

@ -22,7 +22,6 @@
******************************************************************************* *******************************************************************************
*/ */
#ifdef __VIDEO__OPENGL_ES_2
#include <etk/Types.h> #include <etk/Types.h>
#include <etk/os/FSNode.h> #include <etk/os/FSNode.h>
@ -168,5 +167,4 @@ void ewol::Shader::Reload(void)
} }
#endif

View File

@ -24,33 +24,32 @@
#ifndef __OPEN_GL__SHADER_H__ #ifndef __OPEN_GL__SHADER_H__
#define __OPEN_GL__SHADER_H__ #define __OPEN_GL__SHADER_H__
#ifdef __VIDEO__OPENGL_ES_2 #include <etk/Types.h>
#include <etk/Types.h> #include <ewol/Debug.h>
#include <ewol/Debug.h> #include <ewol/Resource.h>
#include <ewol/Resource.h> #include <ewol/openGL/openGL.h>
#include <ewol/openGL/openGL.h>
namespace ewol
namespace ewol {
{ class Shader : public ewol::Resource
class Shader : public ewol::Resource {
{ private :
private : bool m_exist;
bool m_exist; char* m_fileData;
char* m_fileData; GLuint m_shader;
GLuint m_shader; GLenum m_type;
GLenum m_type; public:
public: Shader(etk::UString& filename);
Shader(etk::UString& filename); virtual ~Shader(void);
virtual ~Shader(void); const char* GetType(void) { return "ewol::Shader"; };
const char* GetType(void) { return "ewol::Shader"; }; GLuint GetGL_ID(void) { return m_shader; };
GLuint GetGL_ID(void) { return m_shader; }; GLenum GetShaderType(void) { return m_type; };
GLenum GetShaderType(void) { return m_type; }; void UpdateContext(void);
void UpdateContext(void); void RemoveContext(void);
void RemoveContext(void); void RemoveContextToLate(void);
void RemoveContextToLate(void); void Reload(void);
void Reload(void); };
}; };
};
#endif
#endif #endif

View File

@ -26,48 +26,6 @@
#include <ewol/openGL/openGL.h> #include <ewol/openGL/openGL.h>
#include <etk/Vector.h> #include <etk/Vector.h>
#ifndef __VIDEO__OPENGL_ES_2
void glOrthoMatrix(GLfloat left,
GLfloat right,
GLfloat bottom,
GLfloat top,
GLfloat nearVal,
GLfloat farVal,
GLfloat* myMatrix)
{
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;
}
void glOrthoEwol(GLfloat left,
GLfloat right,
GLfloat bottom,
GLfloat top,
GLfloat nearVal,
GLfloat farVal)
{
GLfloat myMatrix[4*4];
glOrthoMatrix(left, right, bottom, top, nearVal, farVal, myMatrix);
glLoadMatrixf(myMatrix);
}
#endif
etk::Vector<etk::Matrix4> l_matrixList; etk::Vector<etk::Matrix4> l_matrixList;
void ewol::openGL::Init(void) void ewol::openGL::Init(void)

View File

@ -32,42 +32,28 @@ extern "C" {
#endif #endif
#if defined(__TARGET_OS__Linux) #if defined(__TARGET_OS__Linux)
#ifdef __VIDEO__OPENGL_ES_2 // TO ENABLE THE SHADER api ...
// TO ENABLE THE SHADER api ... #define GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
#endif
#include <GL/gl.h> #include <GL/gl.h>
#ifdef __VIDEO__OPENGL_ES_2 // TODO : Check it it work
// This is to prevent the use of these element that is not allowed in the OpenGL ES // This is to prevent the use of these element that is not allowed in the OpenGL ES
#undef glVertexPointer #undef glVertexPointer
#undef glTexCoordPointer #undef glTexCoordPointer
#undef glColorPointer #undef glColorPointer
#undef glPopMatrix #undef glPopMatrix
#undef glPushMatrix #undef glPushMatrix
#undef glMatrixMode #undef glMatrixMode
#undef glLoadIdentity #undef glLoadIdentity
#undef glTranslatef #undef glTranslatef
#endif
#elif defined(__TARGET_OS__Android) #elif defined(__TARGET_OS__Android)
#ifdef __VIDEO__OPENGL_ES_2 // Include openGL ES 2
// Include openGL ES 2 #include <GLES2/gl2.h>
#include <GLES2/gl2.h> #include <GLES2/gl2ext.h>
#include <GLES2/gl2ext.h>
#else
// Include openGL ES 1
#include <GLES/gl.h>
#endif
#elif defined(__TARGET_OS__Windows) #elif defined(__TARGET_OS__Windows)
#ifdef __VIDEO__OPENGL_ES_2 // TO ENABLE THE SHADER api ...
// TO ENABLE THE SHADER api ... //#define GL_GLEXT_PROTOTYPES
//#define GL_GLEXT_PROTOTYPES #define GLEW_STATIC
#define GLEW_STATIC #include <GL/glew.h>
#include <GL/glew.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glext.h>
#endif
#elif defined(__TARGET_OS__MacOs) #elif defined(__TARGET_OS__MacOs)
#elif defined(__TARGET_OS__IOs) #elif defined(__TARGET_OS__IOs)
@ -76,10 +62,6 @@ extern "C" {
#error you need to specify a __TAGET_OS__ ... #error you need to specify a __TAGET_OS__ ...
#endif #endif
#ifndef __VIDEO__OPENGL_ES_2
// TODO : Remove : deprecated ....
void glOrthoEwol(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal);
#endif
namespace ewol { namespace ewol {
namespace openGL { namespace openGL {
void Init(void); void Init(void);

View File

@ -216,13 +216,11 @@ int Windows_Run(void);
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#ifdef __VIDEO__OPENGL_ES_2 glewInit();
glewInit(); if (!glewIsSupported("GL_VERSION_2_0")) {
if (!glewIsSupported("GL_VERSION_2_0")) { fprintf(stderr, "OpenGL 2.0 not available\n");
fprintf(stderr, "OpenGL 2.0 not available\n"); return 1;
return 1; }
}
#endif
ewol::CmdLine::Clean(); ewol::CmdLine::Clean();
for( int32_t i=1 ; i<argc; i++) { for( int32_t i=1 ; i<argc; i++) {

View File

@ -78,29 +78,27 @@ void ewol::Button::Init(void)
m_textColorFg = draw::color::black; m_textColorFg = draw::color::black;
SetCanHaveFocus(true); SetCanHaveFocus(true);
#ifdef __VIDEO__OPENGL_ES_2 etk::UString tmpString("THEME:GUI:widgetButton.conf");
etk::UString tmpString("THEME:GUI:widgetButton.conf"); if (true == ewol::resource::Keep(tmpString, m_config) ) {
if (true == ewol::resource::Keep(tmpString, m_config) ) { m_confIdPaddingX = m_config->Request("PaddingX");
m_confIdPaddingX = m_config->Request("PaddingX"); m_confIdPaddingY = m_config->Request("PaddingY");
m_confIdPaddingY = m_config->Request("PaddingY"); m_confIdChangeTime = m_config->Request("ChangeTime");
m_confIdChangeTime = m_config->Request("ChangeTime"); }
} tmpString ="THEME:GUI:widgetButton.prog";
tmpString ="THEME:GUI:widgetButton.prog"; // get the shader resource :
// get the shader resource : m_GLPosition = 0;
m_GLPosition = 0; if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) {
if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d");
m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation");
m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); // Widget property ==> for the Vertex shader
// Widget property ==> for the Vertex shader m_GLwidgetProperty.m_size = m_GLprogram->GetUniform("EW_widgetProperty.size");
m_GLwidgetProperty.m_size = m_GLprogram->GetUniform("EW_widgetProperty.size"); m_GLwidgetProperty.m_insidePos = m_GLprogram->GetUniform("EW_widgetProperty.insidePos");
m_GLwidgetProperty.m_insidePos = m_GLprogram->GetUniform("EW_widgetProperty.insidePos"); m_GLwidgetProperty.m_insideSize = m_GLprogram->GetUniform("EW_widgetProperty.insideSize");
m_GLwidgetProperty.m_insideSize = m_GLprogram->GetUniform("EW_widgetProperty.insideSize"); // status property ==> for the fragment shader
// status property ==> for the fragment shader m_GLstatus.m_stateOld = m_GLprogram->GetUniform("EW_status.stateOld");
m_GLstatus.m_stateOld = m_GLprogram->GetUniform("EW_status.stateOld"); m_GLstatus.m_stateNew = m_GLprogram->GetUniform("EW_status.stateNew");
m_GLstatus.m_stateNew = m_GLprogram->GetUniform("EW_status.stateNew"); m_GLstatus.m_transition = m_GLprogram->GetUniform("EW_status.transition");
m_GLstatus.m_transition = m_GLprogram->GetUniform("EW_status.transition"); }
}
#endif
} }
ewol::Button::Button(void) ewol::Button::Button(void)
@ -175,37 +173,35 @@ bool ewol::Button::GetValue(void)
return false; return false;
} }
#ifdef __VIDEO__OPENGL_ES_2
void ewol::Button::SetPoint(float x, float y) void ewol::Button::SetPoint(float x, float y)
{ {
etk::Vector2D<float> triangle(x, y); etk::Vector2D<float> triangle(x, y);
m_coord.PushBack(triangle); m_coord.PushBack(triangle);
} }
void ewol::Button::Rectangle(float x, float y, float w, float h) void ewol::Button::Rectangle(float x, float y, float w, float h)
{ {
m_coord.Clear(); m_coord.Clear();
/* Bitmap position /* Bitmap position
* xA xB * xA xB
* yC *------* * yC *------*
* | | * | |
* | | * | |
* yD *------* * yD *------*
*/ */
float dxA = x; float dxA = x;
float dxB = x + w; float dxB = x + w;
float dyC = y; float dyC = y;
float dyD = y + h; float dyD = y + h;
SetPoint(dxA, dyD); SetPoint(dxA, dyD);
SetPoint(dxA, dyC); SetPoint(dxA, dyC);
SetPoint(dxB, dyC); SetPoint(dxB, dyC);
SetPoint(dxB, dyC); SetPoint(dxB, dyC);
SetPoint(dxB, dyD); SetPoint(dxB, dyD);
SetPoint(dxA, dyD); SetPoint(dxA, dyD);
} }
#endif
void ewol::Button::OnDraw(DrawProperty& displayProp) void ewol::Button::OnDraw(DrawProperty& displayProp)

View File

@ -80,27 +80,25 @@ namespace ewol {
class Button : public ewol::Widget class Button : public ewol::Widget
{ {
private: private:
#ifdef __VIDEO__OPENGL_ES_2 // External theme config:
// External theme config: ewol::SimpleConfigFile* m_config;
ewol::SimpleConfigFile* m_config; int32_t m_confIdPaddingX;
int32_t m_confIdPaddingX; int32_t m_confIdPaddingY;
int32_t m_confIdPaddingY; int32_t m_confIdChangeTime;
int32_t m_confIdChangeTime; // OpenGL shaders programs:
// OpenGL shaders programs: ewol::Program* m_GLprogram;
ewol::Program* m_GLprogram; int32_t m_GLPosition;
int32_t m_GLPosition; int32_t m_GLMatrix;
int32_t m_GLMatrix; // widget property
// widget property ewol::GLWidgetPosProperty m_GLwidgetProperty; // id of the uniform
ewol::GLWidgetPosProperty m_GLwidgetProperty; // id of the uniform ewol::WidgetPosProperty m_widgetProperty; // structure of this uniform
ewol::WidgetPosProperty m_widgetProperty; // structure of this uniform // state property
// state property ewol::GLWidgetStateProperty m_GLstatus;
ewol::GLWidgetStateProperty m_GLstatus; ewol::WidgetStateProperty m_status;
ewol::WidgetStateProperty m_status;
etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object
etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object void SetPoint(float x, float y);
void SetPoint(float x, float y); void Rectangle(float x, float y, float w, float h);
void Rectangle(float x, float y, float w, float h);
#endif
private: private:
ewol::OObject2DTextColored m_oObjectText; ewol::OObject2DTextColored m_oObjectText;
ewol::OObject2DTextured* m_oObjectImage; ewol::OObject2DTextured* m_oObjectImage;

View File

@ -68,20 +68,18 @@ void ewol::Entry::Init(void)
ShortCutAdd("ctrl+v", ewolEventEntryPaste); ShortCutAdd("ctrl+v", ewolEventEntryPaste);
ShortCutAdd("ctrl+a", ewolEventEntrySelect, "ALL"); ShortCutAdd("ctrl+a", ewolEventEntrySelect, "ALL");
ShortCutAdd("ctrl+shift+a", ewolEventEntrySelect, "NONE"); ShortCutAdd("ctrl+shift+a", ewolEventEntrySelect, "NONE");
#ifdef __VIDEO__OPENGL_ES_2 etk::UString tmpString("THEME:GUI:widgetEntry.prog");
etk::UString tmpString("THEME:GUI:widgetEntry.prog"); // get the shader resource :
// get the shader resource : m_GLPosition = 0;
m_GLPosition = 0; if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) {
if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d");
m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation");
m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); m_GLsizeBorder = m_GLprogram->GetUniform("EW_sizeBorder");
m_GLsizeBorder = m_GLprogram->GetUniform("EW_sizeBorder"); m_GLsizePadding = m_GLprogram->GetUniform("EW_sizePadding");
m_GLsizePadding = m_GLprogram->GetUniform("EW_sizePadding"); m_GLsize = m_GLprogram->GetUniform("EW_size");
m_GLsize = m_GLprogram->GetUniform("EW_size"); m_GLposText = m_GLprogram->GetUniform("EW_posText");
m_GLposText = m_GLprogram->GetUniform("EW_posText"); m_GLstate = m_GLprogram->GetUniform("EW_state");
m_GLstate = m_GLprogram->GetUniform("EW_state"); }
}
#endif
} }
ewol::Entry::Entry(void) ewol::Entry::Entry(void)
@ -134,37 +132,34 @@ etk::UString ewol::Entry::GetValue(void)
#ifdef __VIDEO__OPENGL_ES_2 void ewol::Entry::SetPoint(float x, float y)
{
etk::Vector2D<float> triangle(x, y);
m_coord.PushBack(triangle);
}
void ewol::Entry::SetPoint(float x, float y) void ewol::Entry::Rectangle(float x, float y, float w, float h)
{ {
etk::Vector2D<float> triangle(x, y); m_coord.Clear();
m_coord.PushBack(triangle); /* Bitmap position
} * xA xB
* yC *------*
void ewol::Entry::Rectangle(float x, float y, float w, float h) * | |
{ * | |
m_coord.Clear(); * yD *------*
/* Bitmap position */
* xA xB float dxA = x;
* yC *------* float dxB = x + w;
* | | float dyC = y;
* | | float dyD = y + h;
* yD *------* SetPoint(dxA, dyD);
*/ SetPoint(dxA, dyC);
float dxA = x; SetPoint(dxB, dyC);
float dxB = x + w;
float dyC = y; SetPoint(dxB, dyC);
float dyD = y + h; SetPoint(dxB, dyD);
SetPoint(dxA, dyD); SetPoint(dxA, dyD);
SetPoint(dxA, dyC); }
SetPoint(dxB, dyC);
SetPoint(dxB, dyC);
SetPoint(dxB, dyD);
SetPoint(dxA, dyD);
}
#endif
/** /**
* @brief Common widget drawing function (called by the drawing thread [Android, X11, ...]) * @brief Common widget drawing function (called by the drawing thread [Android, X11, ...])
@ -173,28 +168,26 @@ etk::UString ewol::Entry::GetValue(void)
*/ */
void ewol::Entry::OnDraw(DrawProperty& displayProp) void ewol::Entry::OnDraw(DrawProperty& displayProp)
{ {
#ifdef __VIDEO__OPENGL_ES_2 if (m_GLprogram==NULL) {
if (m_GLprogram==NULL) { EWOL_ERROR("No shader ...");
EWOL_ERROR("No shader ..."); return;
return; }
} //glScalef(m_scaling.x, m_scaling.y, 1.0);
//glScalef(m_scaling.x, m_scaling.y, 1.0); m_GLprogram->Use();
m_GLprogram->Use(); // set Matrix : translation/positionMatrix
// set Matrix : translation/positionMatrix etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix();
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix(); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // position :
// position : m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, &m_coord[0]);
m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, &m_coord[0]); // all entry parameters :
// all entry parameters : m_GLprogram->Uniform1f(m_GLsizeBorder, m_borderSize);
m_GLprogram->Uniform1f(m_GLsizeBorder, m_borderSize); m_GLprogram->Uniform1f(m_GLsizePadding, m_paddingSize);
m_GLprogram->Uniform1f(m_GLsizePadding, m_paddingSize); m_GLprogram->Uniform2fv(m_GLsize, 1, &m_size.x);
m_GLprogram->Uniform2fv(m_GLsize, 1, &m_size.x); m_GLprogram->Uniform4fv(m_GLposText, 1, m_pos);
m_GLprogram->Uniform4fv(m_GLposText, 1, m_pos); m_GLprogram->Uniform1i(m_GLstate, 0);
m_GLprogram->Uniform1i(m_GLstate, 0); // Request the draw of the elements :
// Request the draw of the elements : glDrawArrays(GL_TRIANGLES, 0, m_coord.Size());
glDrawArrays(GL_TRIANGLES, 0, m_coord.Size()); m_GLprogram->UnUse();
m_GLprogram->UnUse();
#endif
m_oObjectDecoration.Draw(); m_oObjectDecoration.Draw();
m_oObjectText.Draw(); m_oObjectText.Draw();
} }
@ -246,19 +239,11 @@ void ewol::Entry::OnRegenerateDisplay(void)
m_oObjectText.Text(textPos, m_data); m_oObjectText.Text(textPos, m_data);
m_oObjectText.clippingDisable(); m_oObjectText.clippingDisable();
#ifndef __VIDEO__OPENGL_ES_2 m_pos[0] = m_borderSize+2*drawClipping.x;
m_oObjectDecoration.SetColor(m_textColorBg); m_pos[1] = m_borderSize+2*drawClipping.y;
m_oObjectDecoration.Rectangle( tmpOriginX, tmpOriginY, tmpSizeX, tmpSizeY); m_pos[2] = m_size.x - 2*(m_borderSize+2*drawClipping.x);
m_oObjectDecoration.SetColor(m_textColorFg); m_pos[3] = m_size.y - 2*(m_borderSize+2*drawClipping.y);
m_oObjectDecoration.RectangleBorder( tmpOriginX, tmpOriginY, tmpSizeX, tmpSizeY, m_borderSize); Rectangle(0, 0, m_size.x, m_size.y);
#else
m_pos[0] = m_borderSize+2*drawClipping.x;
m_pos[1] = m_borderSize+2*drawClipping.y;
m_pos[2] = m_size.x - 2*(m_borderSize+2*drawClipping.x);
m_pos[3] = m_size.y - 2*(m_borderSize+2*drawClipping.y);
Rectangle(0, 0, m_size.x, m_size.y);
#endif
int32_t pos1 = m_displayCursorPosSelection; int32_t pos1 = m_displayCursorPosSelection;
int32_t pos2 = m_displayCursorPos; int32_t pos2 = m_displayCursorPos;
if(m_displayCursorPosSelection>m_displayCursorPos) { if(m_displayCursorPosSelection>m_displayCursorPos) {

View File

@ -48,21 +48,19 @@ namespace ewol {
class Entry : public ewol::Widget class Entry : public ewol::Widget
{ {
private: private:
#ifdef __VIDEO__OPENGL_ES_2 ewol::Program* m_GLprogram;
ewol::Program* m_GLprogram; int32_t m_GLPosition;
int32_t m_GLPosition; int32_t m_GLMatrix;
int32_t m_GLMatrix; int32_t m_GLsizeBorder;
int32_t m_GLsizeBorder; int32_t m_GLsizePadding;
int32_t m_GLsizePadding; int32_t m_GLsize;
int32_t m_GLsize; float m_pos[4];
float m_pos[4]; int32_t m_GLposText;
int32_t m_GLposText; int32_t m_GLstate;
int32_t m_GLstate; etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object
etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object draw::Colorf m_color[3];
draw::Colorf m_color[3]; void SetPoint(float x, float y);
void SetPoint(float x, float y); void Rectangle(float x, float y, float w, float h);
void Rectangle(float x, float y, float w, float h);
#endif
private: private:
ewol::OObject2DTextColored m_oObjectText; //!< text display ewol::OObject2DTextColored m_oObjectText; //!< text display
ewol::OObject2DColored m_oObjectDecoration; //!< background display ewol::OObject2DColored m_oObjectDecoration; //!< background display

View File

@ -156,11 +156,7 @@ void ewol::Scene::PeriodicCall(int64_t localTime)
void ewol::Scene::GenDraw(DrawProperty displayProp) void ewol::Scene::GenDraw(DrawProperty displayProp)
{ {
#ifdef __VIDEO__OPENGL_ES_2 ewol::openGL::Push();
ewol::openGL::Push();
#else
glPushMatrix();
#endif
// here we invert the reference of the standard OpenGl view because the reference in the common display is Top left and not buttom left // here we invert the reference of the standard OpenGl view because the reference in the common display is Top left and not buttom left
glViewport( m_origin.x, glViewport( m_origin.x,
m_origin.y, m_origin.y,
@ -169,7 +165,6 @@ void ewol::Scene::GenDraw(DrawProperty displayProp)
float ratio = m_size.x / m_size.y; float ratio = m_size.x / m_size.y;
m_zoom = 1.0/1000.0; m_zoom = 1.0/1000.0;
//EWOL_INFO("ratio : " << ratio); //EWOL_INFO("ratio : " << ratio);
#ifdef __VIDEO__OPENGL_ES_2
etk::Matrix4 tmpProjection; etk::Matrix4 tmpProjection;
if (ratio >= 1.0) { if (ratio >= 1.0) {
@ -182,31 +177,13 @@ void ewol::Scene::GenDraw(DrawProperty displayProp)
etk::Matrix4 tmpMat = tmpProjection * tmpScale; etk::Matrix4 tmpMat = tmpProjection * tmpScale;
// set internal matrix system : // set internal matrix system :
ewol::openGL::SetMatrix(tmpMat); ewol::openGL::SetMatrix(tmpMat);
#else
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (ratio >= 1.0) {
glOrthoEwol(-ratio, ratio, -1, 1, -1, 1);
} else {
ratio = 1.0/ratio;
glOrthoEwol(-1, 1, -ratio, ratio, -1, 1);
}
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glScalef(m_zoom, m_zoom, m_zoom);
#endif
// Clear the screen with transparency ... // Clear the screen with transparency ...
glClearColor(0.0, 0.0, 0.0, 1.0); glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Call the widget drawing methode // Call the widget drawing methode
OnDraw(displayProp); OnDraw(displayProp);
#ifdef __VIDEO__OPENGL_ES_2 ewol::openGL::Pop();
ewol::openGL::Pop();
#else
glPopMatrix();
#endif
} }
/** /**

View File

@ -230,11 +230,7 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
// widget is hidden ... // widget is hidden ...
return; return;
} }
#ifdef __VIDEO__OPENGL_ES_2 ewol::openGL::Push();
ewol::openGL::Push();
#else
glPushMatrix();
#endif
if( (displayProp.m_origin.x > m_origin.x) if( (displayProp.m_origin.x > m_origin.x)
|| (displayProp.m_origin.x + displayProp.m_size.x < m_size.x + m_origin.x) ) { || (displayProp.m_origin.x + displayProp.m_size.x < m_size.x + m_origin.x) ) {
// here we invert the reference of the standard OpenGl view because the reference in the common display is Top left and not buttom left // here we invert the reference of the standard OpenGl view because the reference in the common display is Top left and not buttom left
@ -252,23 +248,12 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
tmpOriginY, tmpOriginY,
tmpclipX, tmpclipX,
m_size.y); m_size.y);
#ifdef __VIDEO__OPENGL_ES_2 etk::Matrix4 tmpTranslate = etk::matrix::Translate(-tmpclipX/2 - (tmpOriginX-m_origin.x), -m_size.y/2, -1.0);
etk::Matrix4 tmpTranslate = etk::matrix::Translate(-tmpclipX/2 - (tmpOriginX-m_origin.x), -m_size.y/2, -1.0); etk::Matrix4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, 1.0);
etk::Matrix4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, 1.0); etk::Matrix4 tmpProjection = etk::matrix::Perspective(-tmpclipX/2, tmpclipX/2, -m_size.y/2, m_size.y/2, -1, 1);
etk::Matrix4 tmpProjection = etk::matrix::Perspective(-tmpclipX/2, tmpclipX/2, -m_size.y/2, m_size.y/2, -1, 1); etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate; // set internal matrix system :
// set internal matrix system : ewol::openGL::SetMatrix(tmpMat);
ewol::openGL::SetMatrix(tmpMat);
#else
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthoEwol(-tmpclipX/2, tmpclipX/2, -m_size.y/2, m_size.y/2, -1, 1);
//glOrthoEwol(0., m_size.x, 0., -m_size.y, 1., 20.);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(-tmpclipX/2 - (tmpOriginX-m_origin.x), -m_size.y/2, -1.0);
#endif
// Call the widget drawing methode // Call the widget drawing methode
displayProp.m_origin.x = tmpOriginX; displayProp.m_origin.x = tmpOriginX;
displayProp.m_origin.y = tmpOriginY; displayProp.m_origin.y = tmpOriginY;
@ -280,36 +265,22 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
m_origin.y, m_origin.y,
m_size.x, m_size.x,
m_size.y); m_size.y);
#ifdef __VIDEO__OPENGL_ES_2 #if 1
#if 1 etk::Matrix4 tmpTranslate = etk::matrix::Translate(-m_size.x/2, -m_size.y/2, -1.0);
etk::Matrix4 tmpTranslate = etk::matrix::Translate(-m_size.x/2, -m_size.y/2, -1.0); etk::Matrix4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, 1.0);
etk::Matrix4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, 1.0); etk::Matrix4 tmpProjection = etk::matrix::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
etk::Matrix4 tmpProjection = etk::matrix::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1); etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
#else
etk::Matrix4 tmpMat = etk::matrix::Perspective(0, m_size.x, 0, m_size.y, -1, 1);
#endif
// set internal matrix system :
ewol::openGL::SetMatrix(tmpMat);
#else #else
glMatrixMode(GL_PROJECTION); etk::Matrix4 tmpMat = etk::matrix::Perspective(0, m_size.x, 0, m_size.y, -1, 1);
glLoadIdentity();
glOrthoEwol(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(-m_size.x/2, -m_size.y/2, -1.0);
#endif #endif
// set internal matrix system :
ewol::openGL::SetMatrix(tmpMat);
// Call the widget drawing methode // Call the widget drawing methode
displayProp.m_origin = m_origin; displayProp.m_origin = m_origin;
displayProp.m_size = m_size; displayProp.m_size = m_size;
OnDraw(displayProp); OnDraw(displayProp);
} }
#ifdef __VIDEO__OPENGL_ES_2 ewol::openGL::Pop();
ewol::openGL::Pop();
#else
glPopMatrix();
#endif
return; return;
} }

View File

@ -364,33 +364,19 @@ void ewol::WidgetScrooled::OnDraw(DrawProperty& displayProp)
*/ */
void ewol::WidgetScrooled::GenDraw(DrawProperty displayProp) void ewol::WidgetScrooled::GenDraw(DrawProperty displayProp)
{ {
#ifdef __VIDEO__OPENGL_ES_2 ewol::openGL::Push();
ewol::openGL::Push();
#else
glPushMatrix();
#endif
if (SCROLL_MODE_CENTER == m_scroollingMode) { if (SCROLL_MODE_CENTER == m_scroollingMode) {
// here we invert the reference of the standard OpenGl view because the reference in the common display is Top left and not buttom left // here we invert the reference of the standard OpenGl view because the reference in the common display is Top left and not buttom left
glViewport( m_origin.x, glViewport( m_origin.x,
m_origin.y, m_origin.y,
m_size.x, m_size.x,
m_size.y); m_size.y);
#ifdef __VIDEO__OPENGL_ES_2 etk::Matrix4 tmpProjection = etk::matrix::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
etk::Matrix4 tmpProjection = etk::matrix::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1); etk::Matrix4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, 1.0);
etk::Matrix4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, 1.0); etk::Matrix4 tmpTranslate = etk::matrix::Translate(-m_maxSize.x/2, -m_maxSize.y/2, -1.0);
etk::Matrix4 tmpTranslate = etk::matrix::Translate(-m_maxSize.x/2, -m_maxSize.y/2, -1.0); etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate; // set internal matrix system :
// set internal matrix system : ewol::openGL::SetMatrix(tmpMat);
ewol::openGL::SetMatrix(tmpMat);
#else
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthoEwol(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glScalef(m_zoom, m_zoom, 1.0);
glTranslatef(-m_maxSize.x/2, -m_maxSize.y/2, -1.0);
#endif
// Call the widget drawing methode // Call the widget drawing methode
OnDraw(displayProp); OnDraw(displayProp);
} if (SCROLL_MODE_GAME == m_scroollingMode) { } if (SCROLL_MODE_GAME == m_scroollingMode) {
@ -400,31 +386,17 @@ void ewol::WidgetScrooled::GenDraw(DrawProperty displayProp)
m_size.x, m_size.x,
m_size.y); m_size.y);
#ifdef __VIDEO__OPENGL_ES_2 etk::Matrix4 tmpProjection = etk::matrix::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
etk::Matrix4 tmpProjection = etk::matrix::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1); etk::Matrix4 tmpTranslate = etk::matrix::Translate(-m_maxSize.x/2, -m_maxSize.y/2, -1.0);
etk::Matrix4 tmpTranslate = etk::matrix::Translate(-m_maxSize.x/2, -m_maxSize.y/2, -1.0); etk::Matrix4 tmpMat = tmpProjection * tmpTranslate;
etk::Matrix4 tmpMat = tmpProjection * tmpTranslate; // set internal matrix system :
// set internal matrix system : ewol::openGL::SetMatrix(tmpMat);
ewol::openGL::SetMatrix(tmpMat);
#else
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthoEwol(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//glScalef(m_zoom, m_zoom, 1.0);
glTranslatef(-m_maxSize.x/2, -m_maxSize.y/2, -1.0);
#endif
// Call the widget drawing methode // Call the widget drawing methode
OnDraw(displayProp); OnDraw(displayProp);
} else { } else {
ewol::Widget::GenDraw(displayProp); ewol::Widget::GenDraw(displayProp);
} }
#ifdef __VIDEO__OPENGL_ES_2 ewol::openGL::Pop();
ewol::openGL::Pop();
#else
glPopMatrix();
#endif
} }

1
Sources/libewol/tag Normal file
View File

@ -0,0 +1 @@
0.4.2

View File

@ -6,15 +6,8 @@ LOCAL_MODULE := glew
#http://glew.sourceforge.net/index.html #http://glew.sourceforge.net/index.html
#ifneq ("$(CONFIG__VIDEO__OPENGL_ES_2)","") LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/glew/include/
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/glew/include/ LOCAL_EXPORT_LDLIBS := $(LOCAL_PATH)/glew/lib/glew32s.lib -lopengl32 -lgdi32
LOCAL_EXPORT_LDLIBS := $(LOCAL_PATH)/glew/lib/glew32s.lib -lopengl32 -lgdi32
# to enable open gl 2 mode
LOCAL_CFLAGS += -D__VIDEO__OPENGL_ES_2
LOCAL_EXPORT_CFLAGS := -D__VIDEO__OPENGL_ES_2
#else
# LOCAL_EXPORT_LDLIBS := -lopengl32 -lgdi32
#endif
include $(BUILD_PREBUILT) include $(BUILD_PREBUILT)

@ -1 +1 @@
Subproject commit edfe4d2aa6e50b496ff3c10203984e5b090c516d Subproject commit fcd7a0542ea39a8164ca97b832965adc6fda08ee