Textures

Started by
10 comments, last by Keba 20 years, 5 months ago
how do i render from 1 texture to another texture? i need to know which functions to use, the rest can i check in the docs, and how do i create an empty texture?
Advertisement
IDirect3DDevice9::SetRenderTarget
IDirect3DDevice9::CreateTexture
How should i setup the Format for a regular texture that i want to render something on?
Could i take that format from the device?
ok i found it...
but if use IDirect3DDevice9::SetRenderTarget to change render target, do i have to put my buffer back with IDirect3DDevice9::SetRenderTarget also?
You can use any format that the gfx driver reports as both valid texture and render target format.
You can ask the driver for this info, see IDirect3D9::GetDeviceCaps() for more info.

Niko Suni

ok, so what is a IDirect3DSurface9 and how do i connect a texture to it?
Texture consists of one or more surfaces, depending on if you have mip levels or not.
Use IDirect3DTexture9::GetSurfaceLevel(0) to get the top level surface.

-Nik

Niko Suni

i still don''t get this is what i did:


dev->CreateTexture(640,480,0,D3DUSAGE_RENDERTARGET,D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT,&m_pBackground,NULL);


IDirect3DSurface9 *Temp = NULL;
m_pBackground->GetSurfaceLevel(0,&Temp);
m_pd3dDevice->SetRenderTarget(0,Temp);

m_pCurrenStringFont->DrawText( 0, 0, D3DCOLOR_ARG(255,255,255,0), string);

but he failed when trying to Getsurfacelevel
why?
dev->CreateTexture(640,480,0,D3DUSAGE_RENDERTARGET,D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT,&m_pBackground,NULL)

the program failed whem doing this.....is there anything that is wrong?

This topic is closed to new replies.

Advertisement