This is as far as I got, it does not work and I need help please. : http://www.blitzbasic.com/Community/posts.php?topic=51859
CreateVertexBuffer Method (In file d3d7.bmx):
IDirect3DVertexBuffer7 Methods (In file d3d7.bmx):
I've probably made a complete arse of it. I don't have the directX7 SDK and I can only find snippits of code on the web to help me out.
Somebody please come to the rescue.
Type D3DVERTEXBUFFERDESC Field dwSize Field dwNumVertices Field dwFVF Field dwCaps End Type Global pverts:Byte Ptr Global verts:Float[12] Global d3dVertexBuffer:IDirect3DVertexBuffer7 Global desc:D3DVERTEXBUFFERDESC = New D3DVERTEXBUFFERDESC desc.dwSize =SizeOf(desc) desc.dwNumVertices = 16*3 desc.dwFVF = D3DFVF_XYZRHW desc.dwCaps = 0 primarydevice.d3d.CreateVertexBuffer(desc,d3dVertexBuffer,Null) If d3dVertexBuffer = Null Then Print "bugger" pVerts = verts verts[0]=50 verts[1]=200 verts[2]=0 verts[3]=150 verts[4]=50.0 verts[5]=0.0 verts[6]=0 verts[7]=1 verts[8]=250.0 verts[9]=200.0 verts[10]=0 verts[11]=1 d3dVertexBuffer.lock(DDLOCK_WAIT|DDLOCK_WRITEONLY|DDLOCK_NOOVERWRITE,Pverts,Null) MemCopy(pverts,verts,16*3) MemCopy(verts,pverts,16*3) Print verts[0]+" "+verts[1]+" "+verts[2]+" "+verts[3] Print verts[4]+" "+verts[5]+" "+verts[6]+" "+verts[7] Print verts[8]+" "+verts[9]+" "+verts[10]+" "+verts[11] d3dVertexBuffer.Unlock()
CreateVertexBuffer Method (In file d3d7.bmx):
Type IDirect3D7 Extends IUnknown Method CreateVertexBuffer(vbdesc:Byte Ptr ,d3dvertexbuffer:IDirect3DVertexBuffer7 Var,dword)
IDirect3DVertexBuffer7 Methods (In file d3d7.bmx):
Type IDirect3DVertexBuffer7 Extends IUnknown Method Lock(Flags,lplpData:Byte Ptr Var,Size) Method Unlock() Method Optimize(lpD3DDevice,dwFlags) Method ProcessVertices(dwVertexOp,dwDestIndex,dwCount,lpSrcBuffer,dwSrcIndex,lpD3DDevice,dwFlags) Method GetVertexBufferDesc(lpVBDesc:Byte Ptr Var) End Type
I've probably made a complete arse of it. I don't have the directX7 SDK and I can only find snippits of code on the web to help me out.
Somebody please come to the rescue.