lordzero
16-09-2007, 11:30 PM
Hello
I'm trying move a sprite using custom vertex using D3DFVF_XYZRHW.
my code work to move sprite only when i set the position in OnCreate of my window...
dont have a way to move it in runtime?
this code dont work to change the position x ate runtime:
if key=VK_RIGHT then
begin
PosX := PosX + 1;
end;
if key=VK_LEFT then
begin
PosX := PosX - 1;
end;
{ if FAILED(
pVB.Lock(0, SizeOf(Vertices), pVertices, 0)) then
Exit;
CopyMemory(pVertices, @Vertices, SizeOf(Vertices));
pVB.Unlock;
my complete code is here:
http://www.lordzero.co.nr/tmp/DrawPrimitive.zip
suggestions are welcome.
Greets
I'm trying move a sprite using custom vertex using D3DFVF_XYZRHW.
my code work to move sprite only when i set the position in OnCreate of my window...
dont have a way to move it in runtime?
this code dont work to change the position x ate runtime:
if key=VK_RIGHT then
begin
PosX := PosX + 1;
end;
if key=VK_LEFT then
begin
PosX := PosX - 1;
end;
{ if FAILED(
pVB.Lock(0, SizeOf(Vertices), pVertices, 0)) then
Exit;
CopyMemory(pVertices, @Vertices, SizeOf(Vertices));
pVB.Unlock;
my complete code is here:
http://www.lordzero.co.nr/tmp/DrawPrimitive.zip
suggestions are welcome.
Greets