Changeset 6373 in orxonox.OLD for branches/avi_play/src/lib/graphics/importer/media_container.cc
- Timestamp:
- Dec 31, 2005, 3:26:57 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/lib/graphics/importer/media_container.cc
r6353 r6373 58 58 if (glIsTexture(texture)) 59 59 glDeleteTextures(1, &texture); 60 SDL_FreeSurface(surface);60 //SDL_FreeSurface(surface); 61 61 62 62 // Free the RGB image … … 186 186 ((AVPicture*)RGB_frame)->data[0]+i * 187 187 ((AVPicture*)RGB_frame)->linesize[0], 188 codec_context->width*sizeof(uint8_t)*3); 189 190 //avcodec_flush_buffers(codec_context); 191 188 codec_context->width*sizeof(uint8_t)*3); 189 /* 192 190 surface = SDL_CreateRGBSurfaceFrom(data, codec_context->width, 193 191 codec_context->height,24, … … 228 226 GL_UNSIGNED_BYTE, 229 227 surface->pixels); 230 glBindTexture(GL_TEXTURE_2D, 0); 228 glBindTexture(GL_TEXTURE_2D, 0); */ 229 230 // Create an OpenGL texture 231 glGenTextures(1, &texture); 232 glBindTexture(GL_TEXTURE_2D, texture); 233 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 234 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 235 // create the texture 236 glTexImage2D(GL_TEXTURE_2D, 237 0, 238 GL_RGB, 239 codec_context->width, codec_context->height, 240 0, 241 GL_RGB, 242 GL_UNSIGNED_BYTE, 243 data); 244 // build the MipMaps 245 gluBuild2DMipmaps(GL_TEXTURE_2D, 246 GL_RGB, 247 codec_context->width, 248 codec_context->height, 249 GL_RGB, 250 GL_UNSIGNED_BYTE, 251 data); 252 glBindTexture(GL_TEXTURE_2D, 0); 231 253 254 //avcodec_flush_buffers(codec_context); 255 232 256 return texture; 233 257 }
Note: See TracChangeset
for help on using the changeset viewer.