From 7aa4f9ae4d310bdccb3f5e98e8ce6b1092e9b9d3 Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Thu, 11 Oct 2012 18:05:56 +0200 Subject: [PATCH] [DEV] set the reload of the shader --- Sources/appl/Gui/MainWindows.cpp | 11 +++++++++-- Sources/appl/globalMsg.cpp | 1 + Sources/appl/globalMsg.h | 1 + Sources/appl/init.cpp | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Sources/appl/Gui/MainWindows.cpp b/Sources/appl/Gui/MainWindows.cpp index 3290118..8fa6aed 100644 --- a/Sources/appl/Gui/MainWindows.cpp +++ b/Sources/appl/Gui/MainWindows.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -83,7 +84,7 @@ class ParameterAboutGui : public ewol::SizerVert AddElement(" Website : https://github.com/HeeroYui/ewol"); AddElement(" Licence : BSD like"); AddElement(" Copyright 2010 Edouard DUPIN, all right reserved"); - AddElement(" Supported OS : Linux, Android" ); + AddElement(" Supported OS : Linux, Windows, Android" ); AddElement(etk::UString(" OpenGl librairy : v") + ewol::GetVersion() ); AddElement("Ewol", true); AddElement(""); @@ -253,6 +254,8 @@ MainWindows::MainWindows(void) (void)myMenu->AddSpacer(); (void)myMenu->Add(idMenugDisplay, "Color Black", "", ednMsgGuiChangeColor, "Black"); (void)myMenu->Add(idMenugDisplay, "Color White", "", ednMsgGuiChangeColor, "White"); + (void)myMenu->AddSpacer(); + (void)myMenu->Add(idMenugDisplay, "Reload OpenGl Shader", "", ednMsgGuiReloadShader); m_widgetLabelFileName = new ewol::Label("FileName"); m_widgetLabelFileName->SetExpendX(true); @@ -266,6 +269,7 @@ MainWindows::MainWindows(void) // to update the title ... RegisterMultiCast(ednMsgBufferState); RegisterMultiCast(ednMsgBufferId); + RegisterMultiCast(ednMsgGuiReloadShader); } @@ -289,7 +293,7 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev { ewol::Windows::OnReceiveMessage(CallerObject, eventId, data); - //APPL_INFO("Receive Event from the main windows ... : widgetid=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" ); + //APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" ); // Open file Section ... if (eventId == ednMsgGuiOpen) { ewol::FileChooser* tmpWidget = new ewol::FileChooser(); @@ -414,6 +418,9 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev DF_SoftEdge_min = DF_SoftEdge_max; tmpSliderMin->SetValue(DF_SoftEdge_min*1000.0); } + } else if (eventId == ednMsgGuiReloadShader) { + ewol::resource::ReLoadResources(); + ewol::ForceRedrawAll(); } return; diff --git a/Sources/appl/globalMsg.cpp b/Sources/appl/globalMsg.cpp index ddf04b2..1a1969c 100644 --- a/Sources/appl/globalMsg.cpp +++ b/Sources/appl/globalMsg.cpp @@ -56,6 +56,7 @@ extern const char* const ednMsgGuiShowEndOfLine = "edn-Msg-Gui-ShowEndOfLine"; extern const char* const ednMsgGuiCtags = "edn-Msg-Gui-CTags"; +extern const char* const ednMsgGuiReloadShader = "edn-Msg-Gui-ReloadOpenGlShader"; //////////////////////////////////////////////////////////////////////// diff --git a/Sources/appl/globalMsg.h b/Sources/appl/globalMsg.h index 83fbb7e..efb9b86 100644 --- a/Sources/appl/globalMsg.h +++ b/Sources/appl/globalMsg.h @@ -56,6 +56,7 @@ extern const char* const ednMsgGuiCtags; // data : "Load" "ReLoad" "Jump" "Back" + extern const char* const ednMsgGuiReloadShader; // data : "" //////////////////////////////////////////////////////////////////////// diff --git a/Sources/appl/init.cpp b/Sources/appl/init.cpp index 71a93b3..5f9282d 100644 --- a/Sources/appl/init.cpp +++ b/Sources/appl/init.cpp @@ -133,6 +133,7 @@ void APP_Init(void) ewol::shortCut::Add("ctrl+l", ednMsgGuiGotoLine, "???"); ewol::shortCut::Add("ctrl+f", ednMsgGuiSearch, ""); + ewol::shortCut::Add("F12", ednMsgGuiReloadShader, ""); // add files