How to convert CEGUI::Texture to LPDIRECT3DTEXTURE9?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Savail
Quite a regular
Quite a regular
Posts: 50
Joined: Wed Jul 04, 2012 07:54

How to convert CEGUI::Texture to LPDIRECT3DTEXTURE9?

Postby Savail » Mon Jul 15, 2013 11:14

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();

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

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

Postby Kulik » Mon Jul 15, 2013 15:01

cast to Direct3D9Texture, use method getDirect3D9Texture()

Savail
Quite a regular
Quite a regular
Posts: 50
Joined: Wed Jul 04, 2012 07:54

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

Postby Savail » Mon Jul 15, 2013 18:15

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

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

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

Postby Kulik » Mon Jul 15, 2013 18:24

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. :)

Savail
Quite a regular
Quite a regular
Posts: 50
Joined: Wed Jul 04, 2012 07:54

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

Postby Savail » Mon Jul 15, 2013 18:35

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!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests