Changeset 8035 in orxonox.OLD for trunk/src/lib/gui/gl_gui/glgui_image.cc
- Timestamp:
- May 31, 2006, 4:20:51 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl_gui/glgui_image.cc
r7779 r8035 43 43 void GLGuiImage::init() 44 44 { 45 this->setClassID(CL_GLGUI_ , "GLGuiImage");45 this->setClassID(CL_GLGUI_IMAGE, "GLGuiImage"); 46 46 47 this->frontMaterial().setDiffuseMap(this->texture); 48 this->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 49 50 this->resize(); 47 51 } 48 52 53 54 void GLGuiImage::loadImageFromTexture(const Texture& texture) 55 { 56 this->frontMaterial().setDiffuseMap(texture); 57 this->frontMaterial().setDiffuse(1,1,1); 58 } 59 60 void GLGuiImage::loadImageFromFile(const std::string& fileName) 61 { 62 this->texture.loadImage(fileName); 63 } 64 65 void GLGuiImage::loadImageFromSDLSurface(SDL_Surface* surface) 66 { 67 //this->texture.loadSurface(surface); 68 } 69 70 void GLGuiImage::loadImageFromDisplayList(GLuint texture) 71 { 72 // this->texture.setTexture(texture); 73 } 74 75 void GLGuiImage::resize() 76 { 77 this->frontRect().setTopLeft(this->borderSize(), this->borderSize()); 78 this->frontRect().setSize(this->getSizeX2D() -2.0*this->borderSize(), this->getSizeY2D() - 2.0* this->borderSize() ); 79 GLGuiWidget::resize(); 80 } 81 82 49 83 /** 50 * draws the GLGuiImage84 * @brief draws the GLGuiImage 51 85 */ 52 void GLGuiImage::draw() 86 void GLGuiImage::draw() const 53 87 { 88 this->beginDraw(); 89 GLGuiWidget::draw(); 90 91 this->frontMaterial().select(); 92 this->drawRect(this->frontRect()); 93 this->endDraw(); 54 94 } 55 95 }
Note: See TracChangeset
for help on using the changeset viewer.