Changeset 3367 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jan 7, 2005, 1:51:16 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/glmenu_imagescreen.cc
r3365 r3367 22 22 using namespace std; 23 23 24 GLMenuImageScreen* GLMenuImageScreen::singletonRef = 0; 25 26 GLMenuImageScreen* GLMenuImageScreen::getInstance() 27 { 28 if( singletonRef == NULL) 29 singletonRef = new GLMenuImageScreen (); 30 return singletonRef; 31 } 24 32 25 33 /** … … 126 134 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 127 135 128 / / Screen Size.136 /* screen size */ 129 137 int screenWidth = 640; 130 138 int screenHeight = 480; 131 139 132 / / Set Image Size.140 /* set image size */ 133 141 int imageWidth = 640; 134 142 int imageHeight = 480; 135 143 136 / / Start pos of image.144 /* start pos of image */ 137 145 int offsetX = (screenWidth - imageWidth)/2; 138 146 int offsetY = (screenHeight - imageHeight)/2; 139 147 140 glEnable(GL_BLEND);141 glEnable(GL_TEXTURE_2D);142 143 glPushAttrib(GL_LIGHTING_BIT | GL_TRANSFORM_BIT);144 145 glDisable(GL_LIGHTING); 148 /* loadbar pos */ 149 int barX = 400; 150 int barY = 50; 151 int barWidth = 230; 152 int barHeight = 30; 153 146 154 glMatrixMode(GL_PROJECTION); 147 155 glPushMatrix(); … … 152 160 glLoadIdentity(); 153 161 glPushMatrix(); 162 154 163 glEnable(GL_BLEND); 155 164 glPushAttrib(GL_LIGHTING_BIT | GL_TRANSFORM_BIT); 165 glDisable(GL_LIGHTING); 166 167 glBegin(GL_QUADS); 168 glColor3f(0.96, 0.84, 0.34); 169 glVertex2i(barX, barY); 170 glVertex2i(barX + barWidth, barY); 171 glVertex2i(barX + barWidth, barY + barHeight); 172 glVertex2i(barX, barY + barHeight); 173 glColor3f(1.0, 1.0, 1.0); 174 glEnd(); 175 176 glEnable(GL_TEXTURE_2D); 156 177 glBegin(GL_QUADS); 157 178 glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY); 158 glTexCoord2i(1, 0 159 glTexCoord2i( 1, 1); glVertex2i(offsetX + imageWidth, offsetY + imageHeight);160 glTexCoord2i( 0, 1); glVertex2i(offsetX, offsetY + imageHeight);179 glTexCoord2i(1, 0); glVertex2i(offsetX + imageWidth, offsetY); 180 glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY + imageHeight); 181 glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY + imageHeight); 161 182 glEnd(); 162 163 183 glDisable(GL_TEXTURE_2D); 164 165 glBegin(GL_QUADS);166 glColor3f(1.0, 0.0, 0.0);167 glVertex2i(100, 100);168 glVertex2i(200, 100);169 glVertex2i(200, 150);170 glVertex2i(100, 150);171 glEnd();172 173 184 174 185 glDisable(GL_BLEND); … … 179 190 180 191 SDL_GL_SwapBuffers(); 181 SDL_Delay( 1000);192 SDL_Delay(5000); 182 193 } 183 194 -
orxonox/trunk/src/glmenu_imagescreen.h
r3365 r3367 17 17 GLMenuImageScreen (); 18 18 ~GLMenuImageScreen (); 19 20 static GLMenuImageScreen* getInstance(); 21 22 static GLMenuImageScreen* singletonRef; 19 23 20 24 void init ();
Note: See TracChangeset
for help on using the changeset viewer.