why only D3DUSAGE_RENDERTARGET & D3DUSAGE_DEPTHSTENCIL to create a texture

Started by
2 comments, last by IFooBar 21 years, 8 months ago
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]
[size=2]aliak.net
Advertisement
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.
------------------------See my games programming site at: www.toymaker.info
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]
[size=2]aliak.net
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.
------------------------See my games programming site at: www.toymaker.info

This topic is closed to new replies.

Advertisement