Browse Source

Call TextureEditor::update() from TextureMappingState

master
Krisjanis Rijnieks 9 years ago
parent
commit
027e763c61
  1. 4
      src/Application/States/TextureMappingState.cpp
  2. 2
      src/Application/States/TextureMappingState.h
  3. 6
      src/UserInterface/TextureEditor.cpp
  4. 2
      src/UserInterface/TextureEditor.h

4
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);

2
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);

6
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;
}

2
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);

Loading…
Cancel
Save