changing video driver

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
circusdan
Posts: 32
Joined: Thu Jun 02, 2011 10:05 pm
Location: United States

changing video driver

Post by circusdan »

I set up a GUI, but when it is loading it is a white screen for a few seconds before it loads the GUI. I was wondering if there is a way to create the device with a NULL driver, then after it loads, switch the driver to the correct one. Or is there any other way of fixing this problem?
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

You could add a loading screen. Loading a single .jpg and displaying that should be fast.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
circusdan
Posts: 32
Joined: Thu Jun 02, 2011 10:05 pm
Location: United States

Post by circusdan »

I tried that but it wasnt working right. I guess ill try to work with that more
circusdan
Posts: 32
Joined: Thu Jun 02, 2011 10:05 pm
Location: United States

Post by circusdan »

I got a loading screen, but its still a white screen for a second or two before the load screen comes on. Anyone know of a way to fix this?
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Can't help without further info/code. 1-2 second whitescreen isn't normal. Do you also get a whitescreen when starting the irrlicht examples?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
circusdan
Posts: 32
Joined: Thu Jun 02, 2011 10:05 pm
Location: United States

Post by circusdan »

No the examples run fine, here is my main game code:

#include <stdio.h>
#include <irrlicht.h>
#include "setUpGUI.h"


using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib")
#endif

int runGame()
{
IrrlichtDevice *device =
createDevice(EDT_OPENGL, core::dimension2d<u32>(640, 480), 16, false, false, false, 0);
device->setResizable(true);

if (device == 0)
{
return 1; // could not create selected driver.
}
else
{
//get video driver and scene manager
mydriver = device->getVideoDriver();
myscene = device->getSceneManager();
mygui = device->getGUIEnvironment();

loadScreen(device);
setUpGUI(device);
}
}

My loadScreen() function looks like

IVideoDriver *mydriver;
ISceneManager *myscene;
IGUIEnvironment *mygui;
core::stringw listText = L"Dummy Lobby";
core::stringw wCharString = L"";
core::dimension2d<u32> screenSize;

void RenderAll()
{

mydriver->beginScene(true, true, SColor(255,155,155,155));
myscene->drawAll();
mygui->drawAll();
mydriver->endScene();
}

void loadScreen(IrrlichtDevice *device)
{
screenSize = device->getVideoDriver()->getScreenSize();
IGUIImage *load = mygui->addImage(rect<s32>(0, 0, screenSize.Width, screenSize.Height), 0, 101, L"");
load->setImage(mygui->getVideoDriver()->getTexture(
"C:/Users/DANNY/Documents/Visual Studio 2008/Projects/Fighting Game/Fighting Game/loading_screen.jpg"));
load->setScaleImage(true);
RenderAll();
}


I dont think you need to see my setUpGUI seeing how the loadScreen() has a white screen too and thats first, but i dont see why it would do that, there isnt really a crazy amount of stuff here to load
circusdan
Posts: 32
Joined: Thu Jun 02, 2011 10:05 pm
Location: United States

Post by circusdan »

Nevermind, i take that back, the examples do have the white screen for a couple seconds, they worked fine a few days ago.
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

circusdan wrote:Nevermind, i take that back, the examples do have the white screen for a couple seconds, they worked fine a few days ago.
OK, things are getting strange. Any idea what you did in the meantime? Maybe installed a new Irrlicht version, or a new graphic card driver - anything like that?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
circusdan
Posts: 32
Joined: Thu Jun 02, 2011 10:05 pm
Location: United States

Post by circusdan »

I didnt do anything at all, i sent the code to my friend to see if it does it on his computer but he hasnt gotten back to me yet
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

Post by Iyad »

It may be a hardware problem or a coding problem. Did you tried both openGL and directX? Does it give white screens for the 2 drivers?

I think that you just overloaded the application in the beggining (loading tons of stuff and making tons of calculation), just re-check your code, i suggest that you post it all there, I looked quickly in your code and i see that you are calling 1 render (at loadscreen) before loading everything, so this maybe the white-grey screen (155,155,155) before the loading. Im sure that if you put :

Code: Select all

mydriver->beginScene(true, true, SColor(255,0,255,0)); 
instead of

Code: Select all

mydriver->beginScene(true, true, SColor(255,155,155,155)); 
you will see a different screen color (green) before waiting 1-2 seconds, this will mean that there is something wrong with

Code: Select all

setUpGUI(device); 
Ultimately, try to use a debugger.
#include <Iyad.h>
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Hm, I just run a test with MinGW + gcc 4.5 + Windows 7 and on a 64-bit system ... and got the same trouble - 2 seconds white-screen on start. Unfortunately I have right now so many troubles with that combination that I'll probably be busy debugging other stuff all day.

But could you please tell what's your system and compiler?

edit: ok, I run a few more test - and I think the white background is simply white now in Windows 7 where it was drawing nothing in Windows XP. But the time until it's gone is the time it's doing something - starting a simple example like the first one doesn't show it - only complexer examples which do load stuff first.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe we need to replace/reorder some map/update commands in the window creation section. Could be that there's something missing, or that some window commands have to be changed for Windows7?!
circusdan
Posts: 32
Joined: Thu Jun 02, 2011 10:05 pm
Location: United States

Post by circusdan »

I'm using windows 7 64 bit, but im running 32 bit visual c++. At this point im pretty sure it's my computer, ive tried a bunch of different stuff and it still gives me the white screen, i even tried that green thing, but the loading page comes right up before it turns green. And using different video driver types all give me the same thing, except the software renderer, but im pretty sure that you can render 3d stuff with that right?
Post Reply