4 #include "util/intrusive_ptr.h" 16 struct DXUT_SCREEN_VERTEX;
27 void Init(
int nImageSize);
39 Gdiplus::Graphics* GetGraphics() {
return m_pGraphics;}
42 Gdiplus::Bitmap* GetBitmapSurface(){
return m_pBitmapSurface;}
53 typedef ParaIntrusivePtr<CGDIRenderTarget> CGDIRenderTarget_ptr;
60 typedef std::map<std::string, Gdiplus::Bitmap*> TextureAsset_Map_Type;
61 typedef std::map<std::string, CGDIRenderTarget_ptr> RenderTarget_Map_Type;
66 virtual HRESULT Create();
67 virtual HRESULT Destroy();
71 HRESULT Clear(
const Color &color);
74 void SetTransform(
const Gdiplus::Matrix * matTransform);
80 bool DrawImage(Gdiplus::Image *image,
float x,
float y,
float width,
float height);
84 bool DrawImage(Gdiplus::Image *image,
float x,
float y,
float width,
float height, DWORD dwColor);
93 Gdiplus::Bitmap* LoadTexture(
const string& filename);
99 Gdiplus::Bitmap* LoadTexture(
const string& filename,
int nFileFormat);
104 Gdiplus::Bitmap* LoadTexture(
const string& filename,
const string& fileextension);
109 CGDIRenderTarget_ptr CreateGetRenderTarget(
const std::string& sName,
int nRenderTargetSize = 256);
114 CGDIRenderTarget_ptr CreateGetRenderTargetBySize(
int nRenderTargetSize = 256);
118 bool SetRenderTarget(CGDIRenderTarget_ptr pRenderTarget);
123 bool SaveRenderTarget(
const string& filename,
int nWidth=256,
int nHeight=256,
bool bHasAlpha=
true, DWORD colorKey = 0);
132 TextureAsset_Map_Type m_textures;
135 RenderTarget_Map_Type m_render_targets;
138 CGDIRenderTarget_ptr m_pRenderTarget;
141 CGDIRenderTarget_ptr m_pDefaultRenderTarget;
144 int m_nRenderTargetSize;
147 Gdiplus::Graphics* m_pGraphics;
a gdi render target is a Gdiplus::Bitmap and Gdiplus::Graphics object.
Definition: GDIEngine.h:19
this allows us to create another device, such as in a worker thread to perform some background work w...
Definition: GDIEngine.h:57
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: GDIEngine.h:6
Gdiplus::Bitmap * m_pBitmapSurface
the current render target.
Definition: GDIEngine.h:45
Gdiplus::Graphics * m_pGraphics
the default graphics for the render target.
Definition: GDIEngine.h:51
int GetRenderTargetSize()
get the render target size.
Definition: GDIEngine.h:36
single-threaded reference counted base class for boost::intrusive_ptr all boost::intrusive_ptr<T>, should derive from this class.
Definition: intrusive_ptr.h:75
Definition: ParaColor.h:275
int m_nRenderTargetSize
the current render target size, default to 256 pixels.
Definition: GDIEngine.h:48