Changeset 7883 in orxonox.OLD for branches/gui
- Timestamp:
- May 27, 2006, 1:57:33 AM (19 years ago)
- Location:
- branches/gui/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/graphics/importer/material.cc
r7848 r7883 108 108 return true; 109 109 110 111 // setting diffuse color 110 if (likely(Material::selectedMaterial != NULL)) 111 { 112 for(unsigned int i = 0; i < Material::selectedMaterial->textures.size(); ++i) 113 { 114 glActiveTexture(Material::glTextureArbs[i]); 115 //glBindTexture(GL_TEXTURE_2D, 0); 116 glDisable(GL_TEXTURE_2D); 117 } 118 } 119 120 // setting diffuse color 112 121 glColor4f (diffuse[0], diffuse[1], diffuse[2], this->transparency); 113 122 // setting ambient color … … 118 127 glMaterialf(GL_FRONT, GL_SHININESS, this->shininess); 119 128 120 121 129 // setting the transparency 122 130 if (this->transparency < 1.0 || /* This allows alpha blending of 2D textures with the scene */ … … 138 146 glShadeModel(GL_SMOOTH); 139 147 140 if (likely(Material::selectedMaterial != NULL))141 {142 for(unsigned int i = 0; i < Material::selectedMaterial->textures.size(); ++i)143 {144 glActiveTexture(Material::glTextureArbs[i]);145 glBindTexture(GL_TEXTURE_2D, 0);146 glDisable(GL_TEXTURE_2D);147 }148 }149 148 150 149 for(unsigned int i = 0; i < this->textures.size(); ++i) … … 159 158 } 160 159 Material::selectedMaterial = this; 161 162 /* if (this->diffuseTexture != NULL)163 {164 glEnable(GL_TEXTURE_2D);165 glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());166 }167 else168 {169 glDisable(GL_TEXTURE_2D);170 glBindTexture(GL_TEXTURE_2D, 0);171 }*/172 160 } 173 161 -
branches/gui/src/lib/gui/gl_gui/glgui_button.cc
r7882 r7883 54 54 this->setClickable(true); 55 55 56 this->label.setFont("fonts/final_frontier.ttf", 20); 57 this->frontMaterial().setDiffuse(1, 0, 0); 58 56 59 this->label.setParent2D(this); 57 60 } 61 58 62 59 63 void GLGuiButton::setLabel(const std::string& label) -
branches/gui/src/lib/gui/gl_gui/glgui_button.h
r7881 r7883 27 27 //! This is part of the openglGUI class 28 28 /** 29 * 29 * The Button is an Abstract class, that can be pushed to Toggle its state. 30 30 */ 31 31 class GLGuiButton : public GLGuiWidget -
branches/gui/src/lib/gui/gl_gui/glgui_handler.cc
r7882 r7883 38 38 39 39 this->cursor = NULL; 40 //this->subscribeEvent() 40 for (unsigned int i = 0; i < EV_NUMBER; i++) 41 { 42 this->subscribeEvent(ES_MENU, i); 43 } 41 44 42 45 } … … 86 89 void GLGuiHandler::process(const Event &event) 87 90 { 91 if (event.type == EV_MOUSE_BUTTON_LEFT) 92 { 88 93 94 if (GLGuiWidget::focused() != NULL) 95 { 96 if (event.bPressed) 97 GLGuiWidget::focused()->click(); 98 else 99 GLGuiWidget::focused()->release(); 100 } 101 } 89 102 90 103 } -
branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.cc
r7881 r7883 54 54 printf("%s received focus\n", this->getLabel().c_str()); 55 55 56 Vector test; 57 this->frontMaterial().getDiffuseColor(test.x, test.y, test.z); 58 test.debug(); 56 59 } 57 60 void GLGuiPushButton::removedFocus() … … 61 64 } 62 65 66 void GLGuiPushButton::clicked() 67 { 68 printf("%s clicked\n", this->getLabel().c_str()); 69 } 70 71 72 void GLGuiPushButton::released() 73 { 74 printf("%s released\n", this->getLabel().c_str()); 75 } 63 76 64 77 … … 72 85 GLGuiButton::draw(); 73 86 74 this->frontMat .select();87 this->frontMaterial().select(); 75 88 glBegin(GL_QUADS); 76 89 … … 81 94 82 95 glEnd(); 83 84 96 this->endDraw(); 85 97 // this->label->draw(); -
branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.h
r7881 r7883 29 29 virtual void receivedFocus(); 30 30 virtual void removedFocus(); 31 virtual void clicked(); 32 virtual void released(); 33 34 31 35 virtual void draw() const; 32 36 virtual void update(); -
branches/gui/src/lib/gui/gl_gui/glgui_widget.cc
r7882 r7883 60 60 61 61 this->backMat.setDiffuse(1.0, 1.0, 1.0); 62 this->frontMat.setDiffuse(1.0, 0.0, 0.0); 62 63 63 64 this->frontModel = 0; 65 this->backModel = 0; 64 66 65 67 this->widgetSignals.resize(SignalCount, SignalConnector()); -
branches/gui/src/lib/gui/gl_gui/glgui_widget.h
r7882 r7883 79 79 bool clickable() const { return this->_clickable; }; 80 80 void setClickable(bool clickable = true) { this->_clickable = clickable; }; 81 81 void click() { this->clicked(); }; 82 void release() { this->released(); }; 82 83 83 84 virtual void update() {}; … … 98 99 protected: 99 100 // if something was clickt on the GUI-widget. 100 virtual void clicked( const Event& event) {};101 virtual void released( const Event& event) {};101 virtual void clicked() {}; 102 virtual void released() {}; 102 103 103 104 virtual void receivedFocus() {}; -
branches/gui/src/story_entities/simple_game_menu.cc
r7880 r7883 66 66 pb->show(); 67 67 pb->setAbsCoor2D(50, 50); 68 69 OrxGui::GLGuiPushButton* dnpb = new OrxGui::GLGuiPushButton("DO NOT PUSH ME"); 70 dnpb->show(); 71 dnpb->setAbsCoor2D(350, 50); 72 73 OrxGui::GLGuiPushButton* rdnpb = new OrxGui::GLGuiPushButton("REALLY DO NOT PUSH ME!!"); 74 rdnpb->show(); 75 rdnpb->setAbsCoor2D(200, 180); 76 68 77 69 78 OrxGui::GLGuiHandler::getInstance()->activateCursor();
Note: See TracChangeset
for help on using the changeset viewer.