[4615] | 1 | /* |
---|
[4333] | 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 | |
---|
[4378] | 20 | #include "fields.h" |
---|
[4381] | 21 | #include "stdlibincl.h" |
---|
[4552] | 22 | #include "light.h" |
---|
[4333] | 23 | |
---|
[4546] | 24 | #include "cd_engine.h" |
---|
[4333] | 25 | |
---|
[4615] | 26 | #include "md2Model.h" |
---|
| 27 | |
---|
| 28 | MD2Model* model; |
---|
| 29 | |
---|
[4343] | 30 | void Framework::moduleInit(int argc, char** argv) |
---|
[4333] | 31 | { |
---|
[4546] | 32 | CDEngine::getInstance(); |
---|
[4619] | 33 | //CDEngine::getInstance()->debug(); |
---|
[4552] | 34 | |
---|
[4619] | 35 | model = new MD2Model("models/tris.md2", "models/tris.pcx"); |
---|
| 36 | model->tick(0.1f); |
---|
[4626] | 37 | CDEngine::getInstance()->debugSpawnTree(10, model->data->pVertices, model->data->numVertices); |
---|
[4552] | 38 | |
---|
[4626] | 39 | |
---|
[4552] | 40 | LightManager* lightMan = LightManager::getInstance(); |
---|
| 41 | lightMan->setAmbientColor(.1,.1,.1); |
---|
| 42 | lightMan->addLight(); |
---|
| 43 | lightMan->addLight(); |
---|
| 44 | lightMan->setPosition(10, 20, 100); |
---|
[4333] | 45 | } |
---|
| 46 | |
---|
[4546] | 47 | |
---|
[4334] | 48 | void Framework::moduleEventHandler(SDL_Event* event) |
---|
| 49 | { |
---|
| 50 | switch (event->type) |
---|
[4622] | 51 | { |
---|
[4334] | 52 | case SDL_KEYDOWN: |
---|
| 53 | switch (event->key.keysym.sym) |
---|
[4622] | 54 | { |
---|
[4615] | 55 | case SDLK_i: |
---|
| 56 | break; |
---|
[4622] | 57 | case SDLK_1: |
---|
| 58 | printf("alsjdf;lajsfd;lajsdf\n"); |
---|
| 59 | break; |
---|
| 60 | } |
---|
| 61 | } |
---|
[4333] | 62 | } |
---|
| 63 | |
---|
[4546] | 64 | |
---|
[4333] | 65 | void Framework::moduleTick(float dt) |
---|
| 66 | { |
---|
| 67 | } |
---|
| 68 | |
---|
[4546] | 69 | |
---|
[4349] | 70 | void Framework::moduleDraw() const |
---|
[4334] | 71 | { |
---|
[4622] | 72 | CDEngine::getInstance()->drawBV(2); |
---|
[4552] | 73 | |
---|
| 74 | LightManager::getInstance()->draw(); |
---|
[4615] | 75 | |
---|
[4622] | 76 | //model->draw(); |
---|
[4334] | 77 | } |
---|
[4333] | 78 | |
---|
[4334] | 79 | |
---|
[4333] | 80 | void Framework::moduleHelp(void) const |
---|
| 81 | { |
---|
| 82 | PRINT(0)("\n"); |
---|
[4530] | 83 | PRINT(0)("i - print debug information of Collision-detection\n"); |
---|
[4336] | 84 | PRINT(0)("\n"); |
---|
[4333] | 85 | } |
---|
| 86 | |
---|
[4546] | 87 | |
---|
[4343] | 88 | void Framework::moduleInitGui(int argc, char** argv) |
---|
[4333] | 89 | { |
---|
[4626] | 90 | Window* guiMainWindow = NULL; |
---|
| 91 | |
---|
| 92 | initGUI(0, NULL); |
---|
| 93 | |
---|
| 94 | guiMainWindow = new Window("Collision_detection"); |
---|
| 95 | { |
---|
| 96 | //all the Widgets you need |
---|
| 97 | } |
---|
| 98 | Window::mainWindow->showall(); |
---|
| 99 | Window::mainWindow->setSize(300, 500); |
---|
[4333] | 100 | } |
---|