2004-12-15 22:24:46 +01:00
|
|
|
#ifndef GUIRenderer_h
|
|
|
|
#define GUIRenderer_h
|
|
|
|
|
|
|
|
#include "lib/res/handle.h"
|
|
|
|
#include "ps/Overlay.h"
|
|
|
|
#include "ps/CStr.h"
|
|
|
|
#include <vector>
|
|
|
|
|
2004-12-18 14:32:00 +01:00
|
|
|
struct SGUIImageEffects;
|
|
|
|
|
2004-12-15 22:24:46 +01:00
|
|
|
namespace GUIRenderer
|
|
|
|
{
|
2004-12-19 13:20:04 +01:00
|
|
|
class IGLState
|
2004-12-16 13:01:47 +01:00
|
|
|
{
|
2004-12-19 13:20:04 +01:00
|
|
|
public:
|
|
|
|
virtual ~IGLState() {};
|
|
|
|
virtual void Set(Handle tex)=0;
|
|
|
|
virtual void Unset()=0;
|
2004-12-16 13:01:47 +01:00
|
|
|
};
|
|
|
|
|
2004-12-15 22:24:46 +01:00
|
|
|
struct SDrawCall
|
|
|
|
{
|
2004-12-19 13:20:04 +01:00
|
|
|
SDrawCall() : m_TexHandle(0), m_Effects(NULL) {}
|
|
|
|
|
|
|
|
Handle m_TexHandle;
|
2004-12-15 22:24:46 +01:00
|
|
|
|
|
|
|
bool m_EnableBlending;
|
|
|
|
|
2004-12-19 13:20:04 +01:00
|
|
|
IGLState* m_Effects;
|
2004-12-18 14:32:00 +01:00
|
|
|
|
2004-12-15 22:24:46 +01:00
|
|
|
CRect m_Vertices;
|
|
|
|
CRect m_TexCoords;
|
|
|
|
float m_DeltaZ;
|
|
|
|
|
|
|
|
CColor m_BorderColor; // == CColor() for no border
|
|
|
|
CColor m_BackColor;
|
|
|
|
};
|
|
|
|
|
2004-12-19 13:20:04 +01:00
|
|
|
class DrawCalls : public std::vector<SDrawCall>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void clear();
|
|
|
|
DrawCalls();
|
|
|
|
DrawCalls(const DrawCalls&);
|
|
|
|
const DrawCalls& DrawCalls::operator=(const DrawCalls&);
|
|
|
|
~DrawCalls();
|
|
|
|
};
|
2004-12-15 22:24:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "gui/CGUISprite.h"
|
|
|
|
|
|
|
|
namespace GUIRenderer
|
|
|
|
{
|
2004-12-18 14:32:00 +01:00
|
|
|
void UpdateDrawCallCache(DrawCalls &Calls, CStr &SpriteName, CRect& Size, int CellID, std::map<CStr, CGUISprite> &Sprites);
|
2004-12-15 22:24:46 +01:00
|
|
|
|
|
|
|
void Draw(DrawCalls &Calls);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // GUIRenderer_h
|