Changeset 3746 in orxonox.OLD for orxonox/branches/levelloader/src/glmenu
- Timestamp:
- Apr 7, 2005, 3:54:49 PM (20 years ago)
- Location:
- orxonox/branches/levelloader/src/glmenu
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.cc
r3605 r3746 41 41 { 42 42 this->setClassName ("GLMenuImageScreen"); 43 this->init(); 43 44 } 44 45 … … 50 51 GLMenuImageScreen::~GLMenuImageScreen() 51 52 { 52 if ( backMat)53 delete backMat;53 if (this->backMat) 54 delete this->backMat; 54 55 } 55 56 … … 81 82 // Select Our VU Meter Background Texture 82 83 this->backMat = new Material("load_screen"); 83 this->backMat->setDiffuseMap(" ../data/pictures/load_screen.jpg");84 this->backMat->setDiffuseMap("pictures/load_screen.jpg"); 84 85 this->maxValue = 10; 85 86 this->currentValue = 0; … … 110 111 void GLMenuImageScreen::draw () 111 112 { 112 /*113 // Display a quad texture to the screen114 glEnable(GL_TEXTURE_2D);115 glBegin(GL_QUADS);116 117 // Display the top left vertice118 glTexCoord2f(0.0f, 1.0f);119 glVertex3f(-2.5, 2.5, 0);120 121 // Display the bottom left vertice122 glTexCoord2f(0.0f, 0.0f);123 glVertex3f(-2.5, -2.5, 0);124 125 // Display the bottom right vertice126 glTexCoord2f(1.0f, 0.0f);127 glVertex3f(2.5, -2.5, 0);128 129 // Display the top right vertice130 glTexCoord2f(1.0f, 1.0f);131 glVertex3f(2.5, 2.5, 0);132 133 glEnd();134 glEnable(GL_TEXTURE_2D);135 */136 113 137 114 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 115 116 PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n", 117 this->currentValue, this->maxValue); 138 118 139 119 /* screen size */ … … 154 134 int barWidth = 230; 155 135 int barHeight = 30; 156 157 int val = (int)((float)this->currentValue/(float)this->maxValue) * barWidth; 136 137 float val = ((float)this->currentValue/(float)this->maxValue) * barWidth; 138 if( val > (float)barWidth) 139 val = (float)barWidth; 158 140 159 141 glMatrixMode(GL_PROJECTION); … … 170 152 glDisable(GL_LIGHTING); 171 153 154 /* draw the progress bar */ 172 155 glBegin(GL_QUADS); 173 156 glColor3f(0.96, 0.84, 0.34); 174 157 glVertex2i(barX, barY); 175 glVertex2i(barX + val, barY);176 glVertex2i(barX + val, barY + barHeight);158 glVertex2i(barX + (int)val, barY); 159 glVertex2i(barX + (int)val, barY + barHeight); 177 160 glVertex2i(barX, barY + barHeight); 178 161 glColor3f(1.0, 1.0, 1.0); … … 223 206 glPopAttrib(); 224 207 225 SDL_GL_SwapBuffers(); 208 SDL_GL_SwapBuffers(); 226 209 } 227 210 -
orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.h
r3605 r3746 45 45 float offsetX, offsetY; //!< offset of the image from left and up 46 46 Material* backMat; //!< Background Material. 47 48 /* progress bar values */ 47 49 int currentValue; //!< the current count of step() calls fired yet 48 50 int maxValue; //!< total count of steps
Note: See TracChangeset
for help on using the changeset viewer.