Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Keba

Textures

This topic is 5430 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
How should i setup the Format for a regular texture that i want to render something on?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!