How to set an image using LPDIRECT3DBASETEXTURE9
Posted: Wed Dec 08, 2010 15:50
Hello!
I have an Window with an image, loaded from an layout. Now I would like to change the image on using a LPDIRECT3DBASETEXTURE9 that I created on the fly using a RenderSurface ingame. How do I set set the image to the CEGUI::Window?
Also I have another question. Feels stupid to ask about it but I honestly can't find anything about it. How do i Simply load an image from the hardrive, I mean, without using layouts, schemes or whatever. I was looking for something like "LoadImage("image.png");
Kind Regards!
EDIT: SOLVED:
This is my code atm:
LPDIRECT3DBASETEXTURE9 xD3DTexture = TVManager::getSingletonPtr()->m_pCTVInternalObjects->GetTexture(iTextureID);
CEGUI::Direct3D9Renderer * pD3DRender = &CEGUI::Direct3D9Renderer::create(TVManager::getSingletonPtr()->m_pCTVInternalObjects->GetDevice3D());
CEGUI::Texture * pGUITexture = &pD3DRender->createTexture((LPDIRECT3DTEXTURE9)xD3DTexture);
CEGUI::Imageset* tempImageset = &m_pGui->GetImagesetManager()->create( "previewImage", *pGUITexture );
tempImageset->defineImage("previewImage", CEGUI::Point(0.0f,0.0f), CEGUI::Size( 512.0, 512.0 ), CEGUI::Point(0.0f,0.0f));
std::string tmpString = "set: previewImage" + std::string(" image:") + "previewImage";
m_pPreviewWnd->setProperty("Image", tmpString.c_str());
It turns up black though
I have an Window with an image, loaded from an layout. Now I would like to change the image on using a LPDIRECT3DBASETEXTURE9 that I created on the fly using a RenderSurface ingame. How do I set set the image to the CEGUI::Window?
Also I have another question. Feels stupid to ask about it but I honestly can't find anything about it. How do i Simply load an image from the hardrive, I mean, without using layouts, schemes or whatever. I was looking for something like "LoadImage("image.png");
Kind Regards!
EDIT: SOLVED:
This is my code atm:
LPDIRECT3DBASETEXTURE9 xD3DTexture = TVManager::getSingletonPtr()->m_pCTVInternalObjects->GetTexture(iTextureID);
CEGUI::Direct3D9Renderer * pD3DRender = &CEGUI::Direct3D9Renderer::create(TVManager::getSingletonPtr()->m_pCTVInternalObjects->GetDevice3D());
CEGUI::Texture * pGUITexture = &pD3DRender->createTexture((LPDIRECT3DTEXTURE9)xD3DTexture);
CEGUI::Imageset* tempImageset = &m_pGui->GetImagesetManager()->create( "previewImage", *pGUITexture );
tempImageset->defineImage("previewImage", CEGUI::Point(0.0f,0.0f), CEGUI::Size( 512.0, 512.0 ), CEGUI::Point(0.0f,0.0f));
std::string tmpString = "set: previewImage" + std::string(" image:") + "previewImage";
m_pPreviewWnd->setProperty("Image", tmpString.c_str());
It turns up black though