build is now ok for android with openGL ES 2.0 ==> not work : use unimplement fuction???
This commit is contained in:
parent
2eaed4f16e
commit
085b7cb9cd
@ -26,6 +26,8 @@ package org.ewol;
|
|||||||
|
|
||||||
import javax.microedition.khronos.egl.EGLConfig;
|
import javax.microedition.khronos.egl.EGLConfig;
|
||||||
import javax.microedition.khronos.opengles.GL10;
|
import javax.microedition.khronos.opengles.GL10;
|
||||||
|
//import javax.microedition.khronos.opengl.GLES20;
|
||||||
|
import android.opengl.GLES20;
|
||||||
import android.opengl.GLSurfaceView;
|
import android.opengl.GLSurfaceView;
|
||||||
|
|
||||||
// inport the ewol package :
|
// inport the ewol package :
|
||||||
|
@ -23,6 +23,10 @@ LOCAL_CFLAGS := -Wno-write-strings \
|
|||||||
-DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\"" \
|
-DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG_SHORT)-$(BUILD_DIRECTORY_MODE)\"" \
|
||||||
-DDATA_IN_APK
|
-DDATA_IN_APK
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -D__VIDEO__OPENGL_ES_2
|
||||||
|
LOCAL_EXPORT_CFLAGS := -D__VIDEO__OPENGL_ES_2
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ 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_SHORT)-$(BUILD_DIRECTORY_MODE)\"" \
|
||||||
-DLUA_COMPAT_ALL \
|
|
||||||
-Wall
|
-Wall
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,9 +20,12 @@ LOCAL_EXPORT_LDLIBS := -lopengl32 -lgdi32
|
|||||||
|
|
||||||
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_SHORT)-$(BUILD_DIRECTORY_MODE)\"" \
|
||||||
-DLUA_COMPAT_ALL \
|
|
||||||
-Wall
|
-Wall
|
||||||
|
|
||||||
|
|
||||||
|
#LOCAL_CFLAGS += -D__VIDEO__OPENGL_ES_2
|
||||||
|
#LOCAL_EXPORT_CFLAGS := -D__VIDEO__OPENGL_ES_2
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
|
@ -68,8 +68,7 @@ void ewol::OObject2DColored::Draw(void)
|
|||||||
EWOL_ERROR("No shader ...");
|
EWOL_ERROR("No shader ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
glPushMatrix();
|
//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::Matrix tmpMatrix = ewol::openGL::GetMatrix();
|
etk::Matrix tmpMatrix = ewol::openGL::GetMatrix();
|
||||||
@ -81,7 +80,6 @@ void ewol::OObject2DColored::Draw(void)
|
|||||||
// 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();
|
||||||
glPopMatrix();
|
|
||||||
#else
|
#else
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
// Enable Pointers
|
// Enable Pointers
|
||||||
|
@ -135,7 +135,6 @@ void ewol::OObject2DTextColored::Draw(void)
|
|||||||
EWOL_ERROR("No shader ...");
|
EWOL_ERROR("No shader ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
glColor4f(1.0, 1.0, 1.0, 1.0);
|
|
||||||
m_GLprogram->Use();
|
m_GLprogram->Use();
|
||||||
// set Matrix : translation/positionMatrix
|
// set Matrix : translation/positionMatrix
|
||||||
etk::Matrix tmpMatrix = ewol::openGL::GetMatrix();
|
etk::Matrix tmpMatrix = ewol::openGL::GetMatrix();
|
||||||
|
@ -75,7 +75,6 @@ void ewol::OObject2DTextured::Draw(void)
|
|||||||
EWOL_ERROR("No shader ...");
|
EWOL_ERROR("No shader ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
glColor4f(1.0, 1.0, 1.0, 1.0);
|
|
||||||
m_GLprogram->Use();
|
m_GLprogram->Use();
|
||||||
// set Matrix : translation/positionMatrix
|
// set Matrix : translation/positionMatrix
|
||||||
etk::Matrix tmpMatrix = ewol::openGL::GetMatrix();
|
etk::Matrix tmpMatrix = ewol::openGL::GetMatrix();
|
||||||
|
@ -75,7 +75,6 @@ void ewol::OObject3DTextured::Draw(void)
|
|||||||
EWOL_ERROR("No shader ...");
|
EWOL_ERROR("No shader ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
glColor4f(1.0, 1.0, 1.0, 1.0);
|
|
||||||
m_GLprogram->Use();
|
m_GLprogram->Use();
|
||||||
// set Matrix : translation/positionMatrix
|
// set Matrix : translation/positionMatrix
|
||||||
etk::Matrix tmpMatrix = ewol::openGL::GetMatrix();
|
etk::Matrix tmpMatrix = ewol::openGL::GetMatrix();
|
||||||
|
@ -26,47 +26,47 @@
|
|||||||
#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,
|
void glOrthoMatrix(GLfloat left,
|
||||||
GLfloat right,
|
GLfloat right,
|
||||||
GLfloat bottom,
|
GLfloat bottom,
|
||||||
GLfloat top,
|
GLfloat top,
|
||||||
GLfloat nearVal,
|
GLfloat nearVal,
|
||||||
GLfloat farVal,
|
GLfloat farVal,
|
||||||
GLfloat* myMatrix)
|
GLfloat* myMatrix)
|
||||||
{
|
{
|
||||||
int iii;
|
int iii;
|
||||||
for(iii=0; iii<4*4 ; iii++) {
|
for(iii=0; iii<4*4 ; iii++) {
|
||||||
myMatrix[iii] = 0;
|
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);
|
||||||
}
|
}
|
||||||
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
|
#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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
etk::Vector<etk::Matrix> l_matrixList;
|
etk::Vector<etk::Matrix> l_matrixList;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__TARGET_OS__Linux) || defined(__TARGET_OS__Windows)
|
#if defined(__TARGET_OS__Linux)
|
||||||
#ifdef __VIDEO__OPENGL_ES_2
|
#ifdef __VIDEO__OPENGL_ES_2
|
||||||
// TO ENABLE THE SHADER api ...
|
// TO ENABLE THE SHADER api ...
|
||||||
#define GL_GLEXT_PROTOTYPES
|
#define GL_GLEXT_PROTOTYPES
|
||||||
@ -57,6 +57,14 @@ extern "C" {
|
|||||||
// Include openGL ES 1
|
// Include openGL ES 1
|
||||||
#include <GLES/gl.h>
|
#include <GLES/gl.h>
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined(__TARGET_OS__Windows)
|
||||||
|
#ifdef __VIDEO__OPENGL_ES_2
|
||||||
|
// TO ENABLE THE SHADER api ...
|
||||||
|
#define GL_GLEXT_PROTOTYPES
|
||||||
|
#endif
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
#elif defined(__TARGET_OS__MacOs)
|
#elif defined(__TARGET_OS__MacOs)
|
||||||
|
|
||||||
#elif defined(__TARGET_OS__IOs)
|
#elif defined(__TARGET_OS__IOs)
|
||||||
@ -65,9 +73,10 @@ extern "C" {
|
|||||||
#error you need to specify a __TAGET_OS__ ...
|
#error you need to specify a __TAGET_OS__ ...
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO : Remove : deprecated ....
|
#ifndef __VIDEO__OPENGL_ES_2
|
||||||
void glOrthoEwol(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal);
|
// 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);
|
||||||
|
@ -419,107 +419,6 @@ void eSystem::ClipBoardArrive(ewol::clipBoard::clipboardListe_te clipboardID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static float gTriangleVertices[] = { 0.0f, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f };
|
|
||||||
static float 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 };
|
|
||||||
|
|
||||||
static void BasicOpenGlDraw(void)
|
|
||||||
{
|
|
||||||
Vector2D<int32_t> tmpSize = eSystem::GetSize();
|
|
||||||
// set the size of the open GL system
|
|
||||||
glViewport(0, 0, tmpSize.x, tmpSize.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.);
|
|
||||||
glOrthoEwol(-tmpSize.x/2, tmpSize.x/2, tmpSize.y/2, -tmpSize.y/2, -1, 1);
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glLoadIdentity();
|
|
||||||
|
|
||||||
//glTranslatef(0, -height/2, -5);
|
|
||||||
glTranslatef(-tmpSize.x/2, -tmpSize.y/2, -1.0);
|
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
|
|
||||||
glEnableClientState( GL_VERTEX_ARRAY );
|
|
||||||
|
|
||||||
//LOGI("engine_draw_frame (%d,%d)",width,height);
|
|
||||||
|
|
||||||
glColor4f(0.0, 1.0, 1.0, 1.0);
|
|
||||||
glVertexPointer(2, GL_FLOAT, 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, GL_FLOAT, 0, gTriangleVertices );
|
|
||||||
glDrawArrays( GL_TRIANGLES, 0, 3);
|
|
||||||
|
|
||||||
glDisableClientState( GL_VERTEX_ARRAY );
|
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ewol::Fps l_FpsSystem;
|
static ewol::Fps l_FpsSystem;
|
||||||
|
|
||||||
bool eSystem::Draw(bool displayEveryTime)
|
bool eSystem::Draw(bool displayEveryTime)
|
||||||
@ -538,7 +437,7 @@ bool eSystem::Draw(bool displayEveryTime)
|
|||||||
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows();
|
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows();
|
||||||
// check if the user selected a windows
|
// check if the user selected a windows
|
||||||
if (NULL == tmpWindows) {
|
if (NULL == tmpWindows) {
|
||||||
BasicOpenGlDraw();
|
// TODO : Display a stipid texture
|
||||||
} else {
|
} else {
|
||||||
// Redraw all needed elements
|
// Redraw all needed elements
|
||||||
tmpWindows->OnRegenerateDisplay();
|
tmpWindows->OnRegenerateDisplay();
|
||||||
|
@ -147,42 +147,58 @@ void ewol::Scene::PeriodicCall(int64_t localTime)
|
|||||||
*/
|
*/
|
||||||
void ewol::Scene::GenDraw(DrawProperty displayProp)
|
void ewol::Scene::GenDraw(DrawProperty displayProp)
|
||||||
{
|
{
|
||||||
glPushMatrix();
|
|
||||||
|
#ifdef __VIDEO__OPENGL_ES_2
|
||||||
|
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,
|
||||||
m_size.x,
|
m_size.x,
|
||||||
m_size.y);
|
m_size.y);
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glLoadIdentity();
|
|
||||||
//glOrthoEwol(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -100, 100);
|
|
||||||
float ratio = m_size.x / m_size.y;
|
float ratio = m_size.x / m_size.y;
|
||||||
|
m_zoom = 1.0/1000.0;
|
||||||
//EWOL_INFO("ratio : " << ratio);
|
//EWOL_INFO("ratio : " << ratio);
|
||||||
if (ratio >= 0.0) {
|
#ifdef __VIDEO__OPENGL_ES_2
|
||||||
glOrthoEwol(-ratio, ratio, -1, 1, -1, 1);
|
etk::Matrix tmpProjection;
|
||||||
} else {
|
|
||||||
ratio = 1.0/ratio;
|
if (ratio >= 0.0) {
|
||||||
glOrthoEwol(-1, 1, -ratio, ratio, -1, 1);
|
tmpProjection = etk::matrix::Perspective(-ratio, ratio, -1, 1, -1, 1);
|
||||||
}
|
} else {
|
||||||
|
ratio = 1.0/ratio;
|
||||||
glMatrixMode(GL_MODELVIEW);
|
tmpProjection = etk::matrix::Perspective(-1, 1, -ratio, ratio, -1, 1);
|
||||||
glLoadIdentity();
|
}
|
||||||
|
etk::Matrix tmpScale = etk::matrix::Scale(m_zoom, m_zoom, m_zoom);
|
||||||
m_zoom = 1.0/1000.0;
|
etk::Matrix tmpMat = tmpProjection * tmpScale;
|
||||||
|
// set internal matrix system :
|
||||||
|
ewol::openGL::SetMatrix(tmpMat);
|
||||||
|
#else
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glLoadIdentity();
|
||||||
|
if (ratio >= 0.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);
|
||||||
//glEnable(GL_DEPTH_TEST);
|
|
||||||
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
//glEnable(GL_BLEND);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glScalef(m_zoom, m_zoom, m_zoom);
|
|
||||||
//glTranslatef(-m_maxSize.x/2, -m_maxSize.y/2, -1.0);
|
|
||||||
|
|
||||||
// Call the widget drawing methode
|
// Call the widget drawing methode
|
||||||
OnDraw(displayProp);
|
OnDraw(displayProp);
|
||||||
//glDisable(GL_BLEND);
|
|
||||||
//glDisable(GL_DEPTH_TEST);
|
#ifdef __VIDEO__OPENGL_ES_2
|
||||||
glPopMatrix();
|
ewol::openGL::Pop();
|
||||||
|
#else
|
||||||
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -263,7 +263,6 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
glTranslatef(-tmpclipX/2 - (tmpOriginX-m_origin.x), -m_size.y/2, -1.0);
|
glTranslatef(-tmpclipX/2 - (tmpOriginX-m_origin.x), -m_size.y/2, -1.0);
|
||||||
#endif
|
#endif
|
||||||
glLoadIdentity();
|
|
||||||
// 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;
|
||||||
|
@ -346,46 +346,67 @@ 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();
|
||||||
|
#else
|
||||||
|
glPushMatrix();
|
||||||
|
#endif
|
||||||
if (SCROLL_MODE_CENTER == m_scroollingMode) {
|
if (SCROLL_MODE_CENTER == m_scroollingMode) {
|
||||||
glPushMatrix();
|
|
||||||
// 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);
|
||||||
glMatrixMode(GL_PROJECTION);
|
#ifdef __VIDEO__OPENGL_ES_2
|
||||||
glLoadIdentity();
|
etk::Matrix tmpProjection = etk::matrix::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
|
||||||
glOrthoEwol(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
|
etk::Matrix tmpScale = etk::matrix::Scale(m_zoom, m_zoom, 1.0);
|
||||||
glMatrixMode(GL_MODELVIEW);
|
etk::Matrix tmpTranslate = etk::matrix::Translate(-m_maxSize.x/2, -m_maxSize.y/2, -1.0);
|
||||||
glLoadIdentity();
|
etk::Matrix tmpMat = tmpProjection * tmpScale * tmpTranslate;
|
||||||
glScalef(m_zoom, m_zoom, 1.0);
|
// set internal matrix system :
|
||||||
glTranslatef(-m_maxSize.x/2, -m_maxSize.y/2, -1.0);
|
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);
|
||||||
glPopMatrix();
|
|
||||||
} if (SCROLL_MODE_GAME == m_scroollingMode) {
|
} if (SCROLL_MODE_GAME == m_scroollingMode) {
|
||||||
glPushMatrix();
|
|
||||||
// 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);
|
||||||
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);
|
|
||||||
|
|
||||||
|
#ifdef __VIDEO__OPENGL_ES_2
|
||||||
|
etk::Matrix tmpProjection = etk::matrix::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
|
||||||
|
etk::Matrix tmpTranslate = etk::matrix::Translate(-m_maxSize.x/2, -m_maxSize.y/2, -1.0);
|
||||||
|
etk::Matrix tmpMat = tmpProjection * tmpTranslate;
|
||||||
|
// set internal matrix system :
|
||||||
|
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);
|
||||||
glPopMatrix();
|
|
||||||
} else {
|
} else {
|
||||||
ewol::Widget::GenDraw(displayProp);
|
ewol::Widget::GenDraw(displayProp);
|
||||||
}
|
}
|
||||||
|
#ifdef __VIDEO__OPENGL_ES_2
|
||||||
|
ewol::openGL::Pop();
|
||||||
|
#else
|
||||||
|
glPopMatrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit ff5881a51a76141535a0e2e45c5d47bc1730b1df
|
Subproject commit 871233acc6e0d578b5aaedca8f5dc82c7d2132e2
|
Loading…
x
Reference in New Issue
Block a user