attempt to detect available video modes. fails miserably for the moment, please test on other platforms...

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3419 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2009-04-24 00:14:04 +00:00
parent 94bbe12636
commit f3cbe0984b
3 changed files with 27 additions and 5 deletions

View File

@@ -51,8 +51,27 @@ IrrDriver::~IrrDriver()
void IrrDriver::initDevice()
{
std::cout << "initDevice ::> creating device, size = " << user_config->m_width << ", " << user_config->m_height << std::endl;
// -----------
// attempt to detect available video modes. fails miserably for the moment, please test on other platforms...
m_device = createDevice(EDT_NULL);
video::IVideoModeList* modes = m_device->getVideoModeList();
const int count = modes->getVideoModeCount();
std::cout << "--------------\n allowed modes \n--------------\n";
std::cout << "Desktop depth : " << modes->getDesktopDepth() << std::endl;
std::cout << "Desktop resolution : " << modes->getDesktopResolution().Width << "," << modes->getDesktopResolution().Height << std::endl;
std::cout << "Found " << count << " valid modes\n";
for(int i=0; i<count; i++)
{
std::cout <<
"bits : " << modes->getVideoModeDepth(i) <<
" resolution=" << modes->getVideoModeResolution(i).Width <<
"x" << modes->getVideoModeResolution(i).Height << std::endl;
}
m_device->closeDevice();
// ------------
// Try different drivers: start with opengl, then DirectX
for(int driver_type=0; driver_type<3; driver_type++)

View File

@@ -5,6 +5,7 @@
#include "input/input_manager.hpp"
#include "gui/state_manager.hpp"
#include "history.hpp"
/*
#include "items/item_manager.hpp"
#include "items/powerup_manager.hpp"
#include "items/attachment_manager.hpp"
@@ -12,6 +13,7 @@
#include "karts/kart_properties_manager.hpp"
#include "material_manager.hpp"
#include "gui/font.hpp"
*/
#include "gui/race_gui.hpp"
#include "gui/engine.hpp"
@@ -65,7 +67,7 @@ namespace SDLManager
if(user_config->m_fullscreen)
m_flags |= SDL_FULLSCREEN;
setVideoMode(false);
// setVideoMode(false);
SDL_JoystickEventState(SDL_ENABLE);
}
@@ -110,7 +112,7 @@ namespace SDLManager
else if(StateManager::isGameState())
hidePointer();
setVideoMode(resetTextures);
// setVideoMode(resetTextures);
} // toggleFullscreen
// -----------------------------------------------------------------------------
@@ -121,6 +123,7 @@ namespace SDLManager
* resolution. Necessary with windows and Macs OpenGL
* versions.
*/
/*
void setVideoMode(bool resetTextures)
{
#if defined(WIN32) || defined(__APPLE__)
@@ -161,7 +164,7 @@ namespace SDLManager
}
#endif
} // setVideoMode
*/
// SDL_FreeSurface(m_main_surface); ?
// the previous sdl driver declared m_main_surface but it was always set to NULL afaik

View File

@@ -4,7 +4,7 @@
namespace SDLManager
{
void init();
void setVideoMode(bool resetTextures);
// void setVideoMode(bool resetTextures);
void toggleFullscreen(bool resetTextures);
void showPointer();
void hidePointer();