- Timestamp:
- May 31, 2006, 1:30:25 AM (18 years ago)
- Location:
- branches/gui/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/defs/class_id.h
r7919 r8008 336 336 CL_GLGUI_INPUTLINE = 0x00000b60, 337 337 CL_GLGUI_TEXTFIELD = 0x00000b61, 338 CL_GLGUI_IMAGE = 0x00000b70, 338 339 339 340 // QT_GUI -
branches/gui/src/lib/gui/gl_gui/Makefile.am
r7919 r8008 25 25 glgui_inputline.cc \ 26 26 glgui_textfield.cc \ 27 glgui_image.cc \ 27 28 glgui_window.cc \ 28 29 glgui_cursor.cc … … 47 48 glgui_inputline.h \ 48 49 glgui_textfield.h \ 50 glgui_image.h \ 49 51 glgui_window.h \ 50 52 glgui_cursor.h -
branches/gui/src/lib/gui/gl_gui/glgui.h
r7928 r8008 22 22 #include "glgui_inputline.h" 23 23 #include "glgui_textfield.h" 24 #include "glgui_image.h" 24 25 25 26 -
branches/gui/src/lib/gui/gl_gui/glgui_image.cc
r7779 r8008 43 43 void GLGuiImage::init() 44 44 { 45 this->setClassID(CL_GLGUI_, "GLGuiImage"); 45 this->setClassID(CL_GLGUI_IMAGE, "GLGuiImage"); 46 47 this->frontMaterial().setDiffuseMap(this->texture); 48 49 this->resize(); 50 } 51 52 53 void GLGuiImage::loadImageFromTexture(const Texture& texture) 54 { 55 this->texture = texture; 56 } 57 58 void GLGuiImage::loadImageFromFile(const std::string& fileName) 59 { 60 this->texture.loadImage(fileName); 61 } 62 63 void GLGuiImage::loadImageFromSDLSurface(SDL_Surface* surface) 64 { 65 //this->texture.loadSurface(surface); 66 } 67 68 void GLGuiImage::loadImageFromDisplayList(GLuint texture) 69 { 70 // this->texture.setTexture(texture); 71 } 72 73 void GLGuiImage::resize() 74 { 75 this->frontRect().setTopLeft(1, 1); 76 this->frontRect().setSize(this->getSizeX2D() -2, this->getSizeY2D() -2); 77 GLGuiWidget::resize(); 78 } 79 80 81 /** 82 * @brief draws the GLGuiImage 83 */ 84 void GLGuiImage::draw() const 85 { 86 this->beginDraw(); 87 GLGuiWidget::draw(); 88 89 this->frontMaterial().select(); 90 this->drawRect(this->frontRect()); 91 this->endDraw(); 92 46 93 47 94 } 48 49 /**50 * draws the GLGuiImage51 */52 void GLGuiImage::draw()53 {54 }55 95 } -
branches/gui/src/lib/gui/gl_gui/glgui_image.h
r7779 r8008 8 8 #define _GLGUI_IMAGE_H 9 9 10 #include " base_object.h"10 #include "glgui_widget.h" 11 11 12 12 // FORWARD DECLARATION … … 26 26 virtual ~GLGuiImage(); 27 27 28 void init(); 29 void loadImageFromFile(const char* fileName); 28 void loadImageFromTexture(const Texture& texture); 29 30 void loadImageFromFile(const std::string& fileName); 30 31 void loadImageFromSDLSurface(SDL_Surface* surface); 31 void loadImageFromDisplayList(GLuint displayList);32 void loadImageFromDisplayList(GLuint texture); 32 33 33 virtual void draw(); 34 virtual void draw() const; 35 36 DeclareSignal0(imageChanged); 34 37 35 38 private: 39 void init(); 40 virtual void resize(); 36 41 42 private: 43 Texture texture; 37 44 }; 38 45 } -
branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.cc
r7985 r8008 98 98 99 99 this->frontMaterial().select(); 100 glBegin(GL_QUADS); 101 102 glTexCoord2i(0,0); glVertex2d(1, 1); 103 glTexCoord2i(0,1); glVertex2d(1, this->getSizeY2D() - 1); 104 glTexCoord2i(1,1); glVertex2d(this->getSizeX2D() - 1, this->getSizeY2D() -1); 105 glTexCoord2i(1,0); glVertex2d(this->getSizeX2D() - 1, 1); 106 107 glEnd(); 100 this->drawRect(this->frontRect()); 108 101 this->endDraw(); 109 102 // this->label->draw(); -
branches/gui/src/lib/gui/gl_gui/glgui_textfield.cc
r7919 r8008 43 43 { 44 44 this->setClassID(CL_GLGUI_TEXTFIELD, "GLGuiTextfield"); 45 46 47 45 } 48 46 49 47 /** 50 * draws the GLGuiTextfield48 * @brief draws the GLGuiTextfield 51 49 */ 52 50 void GLGuiTextfield::draw() const 53 51 { 52 this->beginDraw(); 53 GLGuiWidget::draw(); 54 55 this->frontMaterial().select(); 56 this->drawRect(this->frontRect()); 57 this->endDraw(); 54 58 } 55 59 } -
branches/gui/src/lib/gui/gl_gui/glgui_widget.cc
r7988 r8008 163 163 ; 164 164 165 void GLGuiWidget::setWidgetSize(const Vector2D& size) 166 { 167 this->setSize2D(size); 168 this->resize(); 169 170 } 171 172 173 void GLGuiWidget::setWidgetSize(float x, float y) 174 { 175 this->setWidgetSize(Vector2D(x, y)); 176 } 165 177 166 178 -
branches/gui/src/lib/gui/gl_gui/glgui_widget.h
r8002 r8008 88 88 void setBorderSize(float borderSize); 89 89 90 void setWidgetSize(const Vector2D& size); 91 void setWidgetSize(float x, float y); 92 90 93 91 94 void setBackgroundColor(float x, float y, float z) { this->backMaterial().setDiffuse(x,y,z); }; -
branches/gui/src/story_entities/simple_game_menu.cc
r8007 r8008 114 114 box->showAll(); 115 115 116 OrxGui::GLGuiImage* image = new OrxGui::GLGuiImage(); 117 image->show(); 118 image->setWidgetSize(200, 200); 119 image->setAbsCoor2D(300, 300); 116 120 117 121 OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider();
Note: See TracChangeset
for help on using the changeset viewer.