Archived

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

IFooBar

why only D3DUSAGE_RENDERTARGET & D3DUSAGE_DEPTHSTENCIL to create a texture

Recommended Posts

hello whats the diff between D3DUSAGE_RENDERTARGET & D3DUSAGE_DEPTHSTENCIL and what do i have to use in teh usage parameter of CreateTexture just to make it a normal texture that i can use after putting colors on it?. those two usage parameters are the only ones for CreateTexture along with dynamic usage. but i dont want to render any scenes to the texture, and i dont think i want it as a depth stencil...so i guess im confused thank u MY HQ [edited by - alfmga on August 12, 2002 5:29:06 AM] [edited by - alfmga on August 12, 2002 5:30:02 AM]

Share this post


Link to post
Share on other sites
A bit out of my code for creating a texture to write on:

// Create a blank texture to write on
LPDIRECT3DTEXTURE8 texture;

HRESULT hr=D3DXCreateTexture(DEVICE,w,h,1,0,D3DFMT_A8R8G8B8,D3DPOOL_MANAGED,&texture);

To actually write to it you need to lock it to get the bytes and then write then unlock it.

Share this post


Link to post
Share on other sites
hello

thanks but i was wondering about IDirect3DDevice8::CreateTexture not the D3DX one. and with CreateTexture you cant specify 0 as the usage it has to be render target or depth stencil...and those are teh two things im confused about.

is D3DUSAGE_DEPTHSTENCIL the same as '0'?

thanks

[edited by - alfmga on August 12, 2002 7:04:47 AM]

Share this post


Link to post
Share on other sites
No, rendertarget is 1 and render stencil is 2 but use the defines instead. You normally use rendertarget, only time to use renderstencil is for depth buffer information.

And do please consider using the d3dx functions, they are extremely fast, faster than most people could write themselves (many of them are internally optimised for best performance based on the processor running the code, e.g. Intel have written some of the internal code tagetted at Pentium processors). I can see no reason for not using them.

Share this post


Link to post
Share on other sites