Changeset 8299 in orxonox.OLD for trunk/src/lib/gui/gl
- Timestamp:
- Jun 9, 2006, 3:17:28 AM (19 years ago)
- Location:
- trunk/src/lib/gui/gl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl/glgui_cursor.cc
r8298 r8299 21 21 #include "color.h" 22 22 #include "texture_sequence.h" 23 23 #include "loading/resource_manager.h" // HACK 24 24 25 25 namespace OrxGui … … 62 62 this->backMaterial().setDiffuseMap("cursor.png"); 63 63 this->backMaterial().setBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 64 this->setSize2D( 20, 30);64 this->setSize2D(50, 50); 65 65 this->setAbsCoor2D(100, 100); 66 66 this->setLayer(E2D_LAYER_ABOVE_ALL); 67 67 this->color = 0.0f; 68 68 69 TextureSequence*seq = new TextureSequence();70 seq->loadImageSeries("reap_mouse/reap_mouse_##", 0, 49, "tif");69 this->seq = new TextureSequence(); 70 this->seq->loadImageSeries(ResourceManager::getInstance()->getDataDir() + "/maps/reap_mouse/reap_mouse_##", 0, 49, "tif"); 71 71 72 72 this->resize(); … … 75 75 void GLGuiCursor::tick(float dt) 76 76 { 77 this->frameNumber += 25.0*dt; 78 if (frameNumber >= this->seq->getFrameCount()) 79 frameNumber = 0.0; 80 77 81 this->color += dt*10.0; 78 82 if (this->color > 360.0) … … 106 110 { 107 111 this->beginDraw(); 108 GLGuiWidget::draw(); 112 // HACK 113 glActiveTexture(GL_TEXTURE0); 114 glEnable(GL_TEXTURE_2D); 115 glBindTexture(GL_TEXTURE_2D, this->seq->getFrameTexture((int)frameNumber)); 116 glColor3f(1,1,1); 117 glEnable(GL_BLEND); 118 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 119 this->drawRect(this->backRect()); 120 121 //GLGuiWidget::draw(); 109 122 this->endDraw(); 110 123 } -
trunk/src/lib/gui/gl/glgui_cursor.h
r8145 r8299 11 11 #include "event_listener.h" 12 12 #include "vector2D.h" 13 14 class TextureSequence; 13 15 14 16 namespace OrxGui … … 49 51 50 52 static float _mouseSensitivity; 53 TextureSequence* seq; 54 float frameNumber; 51 55 52 56 };
Note: See TracChangeset
for help on using the changeset viewer.