HBITMAP to Irrlicht Texture

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

HBITMAP to Irrlicht Texture

Post by linkoraclehero »

Does anyone have any codelettes to do this?
And yes, it has to be from an HBITMAP, seeing as I'm working with window screenshots. Saving to a BMP just to load it again 500 times a second would be bad for the hard drive.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You can create a texture in irrlicht and then lock it, which gives you a pointer to the pixels array, and then you can load in the HBITMAP pixels (whatever a HBITMAP is...).
Image Image Image
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

JP wrote:You can create a texture in irrlicht and then lock it, which gives you a pointer to the pixels array, and then you can load in the HBITMAP pixels (whatever a HBITMAP is...).
Well HBITMAP is just the Win32 structure to hold bitmap files. Really I don't get at all why this is needed. You could save the picture, keep it in memory, and not have to load it 500 times per second...what exactly are you trying to accomplish because there isn't anything you couldn't do with IImage that you can with HBITMAP.
TheQuestion = 2B || !2B
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

Post by linkoraclehero »

A) It's a picture that in some cases, WILL change 60 times a second.
B) It's more than just 1 picture, it's about 1-50.
C) It's generated through a Windows API call: A window screenshot.

I don't think I can change how Windows API returns data directly :)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Oh yeah, i was looking at the HBITMAP struct recently. If you check the msdn then you'll be able to see what the struct actually contains and you'll then be able to load it into irrlicht in the way i suggested.

500 times a second sounds slightly high though...
Image Image Image
Post Reply