本文整理汇总了C++中Quad::setTexPosRect方法的典型用法代码示例。如果您正苦于以下问题:C++ Quad::setTexPosRect方法的具体用法?C++ Quad::setTexPosRect怎么用?C++ Quad::setTexPosRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quad
的用法示例。
在下文中一共展示了Quad::setTexPosRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: screenRect
GraphicsPrivate(RGSSThreadData *rtData)
: scRes(DEF_SCREEN_W, DEF_SCREEN_H),
scSize(scRes),
winSize(rtData->config.defScreenW, rtData->config.defScreenH),
screen(scRes.x, scRes.y),
threadData(rtData),
glCtx(SDL_GL_GetCurrentContext()),
frameRate(DEF_FRAMERATE),
frameCount(0),
brightness(255),
fpsLimiter(frameRate),
frozen(false)
{
recalculateScreenSize(rtData);
updateScreenResoRatio(rtData);
TEXFBO::init(frozenScene);
TEXFBO::allocEmpty(frozenScene, scRes.x, scRes.y);
TEXFBO::linkFBO(frozenScene);
TEXFBO::init(currentScene);
TEXFBO::allocEmpty(currentScene, scRes.x, scRes.y);
TEXFBO::linkFBO(currentScene);
FloatRect screenRect(0, 0, scRes.x, scRes.y);
screenQuad.setTexPosRect(screenRect, screenRect);
TEXFBO::init(transBuffer);
TEXFBO::allocEmpty(transBuffer, scRes.x, scRes.y);
TEXFBO::linkFBO(transBuffer);
fpsLimiter.resetFrameAdjust();
const std::string &olImage = rtData->config.touchOverlay.image;
if (!olImage.empty())
{
SDL_RWops *ops = SDL_RWFromFile(olImage.c_str(), "rb");
SDL_Surface *surf = IMG_Load_RW(ops, 1);
if (surf)
{
overlayTex = TEX::gen();
TEX::bind(overlayTex);
TEX::setRepeat(false);
TEX::setSmooth(true);
TEX::uploadImage(surf->w, surf->h, surf->pixels, GL_RGBA);
overlayTexSize = Vec2i(surf->w, surf->h);
}
else
{
Debug() << "failed to load overlay image:" << SDL_GetError();
}
}
}