Changeset 6406 in orxonox.OLD for branches/avi_play/src/lib/graphics/importer/media_container.cc
- Timestamp:
- Jan 4, 2006, 2:47:56 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/lib/graphics/importer/media_container.cc
r6401 r6406 61 61 if (glIsTexture(texture)) 62 62 glDeleteTextures(1, &texture); 63 //SDL_FreeSurface(surface);64 63 65 64 // Free the RGB image … … 200 199 ((AVPicture*)RGB_frame)->data[0]+i * 201 200 ((AVPicture*)RGB_frame)->linesize[0], 202 codec_context->width*sizeof(uint8_t)*3); 203 204 /*surface = SDL_CreateRGBSurfaceFrom(data, codec_context->width, 205 codec_context->height,24, 206 codec_context->width*sizeof(uint8_t)*3, 207 #if SDL_BYTEORDER == SDL_LIL_ENDIAN // OpenGL RGBA masks 208 0x000000FF, 209 0x0000FF00, 210 0x00FF0000, 211 0 212 #else 213 0xFF000000, 214 0x00FF0000, 215 0x0000FF00, 216 0 217 #endif 218 ); 219 220 // Create an OpenGL texture from the surface 221 glGenTextures(1, &texture); 222 glBindTexture(GL_TEXTURE_2D, texture); 223 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 224 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 225 // create the texture 226 glTexImage2D(GL_TEXTURE_2D, 227 0, 228 GL_RGB, 229 surface->w, surface->h, 230 0, 231 GL_RGB, 232 GL_UNSIGNED_BYTE, 233 surface->pixels); 234 // build the MipMaps 235 gluBuild2DMipmaps(GL_TEXTURE_2D, 236 GL_RGB, 237 surface->w, 238 surface->h, 239 GL_RGB, 240 GL_UNSIGNED_BYTE, 241 surface->pixels); 242 glBindTexture(GL_TEXTURE_2D, 0); */ 201 codec_context->width*sizeof(uint8_t)*3); 243 202 244 203 // Create an OpenGL texture … … 265 224 data); 266 225 glBindTexture(GL_TEXTURE_2D, 0); 267 268 //avcodec_flush_buffers(codec_context);269 226 270 227 return texture;
Note: See TracChangeset
for help on using the changeset viewer.