Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 30, 2005, 1:51:41 AM (18 years ago)
Author:
hdavid
Message:

branches\avi_play: some copy, pasta & delete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/avi_play/src/subprojects/importer/multitex.cc

    r6333 r6339  
    2020#include "light.h"
    2121
    22 #include "texture_sequence.h"
    2322#include "material.h"
    24 
    2523#include "primitive_model.h"
    2624#include <stdlib.h>
     
    2927
    3028Model* obj;
    31 TextureSequence* seq;
    3229Material* testMat;
    33 MediaContainer* movie;
     30MediaContainer* media_container;
    3431
    3532int counter = 0;
     
    4037void Framework::moduleInit(int argc, char** argv)
    4138{
    42   if( argc <= 2)
     39  if( argc <= 1)
    4340  {
    4441    printf("Wrong arguments try following notations:\n");
    45     printf("./multitex [media_file] [start_time]\n");
     42    printf("./multitex [media_file]\n");
    4643    exit(0);
    4744  }
    4845
    49   movie = new MediaContainer(argv[1]);
    50   //movie = new MediaContainer();
    51   //movie->loadMedia(argv[1]);
    52   fps = movie->getFPS();
    53 
    54   int start_frame = atoi(argv[2]);
    55 
    56   // print information about the media file
    57   movie->printMediaInformation();
     46  media_container = new MediaContainer(argv[1]);
    5847
    5948  testMat = new Material;
    60 
    61   seq = new TextureSequence();
    62 
    63   // get each fram individually
    64   //while(seq->addFrame(movie->getNextFrame()) != NULL);
    65   // get a list of frames
    66   movie->gotoFrame(start_frame);
    67   seq->addFrameList(movie->getFrameList());
    68 
    6949  testMat->setDiffuseMap("maps/radialTransparency.png");
    70 
    7150  obj = new PrimitiveModel(PRIM_PLANE, 10.0);
    7251
     
    7554  (new Light())->setAbsCoor(5.0, 10.0, 40.0);
    7655  (new Light())->setAbsCoor(-10, -20, -100);
     56
     57  fps = media_container->getFPS();
    7758}
    7859
     
    9677        case SDLK_9:
    9778          fps++;
    98           PRINTF(1)("fps: %f\n", fps);
     79          PRINTF(0)("fps: %0.2f\n", fps);
    9980          break;
    10081        // decrease fps
     
    10283          if(fps > 0)
    10384            fps--;
    104           PRINTF(1)("fps: %f\n", fps);
     85          PRINTF(0)("fps: %0.2f\n", fps);
    10586          break;
    10687        }
     
    11697    counter = fps * timer;
    11798
    118     if (counter > seq->getFrameCount())
     99    if (counter >= media_container->getFrameCount())
    119100    {
    120101      timer = 0;
    121102      counter = 0;
    122103    }
    123 
    124     seq->gotoFrame(counter);
    125104  }
    126105}
     
    129108{
    130109  testMat->select();
    131   glBindTexture(GL_TEXTURE_2D, seq->getTexture());
     110  glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
    132111  obj->draw();
    133112
     
    135114}
    136115
    137 
    138116void Framework::moduleHelp(void) const
    139117{
Note: See TracChangeset for help on using the changeset viewer.