本文整理汇总了C++中CGraphic::DrawSub方法的典型用法代码示例。如果您正苦于以下问题:C++ CGraphic::DrawSub方法的具体用法?C++ CGraphic::DrawSub怎么用?C++ CGraphic::DrawSub使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGraphic
的用法示例。
在下文中一共展示了CGraphic::DrawSub方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VideoDrawChar
/**
** Draw character with current color.
**
** @param g Pointer to object
** @param gx X offset into object
** @param gy Y offset into object
** @param w width to display
** @param h height to display
** @param x X screen position
** @param y Y screen position
*/
static void VideoDrawChar(const CGraphic &g,
int gx, int gy, int w, int h, int x, int y, const CFontColor &fc)
{
if (!UseOpenGL) {
SDL_Rect srect = {gx, gy, w, h};
SDL_Rect drect = {x, y, 0, 0};
std::vector<SDL_Color> sdlColors(fc.Colors, fc.Colors + MaxFontColors);
SDL_SetColors(g.Surface, &sdlColors[0], 0, MaxFontColors);
SDL_BlitSurface(g.Surface, &srect, TheScreen, &drect);
} else {
g.DrawSub(gx, gy, w, h, x, y);
}
}
示例2: VideoDrawChar
/**
** Draw character with current color.
**
** @param g Pointer to object
** @param gx X offset into object
** @param gy Y offset into object
** @param w width to display
** @param h height to display
** @param x X screen position
** @param y Y screen position
*/
static void VideoDrawChar(const CGraphic &g,
int gx, int gy, int w, int h, int x, int y, const CFontColor &fc)
{
#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
g.DrawSub(gx, gy, w, h, x, y);
} else
#endif
{
SDL_Rect srect = {Sint16(gx), Sint16(gy), Uint16(w), Uint16(h)};
SDL_Rect drect = {Sint16(x), Sint16(y), 0, 0};
std::vector<SDL_Color> sdlColors(fc.Colors, fc.Colors + MaxFontColors);
SDL_SetColors(g.Surface, &sdlColors[0], 0, MaxFontColors);
SDL_BlitSurface(g.Surface, &srect, TheScreen, &drect);
}
}