Changeset 3675 in orxonox.OLD for orxonox/trunk/src/glmenu
- Timestamp:
- Mar 30, 2005, 5:20:21 PM (20 years ago)
- Location:
- orxonox/trunk/src/glmenu
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/glmenu/glmenu_imagescreen.cc
r3658 r3675 110 110 void GLMenuImageScreen::draw () 111 111 { 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 112 137 113 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 114 115 116 //PRINTF()(); 117 printf("GLMenuImagEscreen::draw() - drawing step %i/%i\n", 118 this->currentValue, this->maxValue); 138 119 139 120 /* screen size */ … … 154 135 int barWidth = 230; 155 136 int barHeight = 30; 156 157 int val = (int)((float)this->currentValue/(float)this->maxValue) * barWidth; 137 138 float val = ((float)this->currentValue/(float)this->maxValue) * barWidth; 139 if( val > (float)barWidth) 140 val = (float)barWidth; 158 141 159 142 glMatrixMode(GL_PROJECTION); … … 170 153 glDisable(GL_LIGHTING); 171 154 155 /* draw the progress bar */ 172 156 glBegin(GL_QUADS); 173 157 glColor3f(0.96, 0.84, 0.34); 174 158 glVertex2i(barX, barY); 175 glVertex2i(barX + val, barY);176 glVertex2i(barX + val, barY + barHeight);159 glVertex2i(barX + (int)val, barY); 160 glVertex2i(barX + (int)val, barY + barHeight); 177 161 glVertex2i(barX, barY + barHeight); 178 162 glColor3f(1.0, 1.0, 1.0); … … 223 207 glPopAttrib(); 224 208 225 SDL_GL_SwapBuffers(); 209 SDL_GL_SwapBuffers(); 226 210 } 227 211 -
orxonox/trunk/src/glmenu/glmenu_imagescreen.h
r3544 r3675 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.