Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4770 in orxonox.OLD for orxonox/trunk/src/lib/graphics


Ignore:
Timestamp:
Jul 2, 2005, 1:20:56 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: GraphicsEngine now parses the INI-file

Location:
orxonox/trunk/src/lib/graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4769 r4770  
    2121#include "debug.h"
    2222#include "text_engine.h"
     23
     24#include "ini_parser.h"
     25#include "substring.h"
    2326
    2427using namespace std;
     
    102105  glEnable(GL_DEPTH_TEST);
    103106}
     107
     108/**
     109 * loads the GraphicsEngine's settings from a given ini-file and section
     110 * @param iniParser the iniParser to load from
     111 * @param section the Section in the ini-file to load from
     112 * @returns nothing usefull
     113 */
     114int GraphicsEngine::loadFromIniFile(IniParser* iniParser, const char* section)
     115{
     116  // searching for a usefull resolution
     117  SubString resolution(iniParser->getVar(CONFIG_NAME_RESOLUTION, section, "640x480"), 'x');
     118  this->setResolution(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16);
     119
     120  // looking if we are in fullscreen-mode
     121  const char* fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, section, "0");
     122  if (strchr(fullscreen, '1'))
     123    this->setFullscreen(true);
     124}
     125
    104126
    105127
  • orxonox/trunk/src/lib/graphics/graphics_engine.h

    r4768 r4770  
    1717// Forward Declaration
    1818class Text;
     19class IniParser;
    1920
    2021//! class to handle graphics
     
    3031
    3132    int initVideo();
     33    int loadFromIniFile(IniParser* iniParser, const char* section);
    3234
    3335    void setWindowName(const char* windowName, const char* icon);
Note: See TracChangeset for help on using the changeset viewer.