[C++] Create a screenshot

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hey, great job. Could you host or send the files such that I need not copy them from the web page?
Last edited by hybrid on Tue Jul 25, 2006 8:01 pm, edited 1 time in total.
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

nice :)

but what is SBMPHeader?

edit: ah sry now i know. its just my compiler sasys that SBMPHeader is not declared.
Last edited by Halan on Tue Jul 25, 2006 6:41 pm, edited 1 time in total.
miko93
Posts: 54
Joined: Sat Nov 12, 2005 5:24 pm
Location: Regensburg, Germany
Contact:

Post by miko93 »

Any chance we are going to see this code in the cvs Irrlicht version?
*cough *hinthint
"Yessir, I'll be happy to make these unnecessary changes to this irrelevant document." (Dilbert)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, CVS is dead. But SVN might have a chance.
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

yeah hybrid implent it espacially the image-writers :)

well ive got a problem. if i do it this way

Code: Select all

CImageWriterBMP Writer;
Writer->writeImage(file, image);
it stops compiling and says
base operand of `->' has non-pointer type `CImageWriterBMP'
if i do it this way

Code: Select all

CImageWriterBMP* Writer;
Writer->writeImage(file, image);
it crashes at runtime (as expected)

any ideas?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Simply learn the subtle differences of objects and pointers in C++ and use a . instead of -> in the former case. -> is the dereference and access object attribute operator, while . is simply the access object attribute operator. Since you have no pointer here you should not dereference (better you cannot).
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

ah ok thanks... well i still crashes at createScreenshot(). i dont know why :(
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Did you use the correct (updated) headers when you recompiled your app? Otherwise the class sizes are wrong and the code will access classes in a weird way. Probably alos compile everything from scratch as most windows tools do not recognize dependencies correctly.
wooohoh
Posts: 5
Joined: Fri Aug 25, 2006 9:02 am

Post by wooohoh »

i just wonder where does SBMPHeader & etc comes from.. :cry:
I tired to use this code, but realized that i don't have them anywhere in the code :?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The struct SBMPHeader is in CImageLoaderBMP.h. It would be much easier for you if you just got Irrlicht 1.0 or later. The Image writer and screenshot code is all included in Irrlicht now.
Post Reply