Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef SPRITE_BATCHER
- #define SPRITE_BATCHER
- #include <d3d9.h>
- #define CUSTOMFVF (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)
- class SpriteBatcher
- {
- //Vertex struct
- struct vertex
- {
- float x;
- float y;
- float z;
- float rhw;
- D3DCOLOR color;
- };
- private:
- LPDIRECT3DVERTEXBUFFER9 vBuffer;
- LPDIRECT3DINDEXBUFFER9 iBuffer;
- D3DCOLOR CLEAR_COLOR;
- vertex vertices[8];
- short indices[12];
- int numShapes;
- int vertCount;
- int idxBuffIndex;
- VOID* pVoid;
- public:
- SpriteBatcher();
- ~SpriteBatcher();
- void beginBatch();
- void endBatch(LPDIRECT3DDEVICE9 &device);
- void render(LPDIRECT3DDEVICE9 &device);
- void draw(float x, float y, float width, float height, D3DCOLOR color);
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement