Advertisement
Guest User

SpriteBatcher.h

a guest
Sep 17th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #ifndef SPRITE_BATCHER
  2. #define SPRITE_BATCHER
  3. #include <d3d9.h>
  4.  
  5. #define CUSTOMFVF (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)
  6.  
  7. class SpriteBatcher
  8. {
  9. //Vertex struct
  10. struct vertex
  11. {
  12. float x;
  13. float y;
  14. float z;
  15. float rhw;
  16. D3DCOLOR color;
  17. };
  18.  
  19. private:
  20. LPDIRECT3DVERTEXBUFFER9 vBuffer;
  21. LPDIRECT3DINDEXBUFFER9 iBuffer;
  22. D3DCOLOR CLEAR_COLOR;
  23. vertex vertices[8];
  24. short indices[12];
  25. int numShapes;
  26. int vertCount;
  27. int idxBuffIndex;
  28. VOID* pVoid;
  29.  
  30. public:
  31. SpriteBatcher();
  32. ~SpriteBatcher();
  33. void beginBatch();
  34. void endBatch(LPDIRECT3DDEVICE9 &device);
  35. void render(LPDIRECT3DDEVICE9 &device);
  36. void draw(float x, float y, float width, float height, D3DCOLOR color);
  37. };
  38.  
  39. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement