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