User forums > Using Code::Blocks
huh what the hell...
lubos:
im coding 2d game engine with sdl in code::blocks. i have coded particle systems yesterday and i noticed today that when i run program from ide, it runs differently than when i run him directly from explorer.
i will create two particle systems:
CParticleSystem psys1;
CParticleSystem psys2;
...init them...
and draw them:
psys1.draw(0, 0); // x and y pos of origin
psys2.draw(800, 0)
so it should draw two particle systems, one at pos 0,0 and another one at pos 800,0
however when i run this from c::b, it draws ony first created system(psys1). when i run program from explorer all is OK, it will draw both particle systems.. HOW IS THIS POSSIBLE? i have setted working directory, using release target...
winXP SP2, nightly 4092
David Perfors:
are you using a console project? if so, you could try to turn off "Pause on exit" option (Project settings, not sure about the name of that option, don't have C::B here)
lubos:
its a 'GUI application', not console :( i have really no idea why it work differently from explorer and from ide.
byo:
--- Quote from: lubos on June 19, 2007, 02:44:11 pm ---its a 'GUI application', not console :( i have really no idea why it work differently from explorer and from ide.
--- End quote ---
Do you load any bitmaps or other files to show particles? The main difference between program running in IDE and from explorer/command line is working directory. When you run from IDE, current directory is not set to exe's location but to directory where is project file. Analogically when you run it from explorer, current directory is set to exe's path.
Regards
BYO
lubos:
--- Quote from: lubos on June 19, 2007, 01:57:43 pm ---...i have setted working directory,...
--- End quote ---
thanks for your post. im using images but i have working directory setted to .exe directory(release dir)..(both particle systems are using images, first one works)
what i have noticed..
when i will code it like this:
CParticleSystem *pSys1;
CParticleSystem *pSys2;
pSys1 = new CParticleSystem;
...
init...
now it will draw both systems.. it will also works when i do it like
CParticleSystem pSys[2];
im out of this..maybe i should create it with pointer...but anyway, shouldnt it work same from explorer and from ide.. :?
Navigation
[0] Message Index
[#] Next page
Go to full version