Using Lock/Unlock and createbuffer in particle engine

Started by
1 comment, last by Mille 20 years, 1 month ago
Hey all Ok I''m kind of a DX newbi and struggling with the use af createBuffer(..) and Lock()/Unlock() functions for dynamic textures. I have a feeling I’m using them wrong, although I’m sure I know wich flags to use on dynamic textures. I want to draw 10 textures and fading each one differently as time goes. The textures all has different positions in 3D space. My vertex struct is like this: Struct tVertex { float x,y,z; DWORD color; float u,v; }; Now, do I need 10 vertex-buffers, or can I use 1 vertex-buffer ?? I have a feeling that I can get along with 1 vertexbuffer, but how is I supposed to use the Lock/Unlock methods if I want the call DrawPrimitive(..) only once ?? I want to select the texture ONCE and call DrawPrimitive ONCE if its possible. I just have problems understanding the Lock/Unlock methods (and you’re right I should properly bye a DX book )
www.pokersniffer.org
Advertisement
10 different textures? Then I think you have to call set texture 10 times followed by draw primitive for each. Or have one huge texture and just use unique U and V coords for each so it fits on the right one for each polygon.

..you can lock/unlock as many times as you want if the flag for the vertexbuffer on creation is dynamic as a flag, though you should try and do it only once per frame.
You can specify an offset and length in the DP call, so just split the vertex buffer into 10 sections.

This topic is closed to new replies.

Advertisement