Ok, I'm getting really mad about 0.5, I've narrowed my game crashes down to device->run(). When I comment that out of the while loop the game works fine except it never responds to windows. With that uncommented however, it doesn't work at all! It always crashes with the error "access violation" in the debugger. Why is this happening?
Is this happening because I recompiled Irrlicht.dll before using it?
I didn't make ANY changes to the engine at all before compiling it!
________
HEALTH SHOP
device->run() crashes my game!
device->run() crashes my game!
Last edited by disanti on Tue Feb 22, 2011 8:00 am, edited 1 time in total.
Ok, I changed the dll to Irrlicht.dll instead of my recompiled PSS4.dll and it is saying the error is withing Irrlicht.dll. What is up with this? Version 0.4.2 used to work just fine!
________
NCIS FORUM
________
NCIS FORUM
Last edited by disanti on Tue Feb 22, 2011 8:00 am, edited 1 time in total.
-
level1
basically device::run() just does systemcalls to: PeekMessage, TranslateMessage and DispatchMessage, so its possible that
you have a problem in your event receiver function (if every thing works fine without the device-run() call)
have you rebuilt your app completely (msvc has that minimal rebuild option which tends to mix things up a little bit sometimes)
and if you recompiled irrlicht, did you set multithreaded support on?
on what system do you run your app?
you have a problem in your event receiver function (if every thing works fine without the device-run() call)
have you rebuilt your app completely (msvc has that minimal rebuild option which tends to mix things up a little bit sometimes)
and if you recompiled irrlicht, did you set multithreaded support on?
on what system do you run your app?
-
thesmileman
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
post the code where it is crashing. Is it this code:
If that is the case most likely something is wrong in the creation of your Irrlicht device.
Code: Select all
while(irrDevice->run())If that is the case most likely something is wrong in the creation of your Irrlicht device.
I'm using a class as a 'framework'.
The code of the class:
Am i doing something wrong?
I've tried removing the splashrun==true && but that didn't help at all
!
________
GLOBAL HYBRID COOPERATION
Code: Select all
#ifndef _GAME_SPLASH___
#define _GAME_SPLASH___
#include <irrlicht.h>
class gamesplash
{
public:
gamesplash();
~gamesplash();
void runsplash();
private:
irr::IrrlichtDevice* device;
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
bool splashrun;
};
#endif //_GAME_SPLASH___Code: Select all
#include "gamesplash.h"
#include "defines.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
//make the camera object
scene::ICameraSceneNode* camera = 0;
//event receiver
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (camera)
return camera->OnEvent(event);
return false;
}
};
gamesplash::gamesplash()
{
MyEventReceiver receiver;
device =
createDevice(EDT_DIRECTX8, dimension2d<s32>(GAME_RESX, GAME_RESY),
GAME_DEPTH, GAME_FULLSCREEN, GAME_SHADOWS, &receiver);
//set the device caption
device->setWindowCaption(GAME_TITLE);
//driver
driver = device->getVideoDriver();
//scene manager
smgr = device->getSceneManager();
splashrun = true;
}
gamesplash::~gamesplash()
{
}
void gamesplash::runsplash()
{
while(splashrun==true && device->run())
{
driver->beginScene(true, true, video::SColor(0,0,0,0));
driver->endScene();
}
}I've tried removing the splashrun==true && but that didn't help at all
________
GLOBAL HYBRID COOPERATION
Last edited by disanti on Tue Feb 22, 2011 8:01 am, edited 1 time in total.
-
Guest
Code: Select all
class MyEventReceiver : public irr::IEventReceiver{
public:
// ATTENTION HERE
bool *end;
virtual bool OnEvent(irr::SEvent event){
if(event.EventType==irr::EET_KEY_INPUT_EVENT){
if(event.KeyInput.Key==irr::KEY_ESCAPE &&
!event.KeyInput.PressedDown){
*end=true;
return true;
}
}
/*
.... otehr event stuff
*/
return false;
}
};
Code: Select all
// if this variable is true we end the gameloop
bool EndTheGame=false;
// create the receiver
MyEventReceiver receiver;
// let the receiver know what variable 'receiver.end' points to
receiver.end=&EndTheGame;
// create the IRRDevice
IrrlichtDevice* device=createDevice(video::EDT_DIRECTX8,core::dimension2d<s32>(640, 480),32, false, true, &receiver);
// do some usefull stuff ... init etc.
// gameloop
while ( !EndTheGame && device->run() )
{
// ...
}
device->closeDevice();
i hope this helps
level1
The eventreceiver is declared in the constructor, and the pointer is passed to Irrlicht, which may crash the game when the first event comes by.
Edit:
If I were you, I'd try to get rid of the camera global variable. To do this, inherit the gamesplash class from IEventReceiver and place the OnEvent in it. This way you can put the camera into the class. This is just an idea, first make it work
Gonosz
Edit:
If I were you, I'd try to get rid of the camera global variable. To do this, inherit the gamesplash class from IEventReceiver and place the OnEvent in it. This way you can put the camera into the class. This is just an idea, first make it work
Gonosz
Thanks everyone!!! It was the Event Receiver. Oh well, I can do without it!
I use DirectInput.
________
Mercedes-Benz S-Class
________
Mercedes-Benz S-Class