Page 1 of 1

How to convert CEGUI::Texture to LPDIRECT3DTEXTURE9?

Posted: Mon Jul 15, 2013 11:14
by Savail
Hey,

Code: Select all

* -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
14/07/2013 16:23:27 (Std)    ********************************************************************************
14/07/2013 16:23:27 (Std)    ---- Version 0.7.8 (Build: Mar 17 2013 Microsoft Windows MSVC++ 9.0 32 bit) ----
14/07/2013 16:23:27 (Std)    ---- Renderer module is: CEGUI::Direct3D9Renderer - Official Direct3D 9 based 2nd generation renderer module. ----
14/07/2013 16:23:27 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
14/07/2013 16:23:27 (Std)    ---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
14/07/2013 16:23:27 (Std)    ---- Scripting module is: None ----
14/07/2013 16:23:27 (Std)    ********************************************************************************
14/07/2013 16:23:27 (Std)    * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *


Firstly I would like to thank CEGUI devs for continued support for their users and work on this great library :D. I guess I have a simple question but can't solve it by myself... I would like to convert CEGUI::Texture to my native DirectX texture format - LPDIRECT3DTEXTURE9. How could I do this? This is how I get the CEGUI::Texture which interests me:

Code: Select all

CEGUI::ImagesetManager::getSingleton().get("My Imageset Name")->getTexture();

Re: How to convert CEGUI::Texture to LPDIRECT3DTEXTURE9?

Posted: Mon Jul 15, 2013 15:01
by Kulik
cast to Direct3D9Texture, use method getDirect3D9Texture()

Re: How to convert CEGUI::Texture to LPDIRECT3DTEXTURE9?

Posted: Mon Jul 15, 2013 18:15
by Savail
Thanks for answer! The wierd thing is that this class CEGUI::Direct3D9Texture doesn't seem to exist at all. This is how its definition looks like in CEGUIDirect3D9Renderer.h:

Code: Select all

// Start of CEGUI namespace section
namespace CEGUI
{
class Direct3D9Texture;
...


I downloaded the latest CEGUI as well but it looks pretty much the same there. Please don't say that those classes are still unimplemented :(. I can't even cast it:

Code: Select all

dynamic_cast<CEGUI::Direct3D9Texture*>(CEGUI::ImagesetManager::getSingleton().get("Game").getTexture())->getDirect3D9Texture();

becouse compiler doesn't let me and says:

Code: Select all

 error C2680: 'CEGUI::Direct3D9Texture *' : invalid target type for dynamic_cast

Re: How to convert CEGUI::Texture to LPDIRECT3DTEXTURE9?

Posted: Mon Jul 15, 2013 18:24
by Kulik
Are you sure you have included the file that actually defines Direct3D9Texture? The file you listed just forward declares it.

You really need to learn how to work your tools, especially grep. :)

Re: How to convert CEGUI::Texture to LPDIRECT3DTEXTURE9?

Posted: Mon Jul 15, 2013 18:35
by Savail
ehh... Sorry for my dumbness :oops: . I have already got used to having whatever I need in CEGUI already included :O, probably due to the long break I had from programming :P. Thanks a lot for quick help!