Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Vertex { FLOAT x, y, z, rhw;
- DWORD diffuse_color;
- FLOAT u, v; };
- #define MY_VERTEX_FORMAT (D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1)
- const int num_vertices = 4;
- Vertex vertices[num_vertices] = {
- 0, 0, 0, 1, 0xFFFF0000, 0.0f, 0.0f, // left top
- w, 0, 0, 1, 0xFFFF0000, 1.0f, 0.0f, // right top
- w, h, 0, 1, 0xFFFF0000, 1.0f, 1.0f, // right bottom
- 0, h, 0, 1, 0xFFFF0000, 0.0f, 1.0f // left bottom };
- .....
- m_pD3DD9->SetPixelShader(pShader);
- m_pD3DD9->BeginScene();
- hr = m_pD3DD9->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, 2);
- m_pD3DD9->EndScene();
- sampler2D rgbaTexture : register(S0);
- float4 main(float2 in_Point : TEXCOORD) : COLOR
- {
- …..
- }
- struct Vertex
- {
- FLOAT x, y, z;
- FLOAT u, v;
- };
- ...
- ->BeginScene()
- D3DXMATRIX matView
- D3DXVECTOR3 eye(2, 3, 3); //??
- D3DXVECTOR3 Lat(0, 0, 0); //??
- D3DXVECTOR3 up(0, 1, 0); //??
- D3DXMatrixLookAtRH(&matView, &eye, &Lat, &up);
- d3ddevice->SetTransform(D3DTS_VIEW, &matView);
- D3DXMATRIX matProjection;
- D3DXMatrixPerspectiveFovRH(&matProjection, D3DXToRadian(45.0f), float(SrcW / SrcH), 0.1f, 100.0f);
- m_pD3DD9->SetTransform(D3DTS_PROJECTION, &matProjection);
Add Comment
Please, Sign In to add comment