[DEV] display scene is back
This commit is contained in:
parent
c84caed8ba
commit
03876b5a71
@ -43,7 +43,10 @@ game::Element::~Element(void)
|
|||||||
void game::Element::Draw(void)
|
void game::Element::Draw(void)
|
||||||
{
|
{
|
||||||
if (NULL != m_resource) {
|
if (NULL != m_resource) {
|
||||||
m_resource->Draw();
|
m_property.m_matrix = etk::matScale(vec3(100,100,100) )
|
||||||
|
/* etk::matRotate(m_property.m_angle, rotx)*/
|
||||||
|
* etk::matTranslate(vec3(0.01,0.0,0.0));
|
||||||
|
m_resource->Draw(m_property.m_matrix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ void game::Engine::Process(int64_t lastTime, int32_t deltaTime)
|
|||||||
|
|
||||||
void game::Engine::Draw(ewol::DrawProperty& displayProp)
|
void game::Engine::Draw(ewol::DrawProperty& displayProp)
|
||||||
{
|
{
|
||||||
|
EWOL_DEBUG("Draw ...");
|
||||||
for (int32_t iii=0; iii<m_elementsStatic.Size() ; iii++) {
|
for (int32_t iii=0; iii<m_elementsStatic.Size() ; iii++) {
|
||||||
if (NULL != m_elementsStatic[iii]) {
|
if (NULL != m_elementsStatic[iii]) {
|
||||||
m_elementsStatic[iii]->Draw();
|
m_elementsStatic[iii]->Draw();
|
||||||
|
@ -37,7 +37,7 @@ ewol::Mesh::~Mesh(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ewol::Mesh::Draw(void)
|
void ewol::Mesh::Draw(mat4& positionMatrix)
|
||||||
{
|
{
|
||||||
static float rotx = 0;
|
static float rotx = 0;
|
||||||
static float roty = 0;
|
static float roty = 0;
|
||||||
@ -61,12 +61,7 @@ void ewol::Mesh::Draw(void)
|
|||||||
m_GLprogram->Use();
|
m_GLprogram->Use();
|
||||||
// set Matrix : translation/positionMatrix
|
// set Matrix : translation/positionMatrix
|
||||||
mat4 tmpMatrix = ewol::openGL::GetMatrix();
|
mat4 tmpMatrix = ewol::openGL::GetMatrix();
|
||||||
tmpMatrix = etk::matScale(vec3(100,100,100) )
|
tmpMatrix = positionMatrix * tmpMatrix;
|
||||||
* etk::matRotate(vec3(1,0,0), rotx)
|
|
||||||
* etk::matRotate(vec3(0,1,0), roty)/*
|
|
||||||
* etk::matTranslate(vec3(0.01,0.0,0.0))
|
|
||||||
* etk::matRotate(vec3(0,0,1), rotz)*/
|
|
||||||
* 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());
|
||||||
|
@ -34,7 +34,7 @@ namespace ewol
|
|||||||
Mesh(etk::UString genName);
|
Mesh(etk::UString genName);
|
||||||
virtual ~Mesh(void);
|
virtual ~Mesh(void);
|
||||||
virtual const char* GetType(void) { return "ewol::Mesh"; };
|
virtual const char* GetType(void) { return "ewol::Mesh"; };
|
||||||
virtual void Draw(void);
|
virtual void Draw(mat4& positionMatrix);
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -137,23 +137,3 @@ ewol::MeshObj::MeshObj(etk::UString _fileName) :
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
// Read our .obj file
|
|
||||||
std::vector vertices;
|
|
||||||
std::vector uvs;
|
|
||||||
std::vector normals; // Won't be used at the moment.
|
|
||||||
bool res = loadOBJ("cube.obj", vertices, uvs, normals);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(glm::vec3), &vertices[0], GL_STATIC_DRAW);
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
@ -34,22 +34,7 @@ widget::Scene::~Scene(void)
|
|||||||
void widget::Scene::OnRegenerateDisplay(void)
|
void widget::Scene::OnRegenerateDisplay(void)
|
||||||
{
|
{
|
||||||
if (true == NeedRedraw()) {
|
if (true == NeedRedraw()) {
|
||||||
/*
|
|
||||||
// clean elements
|
|
||||||
for (int32_t iii=0; iii<m_sceneElement.animated.Size(); iii++) {
|
|
||||||
if (NULL != m_sceneElement.animated[iii]) {
|
|
||||||
m_sceneElement.animated[iii]->Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
|
|
||||||
for (int32_t iii=0; iii<m_sceneElement.listAnimatedElements[jjj].Size(); iii++) {
|
|
||||||
if (NULL != m_sceneElement.listAnimatedElements[jjj][iii]) {
|
|
||||||
// find an empty slot ...
|
|
||||||
m_sceneElement.listAnimatedElements[jjj][iii]->Draw();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,16 +114,13 @@ void widget::Scene::GenDraw(ewol::DrawProperty displayProp)
|
|||||||
m_size.x,
|
m_size.x,
|
||||||
m_size.y);
|
m_size.y);
|
||||||
float ratio = m_size.x / m_size.y;
|
float ratio = m_size.x / m_size.y;
|
||||||
if (true) {
|
if (false) {
|
||||||
mat4 tmpTranslate = etk::matTranslate(vec3(-m_size.x/2, -m_size.y/2, -1.0f));
|
mat4 tmpTranslate = etk::matTranslate(vec3(-m_size.x/2, -m_size.y/2, -1.0f));
|
||||||
mat4 tmpScale = etk::matScale(vec3(m_zoom, m_zoom, 1.0f));
|
mat4 tmpScale = etk::matScale(vec3(m_zoom, m_zoom, 1.0f));
|
||||||
mat4 tmpProjection = etk::matPerspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
|
mat4 tmpProjection = etk::matPerspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
|
||||||
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
|
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
|
||||||
// set internal matrix system :
|
// set internal matrix system :
|
||||||
ewol::openGL::SetMatrix(tmpMat);
|
ewol::openGL::SetMatrix(tmpMat);
|
||||||
// Call the widget drawing methode
|
|
||||||
displayProp.m_origin = m_origin;
|
|
||||||
displayProp.m_size = m_size;
|
|
||||||
} else {
|
} else {
|
||||||
m_zoom = 1.0/1000.0;
|
m_zoom = 1.0/1000.0;
|
||||||
//EWOL_INFO("ratio : " << ratio);
|
//EWOL_INFO("ratio : " << ratio);
|
||||||
@ -154,11 +136,11 @@ void widget::Scene::GenDraw(ewol::DrawProperty displayProp)
|
|||||||
mat4 tmpMat = tmpProjection * tmpScale;
|
mat4 tmpMat = tmpProjection * tmpScale;
|
||||||
// set internal matrix system :
|
// set internal matrix system :
|
||||||
ewol::openGL::SetMatrix(tmpMat);
|
ewol::openGL::SetMatrix(tmpMat);
|
||||||
// Clear the screen with transparency ...
|
|
||||||
glClearColor(0.0, 0.0, 0.0, 1.0);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
||||||
}
|
}
|
||||||
// Call the widget drawing methode
|
// Call the widget drawing methode
|
||||||
|
displayProp.m_origin = m_origin;
|
||||||
|
displayProp.m_size = m_size;
|
||||||
|
// Call the widget drawing methode
|
||||||
OnDraw(displayProp);
|
OnDraw(displayProp);
|
||||||
|
|
||||||
ewol::openGL::Pop();
|
ewol::openGL::Pop();
|
||||||
|
@ -34,9 +34,6 @@ static const char * l_eventChangeWidgetNext = "event-change-widget-test-nex
|
|||||||
static const char * l_eventChangeWidgetPrevious = "event-change-widget-test-previous";
|
static const char * l_eventChangeWidgetPrevious = "event-change-widget-test-previous";
|
||||||
|
|
||||||
|
|
||||||
static const char * l_basicLabel = "Test software for EWOL";
|
|
||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "MainWindows"
|
#define __class__ "MainWindows"
|
||||||
|
|
||||||
@ -88,14 +85,8 @@ MainWindows::MainWindows(void) :
|
|||||||
mySpacer->SetColor(0x000000FF);
|
mySpacer->SetColor(0x000000FF);
|
||||||
m_sizerVert->SubWidgetAdd(mySpacer);
|
m_sizerVert->SubWidgetAdd(mySpacer);
|
||||||
}
|
}
|
||||||
// basic generation ...
|
// add the basic widget with a strange methode ...
|
||||||
m_subWidget = (ewol::Widget*)new widget::Label(l_basicLabel);
|
OnReceiveMessage(NULL, NULL, "");
|
||||||
if (NULL != m_subWidget) {
|
|
||||||
m_subWidget->SetExpendX(true);
|
|
||||||
m_subWidget->SetExpendY(true);
|
|
||||||
m_sizerVert->SubWidgetAdd(m_subWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -107,8 +98,10 @@ MainWindows::~MainWindows(void)
|
|||||||
|
|
||||||
void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||||
{
|
{
|
||||||
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
|
if( CallerObject != this
|
||||||
|
&& CallerObject != NULL) {
|
||||||
|
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
|
||||||
|
}
|
||||||
APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
|
APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
|
||||||
if (eventId == l_eventChangeTheme) {
|
if (eventId == l_eventChangeTheme) {
|
||||||
if (data=="1") {
|
if (data=="1") {
|
||||||
@ -130,12 +123,16 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
|
|||||||
// inn theory it must be removed ...
|
// inn theory it must be removed ...
|
||||||
m_subWidget = NULL;
|
m_subWidget = NULL;
|
||||||
}
|
}
|
||||||
|
// special init forcing ...
|
||||||
|
if(CallerObject == NULL) {
|
||||||
|
m_idWidget = 4;
|
||||||
|
}
|
||||||
switch(m_idWidget)
|
switch(m_idWidget)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
m_idWidget = 0;
|
m_idWidget = 0;
|
||||||
case 0:
|
case 0:
|
||||||
m_subWidget = (ewol::Widget*)new widget::Label(l_basicLabel);
|
m_subWidget = (ewol::Widget*)new widget::Label("Test software for EWOL");
|
||||||
if (NULL != m_subWidget) {
|
if (NULL != m_subWidget) {
|
||||||
m_subWidget->SetExpendX(true);
|
m_subWidget->SetExpendX(true);
|
||||||
m_subWidget->SetExpendY(true);
|
m_subWidget->SetExpendY(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user