Advertisement
GAMELASTER

Untitled

Jan 6th, 2016
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. VERTEX OurVertices[] =
  2.     {
  3.         { D3DXVECTOR3(0.0f, 0.5f, 0.0f), D3DXCOLOR(1.0f, 0.0f, 0.0f, 1.0f) },
  4.         { D3DXVECTOR3(0.45f, -0.5, 0.0f), D3DXCOLOR(0.0f, 1.0f, 0.0f, 1.0f) },
  5.         { D3DXVECTOR3(-0.45f, -0.5f, 0.0f), D3DXCOLOR(0.0f, 0.0f, 1.0f, 1.0f) }
  6.     };
  7. //there is "OurVertices" a VERTEX[3]
  8.     Mesh *mash = new Mesh(dxc, OurVertices);
  9.  
  10. //VERTEX struct:
  11. struct VERTEX { D3DXVECTOR3 Pos; D3DXCOLOR Color; };
  12.  
  13. //Mesh constructor
  14. Mesh::Mesh(DirectXContext * dxc, VERTEX *vertices)
  15. {
  16. //vertices is "VERTEX *", what is no wrong, but it is not an array anymore! Its just contains a first struct
  17.  
  18. //vertices have good value only if the Mesh constructor is:
  19. Mesh::Mesh(DirectXContext * dxc, VERTEX (&vertices)[3])
  20. {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement