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