I'm having problems when trying to run something that loads up a bsp map.
I've only tried it with the one distributed with irrlicht, and that won't load up.
I have copied the code directly from the quake map tutorial, and am using the original dll, and it won't work......it seems to have a problem during the call of "smgr->drawAll()" in the while loop.
When I try to run it within VC++, it gives an error "instruction at 0x1004f3aa referenced memory at 0xffffffff. The memory could not be read." that kind of thing, and when I run it out of VC++ (manually clicking on exe file) it gives the error:
"The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."
Ideas?? Because things could kind of go down without being able to load bsps.
Runtime problems
Runtime problems
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
-Japanese Proverb
Hello,
The calling convention error is also possible when you use a multithreaded library or dll in a single threaded projects in your vc++ (or vice versa?). You should make sure what kind of code you are generating. For a simple irrlicht project single threaded should work (it depends on your needs).
You can check this in "code generation" in the c/c++ folder within the project settings.
cheers buezi
The calling convention error is also possible when you use a multithreaded library or dll in a single threaded projects in your vc++ (or vice versa?). You should make sure what kind of code you are generating. For a simple irrlicht project single threaded should work (it depends on your needs).
You can check this in "code generation" in the c/c++ folder within the project settings.
cheers buezi
Okay, I've checked and it seems that the irrlicht dll is multithreaded and the irrlicht things I'm doing are single threaded.
So, should I change and make my irrlicht "projects" multithreaded, even though they are small (rarely over 200-300 lines of code) ??
So, should I change and make my irrlicht "projects" multithreaded, even though they are small (rarely over 200-300 lines of code) ??
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
-Japanese Proverb
I've changed and recompiled one of my projects as single-threaded and multi-threaded and it didn't work at all.
Lets just make absolutely sure that the problem isn't in the code:
That's the code (without the #include, #pragma, etc, at the top). So, can anyone see anything wrong with the code? (probably not because it worked before, but now I'm getting a little desperate because I can't run anything I've compiled with irrlicht)
Lets just make absolutely sure that the problem isn't in the code:
Code: Select all
int main()
{
IrrlichtDevice* device = createDevice(video::EDT_DIRECTX8,
core::dimension2d<s32>(640,480), 16);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
device->getFileSystem()->addZipFileArchive("map-20kdm2.pk3");
scene::IAnimatedMesh* mesh = smgr->getMesh("20kdm2.bsp");
scene::ISceneNode* node = 0;
if(mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0) );
if(node)
node->setPosition(core::vector3df(-1300, -144, -1249) );
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
int lastFPS = -1;
while( device->run() ){
driver->beginScene(true, true, video::SColor(0,100,100,100) );
smgr->drawAll();
driver->endScene();
int fps = driver->getFPS();
if( lastFPS != fps ){
wchar_t tmp[1024];
swprintf(tmp, 1024, L"Quake 3 Map Example - Irrlicht Engine (fps:%d) Triangles:%d",
fps, driver->getPrimitiveCountDrawn() );
device->setWindowCaption(tmp);
lastFPS = fps;
}
}
device->drop();
return 0;
}
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
-Japanese Proverb
Okay I believe I have found the problem.
I was mixing and matching dll and lib files.
Hit me, really, right on the head....no its okay, I'm not actually using it!
Thanks for putting up with my complete stupidity guys.
I was mixing and matching dll and lib files.
Hit me, really, right on the head....no its okay, I'm not actually using it!
Thanks for putting up with my complete stupidity guys.
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
-Japanese Proverb