Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

branches/avi_play: some init stuff

File size: 1.7 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;
30
31void Framework::moduleInit(int argc, char** argv)
32{
33        //MediaContainer* test;
34       
35        //test = new MediaContainer(argv[1]);   
36
37
38  ResourceManager::getInstance()->addImageDir("./");
39
40  for (int i = 0; i < argc; i++)
41  {
42    printf("%s\n", argv[i]);
43  }
44  ResourceManager::getInstance()->addImageDir("");
45
46
47  if (argc>=3)
48    obj = new OBJModel (argv[1], atof(argv[2]));
49  else if (argc>=2)
50    obj = new OBJModel(argv[1]);
51  else
52    obj = new PrimitiveModel(PRIM_CYLINDER);
53
54  ResourceManager::getInstance()->debug();
55
56  LightManager* lightMan = LightManager::getInstance();
57  lightMan->setAmbientColor(.1,.1,.1);
58  (new Light())->setAbsCoor(5.0, 10.0, 40.0);
59  (new Light())->setAbsCoor(-10, -20, -100);
60}
61
62void Framework::moduleEventHandler(SDL_Event* event)
63{
64  switch (event->type)
65    {
66    case SDL_KEYDOWN:
67      switch (event->key.keysym.sym)
68        {
69        case SDLK_i:
70          break;
71        }
72    }
73}
74
75void Framework::moduleTick(float dt)
76{
77
78}
79
80void Framework::moduleDraw(void) const
81{
82  obj->draw();
83
84  LightManager::getInstance()->draw();
85}
86
87
88void Framework::moduleHelp(void) const
89{
90
91}
Note: See TracBrowser for help on using the repository browser.