Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef RENDERER_H
- #define RENDERER_H
- #include "Include.h"
- class Color
- {
- public:
- Color ( int red, int green, int blue, int alpha )
- {
- m_red = red; m_green = green; m_blue = blue; m_alpha = alpha;
- m_colorCode = D3DCOLOR_RGBA(red, green, blue, alpha);
- }
- Color ( DWORD colorCode )
- {
- m_colorCode = colorCode;
- }
- DWORD GetCode ( void ) { return m_colorCode; }
- int A ( void ) { return m_alpha; }
- int R ( void ) { return m_red; }
- int G ( void ) { return m_green; }
- int B ( void ) { return m_blue; }
- private:
- DWORD m_colorCode;
- int m_red, m_green, m_blue, m_alpha;
- };
- #define COLORCODE(r, g, b, a) Color ( r, g, b, a )
- #define COLOR_WHITE Color ( 255, 255, 255, 255 )
- #define COLOR_BLACK Color ( 0, 0, 0, 255 )
- #define COLOR_RED Color ( 255, 0, 0, 255 )
- #define COLOR_GREEN Color ( 0, 255, 0, 255 )
- #define COLOR_BLUE Color ( 0, 0, 255, 255 )
- #define COLOR_CYAN Color ( 0, 150, 255, 255 )
- #define COLOR_YELLOW Color ( 255, 255, 0, 255 )
- class CRenderer
- {
- public:
- CRenderer ( void );
- ~CRenderer ( void );
- void Update ( IDirect3DDevice9* pDevice );
- void PreFrame ( void );
- void PostFrame ( void );
- void Release ( void );
- void SetDevice ( IDirect3DDevice9* pDevice );
- IDirect3DDevice9* GetDevice ( void );
- void Rect ( int x, int y, int w, int h, Color color );
- void RectOutlined ( int x, int y, int w, int h, Color color, Color outlined, int t );
- void BorderBox ( int x, int y, int w, int h, Color color, int t );
- void BorderBoxOutlined ( int x, int y, int w, int h, Color color, Color outlined, int t );
- void Line ( int x0, int y0, int x1, int y1, int w, Color color );
- void String ( const char* fontName, int x, int y, Color color, const char* text, ... );
- void StringOutlined ( const char* fontName, int x, int y, Color color, const char* text, ... );
- void Circle ( int x, int y, int radius, Color color );
- private:
- bool IsReady ( void );
- private:
- ID3DXSprite* m_pSprite;
- IDirect3DStateBlock9* m_pStateBlock;
- IDirect3DDevice9* m_pDevice;
- DWORD_PTR m_dwFVF;
- };
- extern CRenderer gRenderer;
- #endif // RENDERER_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement