diff --git a/src/Application/States/TextureMappingState.cpp b/src/Application/States/TextureMappingState.cpp index 949f3ca..cc62a3d 100644 --- a/src/Application/States/TextureMappingState.cpp +++ b/src/Application/States/TextureMappingState.cpp @@ -19,6 +19,10 @@ TextureMappingState::TextureMappingState(){ _drawMode = 0; } +void TextureMappingState::update(Application * app){ + app->getGui()->getTextureEditor()->update(); +} + void TextureMappingState::draw(Application * app){ ofPushMatrix(); ofTranslate(_canvasTranslate.x, _canvasTranslate.y); diff --git a/src/Application/States/TextureMappingState.h b/src/Application/States/TextureMappingState.h index a8e70eb..275226f 100644 --- a/src/Application/States/TextureMappingState.h +++ b/src/Application/States/TextureMappingState.h @@ -21,6 +21,8 @@ class TextureMappingState : public ApplicationBaseState { public: static TextureMappingState * instance(); + + void update(Application * app); void draw(Application * app); void onKeyPressed(Application * app, ofKeyEventArgs & args); void onBackgroundPressed(Application * app, GuiBackgroundEvent & e); diff --git a/src/UserInterface/TextureEditor.cpp b/src/UserInterface/TextureEditor.cpp index 8210272..d5ab581 100644 --- a/src/UserInterface/TextureEditor.cpp +++ b/src/UserInterface/TextureEditor.cpp @@ -14,11 +14,11 @@ TextureEditor::~TextureEditor(){ } void TextureEditor::registerAppEvents(){ - ofAddListener(ofEvents().update, this, &TextureEditor::update); + //ofAddListener(ofEvents().update, this, &TextureEditor::update); } void TextureEditor::unregisterAppEvents(){ - ofRemoveListener(ofEvents().update, this, &TextureEditor::update); + //ofRemoveListener(ofEvents().update, this, &TextureEditor::update); } void TextureEditor::registerKeyEvents(){ @@ -42,7 +42,7 @@ void TextureEditor::disable(){ unregisterKeyEvents(); } -void TextureEditor::update(ofEventArgs & args){ +void TextureEditor::update(){ if(surface == 0){ return; } diff --git a/src/UserInterface/TextureEditor.h b/src/UserInterface/TextureEditor.h index cc1fe09..8b5a433 100644 --- a/src/UserInterface/TextureEditor.h +++ b/src/UserInterface/TextureEditor.h @@ -23,7 +23,7 @@ class TextureEditor { void enable(); void disable(); - void update(ofEventArgs & args); + void update(); // Maybe the Application pointer would make sense there. Not sure yet. void keyPressed(ofKeyEventArgs & args); void keyReleased(ofKeyEventArgs & args); void mousePressed(ofMouseEventArgs & args);