I have tryed to merge the second tutorial with the first

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
MZoltan32
Posts: 7
Joined: Wed Jul 31, 2019 2:30 pm

I have tryed to merge the second tutorial with the first

Post by MZoltan32 »

then i noticed something, the program restarts at some time as it seems (camera goes to the original spot)

here is the code i have compiled (and tested with starting the .exe, on release in codeblocks editor using mingw32 compiler), for more positive effects i have commented out guienv draw all maybe this is a problematic point maybe it
has incompatiblities somewhere with all the window function opened


#include <irrlicht.h>
#include <iostream>

/*
In the Irrlicht Engine, everything can be found in the namespace
'irr'. So if you want to use a class of the engine, you have to
write an irr:: before the name of the class. For example to use
the IrrlichtDevice write: irr::IrrlichtDevice. To get rid of the
irr:: in front of the name of every class, we tell the compiler
that we use that namespace from now on, and we will not have to
write that 'irr::'.
*/
using namespace irr;

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

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif

int main()
{

IrrlichtDevice *device =
createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16,
false, false, false, 0);

if (!device)
return 1;


device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");

IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();

guienv->addStaticText(L"Hello World! This is the Irrlicht OpenGL renderer!",
rect<s32>(10,10,260,22), true);

IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
if (!mesh)
{
device->drop();
return 1;
}
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMD2Animation(scene::EMAT_STAND);
node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
}

//smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));


device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3");
scene::IAnimatedMesh* mesh2 = smgr->getMesh("20kdm2.bsp");
scene::ISceneNode* node2 = 0;

if (mesh2)
node2 = smgr->addMeshSceneNode(mesh2->getMesh(0));

if (node2)
node2->setPosition(core::vector3df(-1300,-144,-1249));

smgr->addCameraSceneNodeFPS();

device->getCursorControl()->setVisible(false);





while(device->run())
{

driver->beginScene(true, true, SColor(255,100,101,140));

smgr->drawAll();
//guienv->drawAll();

driver->endScene();
}


device->drop();

return 0;
}
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I have tryed to merge the second tutorial with the first

Post by CuteAlien »

All looks fine (with or without drawAll) and I can't reproduce any problems running your code here.
Maybe rebuild Irrlicht once - always good idea to do that when using MinGW (the buildAllExamples.workspace should be able to rebuild Irrlicht).
Also run original examples and check if there's some problem with them. And maybe check again if you posted the exact code here which you did run (copy it back from forum and compile and check again).
If all doesn't help - do you do anything specific when testing? Any way to reproduce it?
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
MZoltan32
Posts: 7
Joined: Wed Jul 31, 2019 2:30 pm

Re: I have tryed to merge the second tutorial with the first

Post by MZoltan32 »

ok i will try it

I have some few lines also creeping on the quake 3 map some lines along the edges of textures

my computer actually has no anti-aliassing hardware support, can it cause a problem, some program parts issuing an ammount of opengl commands with no ability to respond to it


what i do is i get a little bit far with the camera so almost all of the model is visible then i just wait then it restarts ONLY ONCE it seems


Isnt there a different model i could use instead of md2 model cause the animation maybe running incorrectly for some reason
MZoltan32
Posts: 7
Joined: Wed Jul 31, 2019 2:30 pm

Re: I have tryed to merge the second tutorial with the first

Post by MZoltan32 »

could you make a streamlined cut down version of the engine so 3d rendering is done

and what is useable is opengl (crossplatform) plus some modelling softwares outputs can be used such as blender software

so it is robust, simple and it DOES RUN without complications and it is smallsize
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I have tryed to merge the second tutorial with the first

Post by CuteAlien »

Sorry, can't reproduce and no clue how you get that. Maybe you somehow start it twice?
And no, I'm not going to rewrite the engine for now :-)
But if you look for something easier to use then check-out Godot.
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
MZoltan32
Posts: 7
Joined: Wed Jul 31, 2019 2:30 pm

Re: I have tryed to merge the second tutorial with the first

Post by MZoltan32 »

seems like it does this, wait on something

THEN close or hide the window somehow

then the window reappears again (after rebuilding still the case but the dll size changed)

then as the window reappears the program runs smoothly with no additional interruption


windows does this asking if a program can be started, BUT it does not do it for the built .exe

maybe this is a reason, does your os behaves just like this with most downloaded executable BUT not so with
your built compiled executables?
MZoltan32
Posts: 7
Joined: Wed Jul 31, 2019 2:30 pm

Re: I have tryed to merge the second tutorial with the first

Post by MZoltan32 »

could you send your .dll compiled irrlicht.dll?

maybe its a different size, composition
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I have tryed to merge the second tutorial with the first

Post by CuteAlien »

I don't think this is a dll thing really. And when it comes to codeblocks/mingw it's better to use your own dll, as there are incompatiblities between different versions.
Btw, does it also happen if you start the .exe from outside your IDE (outside of code::blocks)?
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
MZoltan32
Posts: 7
Joined: Wed Jul 31, 2019 2:30 pm

Re: I have tryed to merge the second tutorial with the first

Post by MZoltan32 »

the problem was also happening when this happened

The problem was caused by not coding error but AVG Cybercapture wich restarted the application
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I have tryed to merge the second tutorial with the first

Post by CuteAlien »

Oh man, that's strange :-)
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
Post Reply