Page 1 of 1

Drawing a image in 3D space

Posted: Tue Nov 13, 2007 8:01 pm
by radubolovan
I have an image in memory, I mean I know width, height, type (eg. ECF_A8R8G8B8) and a pointer to bytes data.
How can I create a ITexture on the fly? (without write a png file to the disk and then driver->getTexture( "my_file" ) - I cand do that but it's not quite a cool option).
Thank you!

Posted: Tue Nov 13, 2007 10:19 pm
by arras
IImage* IVideoDriver::createImageFromData(ECOLOR_FORMAT format, const core::dimension2d<s32> &size, void *data, bool ownForeignMemory=false, bool deleteMemory=true)

ITexture* IVideoDriver::addTexture (const c8 *name, IImage *image)

Posted: Tue Nov 13, 2007 10:33 pm
by rogerborg
IImage* IVideoDevice::createImageFromData(ECOLOR_FORMAT format, const core::dimension2d<s32>& size, void *data,...);

ITexture * IVideoDevice::addTexture(const c8* name, IImage* image);

[UPDATE - damn yoooooooouuuuuuu! ;) ]

Posted: Tue Nov 13, 2007 11:51 pm
by radubolovan
Thank you very much! :)
I new about

Code: Select all

IImage* IVideoDevice::createImageFromData(ECOLOR_FORMAT format, const core::dimension2d<s32>& size, void *data,...);
And I thaught that

Code: Select all

ITexture * IVideoDevice::addTexture(const c8* name, IImage* image);
will load a texture from a file ... I should look at the code :wink:

Posted: Wed Nov 14, 2007 9:23 pm
by radubolovan
Now I have another "problem". How can I draw that texture in 3D space (not 2D, using IVideoDriver->draw2DImage( ... );
I want to draw it in an 3d quadrilateral.

//later
And of course scale, rotate.