📄 instisurf.h
字号:
//instISurf.h
#ifndef INST_ISURF_H
#define INST_ISURF_H
#include <instTypes.h>
#include <instDefines.h>
#include <instStr.h>
#include <instIFont.h>
#ifdef DrawText
#undef DrawText
#endif
namespace inst
{
typedef UByte ALPHA; //0-255
typedef UInt16 SURFTYPE;
typedef enum _LINESTYLE
{
LS_SOLID,
LS_DASH,
LS_DOT,
LS_DASHDOT,
LS_DASHDOTDOT,
}LINESTYLE;
class ISurf:virtual public IDynamic //没有alpha通道的普通2D接口
{
public:
virtual ~ISurf(){}
virtual Bool IsA(const CStr &name)const{ return L"inst::i3d::ISurf" || IDynamic::IsA(name); }
public:
virtual POS GetW()const=0;
virtual POS GetH()const=0;
//越界检查!
virtual void Blt(POS xdest,POS ydest,
ISurf *surf,POS xsrc,POS ysrc,POS w,POS h,ALPHA alpha=255,Bool bHasColorKey=True)=0;
virtual void StretchBlt(POS xdest,POS ydest,POS wdest,POS hdest,
ISurf *surf,POS xsrc,POS ysrc,POS wsrc,POS hsrc,ALPHA alpha=255,Bool bHasColorKey=True)=0;
virtual void BltRgn(POS xdest,POS ydest,POS rx,POS ry,POS rw,POS rh,
ISurf *surf,POS xsrc,POS ysrc,POS w,POS h,ALPHA alpha=255,Bool bHasColorKey=True)=0;
virtual void StretchBltRgn(POS xdest,POS ydest,POS wdest,POS hdest,POS rx,POS ry,POS rw,POS rh,
ISurf *surf,POS xsrc,POS ysrc,POS wsrc,POS hsrc,ALPHA alpha=255,Bool bHasColorKey=True)=0;
virtual void SetPixel(POS x,POS y,COLOR color)=0;
virtual COLOR GetPixel(POS x,POS y)const=0;
virtual void DrawLine(POS x1,POS y1,POS x2,POS y2,COLOR color,LINESTYLE ls=LS_SOLID)=0;
virtual void DrawRect(POS x,POS y,POS w,POS h,COLOR color,LINESTYLE ls=LS_SOLID)=0;
virtual void DrawRoundRect(POS x,POS y,POS w,POS h,POS arcw,POS arch,COLOR color,LINESTYLE ls=LS_SOLID)=0;
virtual void DrawEllipse(POS x,POS y,POS w,POS h,COLOR color,LINESTYLE ls=LS_SOLID)=0;
virtual void FillRect(POS x,POS y,POS w,POS h,COLOR color,ALPHA alpha=255)=0;
virtual void FillRoundRect(POS x,POS y,POS w,POS h,POS arcw,POS arch,COLOR color,ALPHA alpha=255)=0;
virtual void FillEllipse(POS x,POS y,POS w,POS h,COLOR color,ALPHA alpha=255)=0;
virtual void DrawText(const CStr &str,POS x,POS y,POS w,POS h,const IFont *font,COLOR color,DRAWTEXTFLAGS flags=0,POS shadow=0,COLOR shadowcolor=Rgb(0,0,0))=0;
};
}//end of namespace inst
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -