- Timestamp:
- Jan 4, 2006, 2:47:56 PM (19 years ago)
- Location:
- branches/avi_play/src/lib/graphics/importer
- Files:
-
- 4 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; -
branches/avi_play/src/lib/graphics/importer/media_container.h
r6401 r6406 34 34 AVFrame* RGB_frame; 35 35 36 //SDL_Surface* surface;37 36 GLuint texture; 38 37 uint8_t* data; -
branches/avi_play/src/lib/graphics/importer/movie_player.cc
r6401 r6406 52 52 if (glIsTexture(texture)) 53 53 glDeleteTextures(1, &texture); 54 //SDL_FreeSurface(surface);55 54 56 55 // Free the RGB image … … 213 212 ((AVPicture*)RGB_frame)->linesize[0], 214 213 codec_context->width*sizeof(uint8_t)*3); 215 216 /* surface = SDL_CreateRGBSurfaceFrom(data, codec_context->width,217 codec_context->height,24,218 codec_context->width*sizeof(uint8_t)*3,219 #if SDL_BYTEORDER == SDL_LIL_ENDIAN // OpenGL RGBA masks220 0x000000FF,221 0x0000FF00,222 0x00FF0000,223 0224 #else225 0xFF000000,226 0x00FF0000,227 0x0000FF00,228 0229 #endif230 );231 232 glBindTexture(GL_TEXTURE_2D, texture);233 // update the texture234 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,235 surface->w, surface->h,236 GL_RGB, GL_UNSIGNED_BYTE,237 surface->pixels);238 // build the MipMaps239 gluBuild2DMipmaps(GL_TEXTURE_2D,240 GL_RGB,241 surface->w,242 surface->h,243 GL_RGB,244 GL_UNSIGNED_BYTE,245 surface->pixels);246 glBindTexture(GL_TEXTURE_2D, 0);*/247 248 214 249 215 glBindTexture(GL_TEXTURE_2D, texture); -
branches/avi_play/src/lib/graphics/importer/movie_player.h
r6401 r6406 48 48 AVFrame* RGB_frame; 49 49 50 //SDL_Surface* surface;51 50 GLuint texture; 52 51 uint8_t* data;
Note: See TracChangeset
for help on using the changeset viewer.