Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/graphics/graphics_engine.cc @ 6979

Last change on this file since 6979 was 6979, checked in by bensch, 18 years ago

orxonox/trunk: GraphicsEffects are BaseObject Lists now

File size: 18.6 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
16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
17
18#include "graphics_engine.h"
19#include "resource_manager.h"
20#include "event_handler.h"
21#include "state.h"
22
23#include "world_entity.h"
24
25#include "render_2d.h"
26#include "text_engine.h"
27#include "light.h"
28#include "shader.h"
29#include "debug.h"
30
31#include "parser/ini_parser/ini_parser.h"
32#include "substring.h"
33#include "text.h"
34
35#include "globals.h"
36#include "texture.h"
37
38#include "effects/graphics_effect.h"
39#include "effects/fog_effect.h"
40#include "effects/lense_flare.h"
41
42#include "shell_command.h"
43
44
45#include "parser/tinyxml/tinyxml.h"
46#include "load_param.h"
47#include "factory.h"
48#include "class_list.h"
49
50#ifdef __WIN32__
51 #include "static_model.h"
52#endif
53using namespace std;
54
55SHELL_COMMAND(wireframe, GraphicsEngine, wireframe);
56
57
58/**
59 *  standard constructor
60 */
61GraphicsEngine::GraphicsEngine ()
62{
63  this->setClassID(CL_GRAPHICS_ENGINE, "GraphicsEngine");
64  this->setName("GraphicsEngine");
65
66  this->isInit = false;
67
68  this->bDisplayFPS = false;
69  this->minFPS = 9999;
70  this->maxFPS = 0;
71
72  this->geTextCFPS = NULL;
73  this->geTextMaxFPS = NULL;
74  this->geTextMinFPS = NULL;
75
76  this->fullscreenFlag = 0;
77  this->videoFlags = 0;
78  this->screen = NULL;
79
80
81  // Hardware
82  this->hwRenderer = NULL;
83  this->hwVendor = NULL;
84  this->hwVersion = NULL;
85  this->hwExtensions = NULL;
86
87  // initialize the Modules
88  TextEngine::getInstance();
89  this->graphicsEffects = NULL;
90
91}
92
93/**
94 *  The Pointer to this GraphicsEngine
95*/
96GraphicsEngine* GraphicsEngine::singletonRef = NULL;
97
98/**
99 *  destructs the graphicsEngine.
100*/
101GraphicsEngine::~GraphicsEngine ()
102{
103  // delete what has to be deleted here
104  delete this->geTextCFPS;
105  delete this->geTextMaxFPS;
106  delete this->geTextMinFPS;
107
108  delete[] this->hwRenderer;
109  delete[] this->hwVendor;
110  delete[] this->hwVersion;
111  delete this->hwExtensions;
112
113  //TextEngine
114  delete TextEngine::getInstance();
115  // render 2D
116  delete Render2D::getInstance();
117
118  SDL_QuitSubSystem(SDL_INIT_VIDEO);
119  //   if (this->screen != NULL)
120  //     SDL_FreeSurface(this->screen);
121
122  GraphicsEngine::singletonRef = NULL;
123}
124
125
126/**
127 * loads the GraphicsEngine Specific Parameters.
128 * @param root: the XML-Element to load the Data From
129 */
130void GraphicsEngine::loadParams(const TiXmlElement* root)
131{
132  LoadParamXML(root, "GraphicsEffect", this, GraphicsEngine, loadGraphicsEffects)
133  .describe("loads a graphics effect");
134}
135
136
137/**
138 * initializes the GraphicsEngine with default settings.
139 */
140int GraphicsEngine::init()
141{
142  if (this->isInit)
143    return -1;
144  this->initVideo(640, 480, 16);
145}
146
147/**
148 * loads the GraphicsEngine's settings from a given ini-file and section
149 * @param iniParser the iniParser to load from
150 * @param section the Section in the ini-file to load from
151 * @returns nothing usefull
152 */
153int GraphicsEngine::initFromIniFile(IniParser* iniParser)
154{
155  // looking if we are in fullscreen-mode
156  const char* fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0");
157  if (strchr(fullscreen, '1') || !strcasecmp(fullscreen, "true"))
158    this->fullscreenFlag = SDL_FULLSCREEN;
159
160  // looking if we are in fullscreen-mode
161  const char* textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0");
162  if (strchr(textures, '1') || !strcasecmp(textures, "true"))
163    Texture::setTextureEnableState( true);
164  else
165    Texture::setTextureEnableState(false);
166
167  // searching for a usefull resolution
168  SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480"), 'x');
169  //resolution.debug();
170
171  this->initVideo(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16);
172
173  //   GraphicsEffect* fe = new FogEffect(NULL);
174  //   this->loadGraphicsEffect(fe);
175  //   fe->activate();
176  //   PRINTF(0)("--------------------------------------------------------------\n");
177
178  //LenseFlare* ge = new LenseFlare();
179  //this->loadGraphicsEffect(ge);
180
181  //ge->addFlare("pictures/lense_flare/sun.png"); //sun
182  //ge->addFlare("pictures/lense_flare/lens2.png"); //first halo
183  //ge->addFlare("pictures/lense_flare/lens1.png"); //small birst
184  //ge->addFlare("pictures/lense_flare/lens3.png"); //second halo
185  //ge->addFlare("pictures/lense_flare/lens4.png");
186  //ge->addFlare("pictures/lense_flare/lens1.png");
187  //ge->addFlare("pictures/lense_flare/lens3.png");
188
189  //ge->activate();
190}
191
192
193
194/**
195 *  initializes the Video for openGL.
196 *
197 * This has to be done only once when starting orxonox.
198 */
199int GraphicsEngine::initVideo(unsigned int resX, unsigned int resY, unsigned int bbp)
200{
201  if (this->isInit)
202    return -1;
203  //   initialize SDL_VIDEO
204  if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1)
205  {
206    PRINTF(1)("could not initialize SDL Video\n");
207    //      return -1;
208  }
209  // initialize SDL_GL-settings
210  this->setGLattribs();
211
212  // setting the Video Flags.
213  this->videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE | SDL_DOUBLEBUF | SDL_GL_DOUBLEBUFFER;
214
215  /* query SDL for information about our video hardware */
216  const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo ();
217  if( videoInfo == NULL)
218  {
219    PRINTF(1)("Failed getting Video Info :%s\n", SDL_GetError());
220    SDL_Quit ();
221  }
222  if( videoInfo->hw_available)
223    this->videoFlags |= SDL_HWSURFACE;
224  else
225    this->videoFlags |= SDL_SWSURFACE;
226  /*
227  if(VideoInfo -> blit_hw)
228    VideoFlags |= SDL_HWACCEL;
229  */
230  // setting up the Resolution
231  this->setResolution(resX, resY, bbp);
232
233  // GRABBING ALL GL-extensions
234  this->grabHardwareSettings();
235
236  // Enable default GL stuff
237  glEnable(GL_DEPTH_TEST);
238
239  Render2D::getInstance();
240
241  this->isInit = true;
242}
243
244/**
245 * sets the Window Captions and the Name of the icon.
246 * @param windowName The name of the Window
247 * @param icon The name of the Icon on the Disc
248 */
249void GraphicsEngine::setWindowName(const char* windowName, const char* icon)
250{
251  SDL_Surface* iconSurf = SDL_LoadBMP(icon);
252  if (iconSurf != NULL)
253  {
254    Uint32 colorkey = SDL_MapRGB(iconSurf->format, 0, 0, 0);
255    SDL_SetColorKey(iconSurf, SDL_SRCCOLORKEY, colorkey);
256    SDL_WM_SetIcon(iconSurf,NULL);
257    SDL_FreeSurface(iconSurf);
258  }
259
260  SDL_WM_SetCaption (windowName, icon);
261}
262
263
264/**
265 *  Sets the GL-attributes
266 */
267int GraphicsEngine::setGLattribs()
268{
269  // Set video mode
270  // TO DO: parse arguments for settings
271  //SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
272  //SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
273  //SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
274  //SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
275
276
277  SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
278  SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16);
279  SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 0);
280  SDL_GL_SetAttribute( SDL_GL_ACCUM_RED_SIZE, 0);
281  SDL_GL_SetAttribute( SDL_GL_ACCUM_GREEN_SIZE, 0);
282  SDL_GL_SetAttribute( SDL_GL_ACCUM_BLUE_SIZE, 0);
283  SDL_GL_SetAttribute( SDL_GL_ACCUM_ALPHA_SIZE, 0);
284}
285
286/**
287 * grabs the Hardware Specifics
288 * checks for all the different HW-types
289 */
290void GraphicsEngine::grabHardwareSettings()
291{
292  const char* renderer = (const char*) glGetString(GL_RENDERER);
293  const char* vendor   = (const char*) glGetString(GL_VENDOR);
294  const char* version  = (const char*) glGetString(GL_VERSION);
295  const char* extensions = (const char*) glGetString(GL_EXTENSIONS);
296
297  //  printf("%s %s %s\n %s", renderer, vendor, version, extensions);
298
299  if (this->hwRenderer == NULL && renderer != NULL)
300  {
301    this->hwRenderer = new char[strlen(renderer)+1];
302    strcpy(this->hwRenderer, renderer);
303  }
304  if (this->hwVendor == NULL && vendor != NULL)
305  {
306    this->hwVendor = new char[strlen(vendor)+1];
307    strcpy(this->hwVendor, vendor);
308  }
309  if (this->hwVersion == NULL && version != NULL)
310  {
311    this->hwVersion = new char[strlen(version)+11];
312    strcpy(this->hwVersion, version);
313  }
314
315  if (this->hwExtensions == NULL && extensions != NULL)
316    this->hwExtensions = new SubString((char*)glGetString(GL_EXTENSIONS), " \n\t,");
317
318  PRINT(4)("Running on : vendor: %s,  renderer: %s,  version:%s\n", vendor, renderer, version);
319  PRINT(4)("Extensions:\n");
320  if (this->hwExtensions != NULL)
321    for (unsigned int i = 0; i < this->hwExtensions->getCount(); i++)
322      PRINT(4)("%d: %s\n", i, this->hwExtensions->getString(i));
323
324
325  // inizializing GLEW
326  GLenum err = glewInit();
327  if (GLEW_OK != err)
328  {
329    /* Problem: glewInit failed, something is seriously wrong. */
330    PRINTF(1)("%s\n", glewGetErrorString(err));
331  }
332  PRINTF(4)("Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
333}
334
335
336/**
337 *  sets the Resolution of the Screen to display the Graphics to.
338 * @param width The width of the window
339 * @param height The height of the window
340 * @param bpp bits per pixel
341 */
342int GraphicsEngine::setResolution(int width, int height, int bpp)
343{
344  this->resolutionX = width;
345  this->resolutionY = height;
346  this->bitsPerPixel = bpp;
347  State::setResolution( width, height);
348
349  if (this->screen != NULL)
350    SDL_FreeSurface(screen);
351  if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | this->fullscreenFlag)) == NULL)
352  {
353    PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
354    //    SDL_Quit();
355    //    return -1;
356  }
357  glViewport(0, 0, width, height);                     // Reset The Current Viewport
358
359#ifdef __WIN32__
360  // REBUILDING TEXTURES (ON WINDOWS CONTEXT SWITCH)
361  const std::list<BaseObject*>* texList = ClassList::getList(CL_TEXTURE);
362  if (texList != NULL)
363  {
364    std::list<BaseObject*>::const_iterator reTex;
365    for (reTex = texList->begin(); reTex != texList->end(); reTex++)
366      dynamic_cast<Texture*>(*reTex)->rebuild();
367  }
368  // REBUILDING MODELS
369  const std::list<BaseObject*>* modelList = ClassList::getList(CL_STATIC_MODEL);
370  if (texList != NULL)
371  {
372    std::list<BaseObject*>::const_iterator reModel;
373    for (reModel = modelList->begin(); reModel != modelList->end(); reModel++)
374      dynamic_cast<StaticModel*>(*reModel)->rebuild();
375  }
376#endif /* __WIN32__ */
377}
378
379/**
380 *  sets Fullscreen mode
381 * @param fullscreen true if fullscreen, false if windowed
382*/
383void GraphicsEngine::setFullscreen(bool fullscreen)
384{
385  if (fullscreen)
386    this->fullscreenFlag = SDL_FULLSCREEN;
387  else
388    this->fullscreenFlag = 0;
389  this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel);
390}
391
392/**
393 *  sets the background color
394 * @param red the red part of the background
395 * @param blue the blue part of the background
396 * @param green the green part of the background
397 * @param alpha the alpha part of the background
398 */
399void GraphicsEngine::setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
400{
401  glClearColor(red, green, blue, alpha);
402}
403
404/**
405 *  Signalhandler, for when the resolution has changed
406 * @param resizeInfo SDL information about the size of the new screen size
407 */
408int GraphicsEngine::resolutionChanged(const SDL_ResizeEvent& resizeInfo)
409{
410  this->setResolution(resizeInfo.w, resizeInfo.h, this->bitsPerPixel);
411}
412
413/**
414 *
415 * @param show if The mouse-cursor should be visible
416 */
417void GraphicsEngine::showMouse(bool show)
418{
419  if (show)
420    SDL_ShowCursor(SDL_ENABLE);
421  else
422    SDL_ShowCursor(SDL_DISABLE);
423}
424
425/**
426 *
427 * @returns The Visinility of the mouse-cursor (true if visible, false if it is invisible)
428 */
429bool GraphicsEngine::isMouseVisible()
430{
431  if (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE)
432    return true;
433  else
434    return false;
435}
436
437/**
438 *
439 * @param steal If the Winodow-Managers Events should be stolen to this app
440 * (steals the mouse, and all WM-clicks)
441 *
442 * This only happens, if the HARD-Debug-level is set to 0,1,2, because otherwise a Segfault could
443 * result in the loss of System-controll
444 */
445void GraphicsEngine::stealWMEvents(bool steal)
446{
447#if DEBUG < 3
448  if (steal)
449    SDL_WM_GrabInput(SDL_GRAB_ON);
450  else
451    SDL_WM_GrabInput(SDL_GRAB_OFF);
452#endif
453}
454
455/**
456 *
457 * @returns true if Events are stolen from the WM, false if not.
458 */
459bool GraphicsEngine::isStealingEvents()
460{
461  if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON)
462    return true;
463  else
464    return false;
465};
466
467/**
468 *  entering 2D Mode
469
470   this is a GL-Projection-mode, that is orthogonal, for placing the font in fron of everything else
471*/
472void GraphicsEngine::enter2DMode()
473{
474  //GraphicsEngine::storeMatrices();
475  SDL_Surface *screen = SDL_GetVideoSurface();
476
477  /* Note, there may be other things you need to change,
478     depending on how you have your OpenGL state set up.
479  */
480  glPushAttrib(GL_ENABLE_BIT);
481  glDisable(GL_DEPTH_TEST);
482  glDisable(GL_CULL_FACE);
483  glDisable(GL_LIGHTING);  // will be set back when leaving 2D-mode
484
485  glMatrixMode(GL_PROJECTION);
486  glPushMatrix();
487  glLoadIdentity();
488  glOrtho(0.0, (GLdouble)screen->w, (GLdouble)screen->h, 0.0, 0.0, 1.0);
489
490  glMatrixMode(GL_MODELVIEW);
491  glPushMatrix();
492  glLoadIdentity();
493}
494
495/**
496 *  leaves the 2DMode again also @see Font::enter2DMode()
497 */
498void GraphicsEngine::leave2DMode()
499{
500
501  glMatrixMode(GL_MODELVIEW);
502  glPopMatrix();
503
504  glMatrixMode(GL_PROJECTION);
505  glPopMatrix();
506
507  glPopAttrib();
508}
509
510void GraphicsEngine::wireframe()
511{
512  glPolygonMode(GL_FRONT, GL_LINE);
513}
514
515/**
516 *  stores the GL_matrices
517 */
518void GraphicsEngine::storeMatrices()
519{
520  glGetDoublev(GL_PROJECTION_MATRIX, GraphicsEngine::projMat);
521  glGetDoublev(GL_MODELVIEW_MATRIX, GraphicsEngine::modMat);
522  glGetIntegerv(GL_VIEWPORT, GraphicsEngine::viewPort);
523}
524
525//! the stored ModelView Matrix.
526GLdouble GraphicsEngine::modMat[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
527//! the stored Projection Matrix
528GLdouble GraphicsEngine::projMat[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
529//! The ViewPort
530GLint GraphicsEngine::viewPort[4] = {0,0,0,0};
531
532
533
534/**
535 *  outputs all the Fullscreen modes.
536 */
537void GraphicsEngine::listModes()
538{
539  /* Get available fullscreen/hardware modes */
540  this->videoModes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
541
542  /* Check is there are any modes available */
543  if(this->videoModes == (SDL_Rect **)0)
544  {
545    PRINTF(1)("No modes available!\n");
546    exit(-1);
547  }
548
549  /* Check if our resolution is restricted */
550  if(this->videoModes == (SDL_Rect **)-1)
551  {
552    PRINTF(2)("All resolutions available.\n");
553  }
554  else
555  {
556    /* Print valid modes */
557    PRINT(0)("Available Resoulution Modes are\n");
558    for(int i = 0; this->videoModes[i]; ++i)
559      PRINT(4)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
560  }
561}
562
563/**
564 * checks wether a certain extension is availiable
565 * @param extension the Extension to check for (ex. GL_ARB_texture_env_dot3)
566 * @return true if it is, false otherwise
567 */
568bool GraphicsEngine::hwSupportsEXT(const char* extension)
569{
570  if (this->hwExtensions != NULL)
571    for (unsigned int i = 0; i < this->hwExtensions->getCount(); i++)
572      if (!strcmp(extension, this->hwExtensions->getString(i)))
573        return true;
574  return false;
575}
576
577/**
578 * updates everything that is to be updated in the GraphicsEngine
579 */
580void GraphicsEngine::update(float dt)
581{
582  Render2D::getInstance()->update(dt);
583}
584
585
586/**
587 *  ticks the Text
588 * @param dt the time passed
589 */
590void GraphicsEngine::tick(float dt)
591{
592  if( unlikely(this->bDisplayFPS))
593  {
594    this->currentFPS = 1.0/dt;
595    if( unlikely(this->currentFPS > this->maxFPS)) this->maxFPS = this->currentFPS;
596    if( unlikely(this->currentFPS < this->minFPS)) this->minFPS = this->currentFPS;
597
598#ifndef NO_TEXT
599    char tmpChar1[20];
600    sprintf(tmpChar1, "Current:  %4.0f", this->currentFPS);
601    this->geTextCFPS->setText(tmpChar1);
602    char tmpChar2[20];
603    sprintf(tmpChar2, "Max:    %4.0f", this->maxFPS);
604    this->geTextMaxFPS->setText(tmpChar2);
605    char tmpChar3[20];
606    sprintf(tmpChar3, "Min:    %4.0f", this->minFPS);
607    this->geTextMinFPS->setText(tmpChar3);
608#endif /* NO_TEXT */
609
610  }
611
612  Render2D::getInstance()->tick(dt);
613
614  // tick the graphics effects
615  if (this->graphicsEffects != NULL || (this->graphicsEffects = ClassList::getList(CL_GRAPHICS_EFFECT)) != NULL)
616  {
617    std::list<BaseObject*>::const_iterator it;
618    for (it = this->graphicsEffects->begin(); it != this->graphicsEffects->end(); it++)
619      dynamic_cast<GraphicsEffect*>(*it)->tick(dt);
620  }
621}
622
623
624void GraphicsEngine::draw() const
625{
626
627  LightManager::getInstance()->draw();
628
629  GraphicsEngine::storeMatrices();
630  Shader::suspendShader();
631
632  Render2D::getInstance()->draw(E2D_LAYER_ALL);
633  Shader::restoreShader();
634
635  if (this->graphicsEffects != NULL)
636  {
637    //draw the graphics effects
638    list<BaseObject*>::const_iterator it;
639    for (it = this->graphicsEffects->begin(); it != this->graphicsEffects->end(); it++)
640      dynamic_cast<GraphicsEffect*>(*it)->draw();
641  }
642}
643
644void GraphicsEngine::draw(const std::list<WorldEntity*>& drawList ) const
645{
646  std::list<WorldEntity*>::const_iterator entity;
647  for (entity = drawList.begin(); entity != drawList.end(); entity++)
648    if ((*entity)->isVisible())
649      (*entity)->draw();
650}
651
652
653/**
654 * displays the Frames per second
655 * @param display if the text should be displayed
656*/
657void GraphicsEngine::displayFPS(bool display)
658{
659#ifndef NO_TEXT
660  if( display )
661  {
662    if (this->geTextCFPS == NULL)
663    {
664      this->geTextCFPS = new Text("fonts/arial_black.ttf", 15);
665      this->geTextCFPS->setName("curFPS");
666      this->geTextCFPS->setAlignment(TEXT_ALIGN_LEFT);
667      this->geTextCFPS->setAbsCoor2D(5, 0);
668    }
669    if (this->geTextMaxFPS == NULL)
670    {
671      this->geTextMaxFPS = new Text("fonts/arial_black.ttf", 15);
672      this->geTextMaxFPS->setName("MaxFPS");
673      this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT);
674      this->geTextMaxFPS->setAbsCoor2D(5, 20);
675    }
676    if (this->geTextMinFPS == NULL)
677    {
678      this->geTextMinFPS = new Text("fonts/arial_black.ttf", 15);
679      this->geTextMinFPS->setName("MinFPS");
680      this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT);
681      this->geTextMinFPS->setAbsCoor2D(5, 40);
682    }
683  }
684  else
685  {
686    delete this->geTextCFPS;
687    this->geTextCFPS = NULL;
688    delete this->geTextMaxFPS;
689    this->geTextMaxFPS = NULL;
690    delete this->geTextMinFPS;
691    this->geTextMinFPS = NULL;
692  }
693  this->bDisplayFPS = display;
694#else
695  this->bDisplayFPS = false;
696#endif /* NO_TEXT */
697}
698
699
700/**
701  processes the events for the GraphicsEngine class
702* @param the event to handle
703 */
704void GraphicsEngine::process(const Event &event)
705{
706  switch (event.type)
707  {
708      case EV_VIDEO_RESIZE:
709      this->resolutionChanged(event.resize);
710      break;
711  }
712}
713
714
715/**
716 * @param root The XML-element to load GraphicsEffects from
717 */
718void GraphicsEngine::loadGraphicsEffects(const TiXmlElement* root)
719{
720  LOAD_PARAM_START_CYCLE(root, element);
721  {
722    PRINTF(0)("element is: %s\n", element->Value());
723    Factory::fabricate(element);
724  }
725  LOAD_PARAM_END_CYCLE(element);
726}
Note: See TracBrowser for help on using the repository browser.