Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/avi_play/src/subprojects/importer/importer.cc @ 6057

Last change on this file since 6057 was 6057, checked in by hdavid, 18 years ago

branches\avi_play: MediaContainer opens a videofile and prints some information

File size: 1.8 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14
15   this file extends the framework file, so it renders what i want.
16*/
17
18#include "framework.h"
19
20#include "light.h"
21
22#include "objModel.h"
23#include "primitive_model.h"
24#include "media_container.h"
25#include <stdlib.h>
26
27#include "resource_manager.h"
28
29Model* obj;
30MediaContainer* movie;
31
32void Framework::moduleInit(int argc, char** argv)
33{
34
35  movie = new MediaContainer(argv[1]);
36
37        // print information about the media file
38        movie->printMediaInformation(); 
39
40/*
41  ResourceManager::getInstance()->addImageDir("./");
42
43  for (int i = 0; i < argc; i++)
44  {
45    printf("%s\n", argv[i]);
46  }
47  ResourceManager::getInstance()->addImageDir("");
48
49
50  if (argc>=3)
51    obj = new OBJModel (argv[1], atof(argv[2]));
52  else if (argc>=2)
53    obj = new OBJModel(argv[1]);
54  else
55    obj = new PrimitiveModel(PRIM_CYLINDER);
56
57  ResourceManager::getInstance()->debug();
58
59  LightManager* lightMan = LightManager::getInstance();
60  lightMan->setAmbientColor(.1,.1,.1);
61  (new Light())->setAbsCoor(5.0, 10.0, 40.0);
62  (new Light())->setAbsCoor(-10, -20, -100);*/
63}
64
65void Framework::moduleEventHandler(SDL_Event* event)
66{
67  switch (event->type)
68    {
69    case SDL_KEYDOWN:
70      switch (event->key.keysym.sym)
71        {
72        case SDLK_i:
73          break;
74        }
75    }
76}
77
78void Framework::moduleTick(float dt)
79{
80        if(movie->framesLeft())
81                movie->getNextFrame();
82}
83
84void Framework::moduleDraw(void) const
85{
86  //obj->draw();
87
88  //LightManager::getInstance()->draw();
89}
90
91
92void Framework::moduleHelp(void) const
93{
94
95}
Note: See TracBrowser for help on using the repository browser.