- Timestamp:
- Jun 14, 2006, 11:45:02 PM (18 years ago)
- Location:
- branches/gui/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/graphics/importer/material.h
r8376 r8422 38 38 39 39 void setDiffuse (float r, float g, float b); 40 void setDiffuseColor(const Color& diffuseColor) { this->diffuse = diffuseColor; }; 40 41 void setAmbient (float r, float g, float b); 41 42 void setSpecular (float r, float g, float b); -
branches/gui/src/lib/gui/gl/glgui_image.cc
r8378 r8422 17 17 18 18 #include "glgui_image.h" 19 20 #include "debug.h" 19 21 20 22 namespace OrxGui … … 45 47 this->setClassID(CL_GLGUI_IMAGE, "GLGuiImage"); 46 48 47 // this->frontMaterial().setDiffuseMap(this->texture); 48 // this->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 49 this->_imageMaterial.setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 49 50 50 51 this->resize(); … … 54 55 void GLGuiImage::loadImageFromTexture(const Texture& texture) 55 56 { 56 /* this->frontMaterial().setDiffuseMap(texture); 57 this->frontMaterial().setDiffuse(1,1,1);*/ 57 this->_imageMaterial.setDiffuseMap(texture); 58 58 } 59 59 60 60 void GLGuiImage::loadImageFromFile(const std::string& fileName) 61 61 { 62 this-> texture.loadImage(fileName);62 this->_imageMaterial.setDiffuseMap(fileName); 63 63 } 64 64 65 65 void GLGuiImage::loadImageFromSDLSurface(SDL_Surface* surface) 66 66 { 67 //this->texture.loadSurface(surface);67 this->_imageMaterial.setDiffuseMap(Texture(surface)); 68 68 } 69 69 70 70 void GLGuiImage::loadImageFromDisplayList(GLuint texture) 71 71 { 72 // this->texture.setTexture(texture); 72 PRINTF(2)("SORRY NOT IMPLEMENTED\n"); 73 // this->_imageMaterial.setTexture(texture); 74 } 75 76 void GLGuiImage::updateFrontColor() 77 { 78 this->_imageMaterial.setDiffuseColor(this->frontColor()); 73 79 } 74 80 75 81 void GLGuiImage::resize() 76 82 { 77 /* this->frontRect().setTopLeft(this->borderLeft(), this->borderTop());78 this-> frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) );*/83 this->_imagePlane.setTopLeft(this->borderLeft(), this->borderTop()); 84 this->_imagePlane.setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) ); 79 85 GLGuiWidget::resize(); 80 86 } … … 89 95 GLGuiWidget::draw(); 90 96 91 /* this->frontMaterial().select();*/ 92 /* this->drawRect(this->frontRect());*/ 97 this->_imageMaterial.select(); 98 this->drawRect(this->_imagePlane); 93 99 this->endDraw(); 94 100 } -
branches/gui/src/lib/gui/gl/glgui_image.h
r8145 r8422 36 36 DeclareSignal0(imageChanged); 37 37 38 protected: 39 virtual void updateFrontColor(); 40 virtual void resize(); 41 42 38 43 private: 39 44 void init(); 40 virtual void resize();41 45 42 46 private: 43 Texture texture; 47 Rect2D _imagePlane; 48 Material _imageMaterial; 44 49 }; 45 50 }
Note: See TracChangeset
for help on using the changeset viewer.