PDA

View Full Version : powerdraw tutorials



mitch
05-04-2003, 01:47 PM
hi there

is there a online tutorial for powerdraw.

i use powerdraw 242
and with the tutorial files there is only comment but not a step by step tutorial.

so i tought maybe i missed something like a site with the tutorial on it.

thanks mitch

mitch
05-04-2003, 07:30 PM
i have changed the red parts of tutorial 2
it should make a square but it makes a triangle
whats wrong?

function TForm1.InitVertexBuffer(): boolean;

var _vb : array[0...3] of TCustomVertex;
_ptr : pByte;

begin
Result := false;

// Initialize the vertices.
_vb[0] := GetCustomVertex(0, 0, 0.5, 1, $FFFF0000);
_vb[1] := GetCustomVertex(250, 0, 0.5, 1, $FF00FF00);
_vb[2] := GetCustomVertex( 0, 250, 0.5, 1, $FF0000FF);
_vb[3] := GetCustomVertex(250, 250, 0.5, 1, $FF0000FF);



// Create a vertex buffer.
if failed(PowerGraph.D3DDevice8.CreateVertexBuffer(Si zeOf(_vb), 0,
D3DFVF_CUSTOMVERTEX,
D3DPOOL_DEFAULT,
VertexBuffer)) then exit;

// Lock, fill and unlock vertex buffer.
if failed(VertexBuffer.Lock(0, SizeOf(_vb), _ptr, 0)) then exit;
Move(_vb, _ptr^, SizeOf(_vb));
VertexBuffer.Unlock;

// All right
Result := true;
end;

Paulius
06-04-2003, 11:04 AM
Try swiching 3rd and 4th vertexs coordinates. The third one should be bottom right and the fourth one bottom left.