Skip to main content
GameDev.net gamedev.net
🔒 Locked

C++ syntax and DirectX

Started by real_man Nov 20, 2000 at 2:11 AM 2 replies 400+ views
Original Post
real_man
real_man
At the moment I am trying to make a DirectX example in ASM but I cannot understand some C++.
  
g_pd3dDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX );

//and 


CUSTOMVERTEX g_Vertices[] = 
{ 
{ 150.0f, 50.0f, 0.5f, 1.0f, 0xffff0000, }, // x, y, z, rhw, color 

{ 250.0f, 250.0f, 0.5f, 1.0f, 0xff00ff00, }, 
{ 50.0f, 250.0f, 0.5f, 1.0f, 0xff00ffff, }, 
};

//and 


if( FAILED( g_pd3dDevice->CreateVertexBuffer( 3*sizeof(CUSTOMVERTEX), 
0 /* Usage */, D3DFVF_CUSTOMVERTEX, 
D3DPOOL_DEFAULT, &g_pVB ) ) ) 
return E_FAIL;
  
I don''t understand the syntax of those at all. Can you help me? I want to make most of this by myself. I just need to know how to make some of the above statements into asm. Thanks for any help you might be able to give me. I don''t expect much help because this is so hard... Cya, Kenny
Friday13
Friday13
I haven''t messed with DX8 yet, however, in DX7 the above (excluding VertexShader stuff) would look as follows:


push 0
push offset VertexBuffer7_Ptr ;var. that receives the interface
push offset My_D3DVERTEXBUFFERDESC ; ptr to VertexBuffer structure

mov eax,[IDirect3D7] ;must be valid interface to IDirect3D7
push eax
mov ecx,[eax]
call dword ptr [ecx+5*4] ;IDirect3D7->CreateVertexBuffer
real_man
real_man
Hey guys thanks!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.