Changeset 6325 in orxonox.OLD for branches/avi_play/src/lib/graphics
- Timestamp:
- Dec 28, 2005, 12:20:38 AM (19 years ago)
- Location:
- branches/avi_play/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/lib/graphics/importer/media_container.cc
r6324 r6325 174 174 ); 175 175 176 // NOTE: use glTexSubImage2D, it's faster!! // 177 /* Create an OpenGL texture from the surface */ 178 glGenTextures(1, &texture); 179 glBindTexture(GL_TEXTURE_2D, texture); 180 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 181 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 182 // build the Texture 183 glTexImage2D(GL_TEXTURE_2D, 184 0, 185 GL_RGB, 186 surface->w, surface->h, 187 0, 188 GL_RGB, 189 GL_UNSIGNED_BYTE, 190 surface->pixels); 176 if(frame_num == 1) 177 { 178 /* Create an OpenGL texture from the surface */ 179 glGenTextures(1, &texture); 180 glBindTexture(GL_TEXTURE_2D, texture); 181 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 182 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 183 // create the texture 184 glTexImage2D(GL_TEXTURE_2D, 185 0, 186 GL_RGB, 187 surface->w, surface->h, 188 0, 189 GL_RGB, 190 GL_UNSIGNED_BYTE, 191 surface->pixels); 192 } 193 else 194 // update the texture 195 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, surface->w, surface->h, GL_RGB, GL_UNSIGNED_BYTE, surface->pixels); 191 196 // build the MipMaps 192 197 gluBuild2DMipmaps(GL_TEXTURE_2D, -
branches/avi_play/src/lib/graphics/importer/movie_player.cc
r6324 r6325 58 58 status = STOP; 59 59 timer = 0; 60 speed = 1; 60 61 61 62 material = new Material; … … 124 125 current_frame = media_container->getFrameNumber(); 125 126 timer += dt; 126 actuel_frame = timer * fps ;127 actuel_frame = timer * fps * speed; 127 128 128 129 if(actuel_frame != current_frame) … … 151 152 void MoviePlayer::setSpeed(float speed) 152 153 { 153 this->speed = speed; 154 if(speed > 0) 155 this->speed = speed; 154 156 } 155 157
Note: See TracChangeset
for help on using the changeset viewer.