Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/subprojects/importer/importer.cc @ 4649

Last change on this file since 4649 was 4649, checked in by bensch, 19 years ago

orxonox/trunk: subproject Particles looks good again

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 <stdlib.h>
25
26#include "resource_manager.h"
27
28Model* obj;
29
30void Framework::moduleInit(int argc, char** argv)
31{
32  ResourceManager::getInstance()->addImageDir("./");
33
34  if (argc>=3)
35    obj = new OBJModel (argv[1], atof(argv[2]));
36  else if (argc>=2)
37    obj = new OBJModel(argv[1]);
38  else
39    obj = new PrimitiveModel(PRIM_CYLINDER);
40
41  LightManager* lightMan = LightManager::getInstance();
42  lightMan->setAmbientColor(.1,.1,.1);
43  lightMan->addLight();
44  //  lightMan->setAttenuation(1.0, .01, 0.0);
45  //  lightMan->setDiffuseColor(1,1,1);
46  //  lightMan->addLight(1);
47  //  lightMan->setPosition(20, 10, -20);
48  //  lightMan->setDiffuseColor(0,0,0);
49  //  lightMan->debug();
50  lightMan->setPosition(5.0, 10.0, 40.0);
51  lightMan->addLight();
52  lightMan->setPosition(-10, -20, -100);
53}
54
55void Framework::moduleEventHandler(SDL_Event* event)
56{
57  switch (event->type)
58    {
59    case SDL_KEYDOWN:
60      switch (event->key.keysym.sym)
61        {
62        case SDLK_i:
63          break;
64        }
65    }
66}
67
68void Framework::moduleTick(float dt)
69{
70
71}
72
73void Framework::moduleDraw(void) const
74{
75  obj->draw();
76
77  LightManager::getInstance()->draw();
78}
79
80
81void Framework::moduleHelp(void) const
82{
83
84}
Note: See TracBrowser for help on using the repository browser.