本文整理汇总了C++中SpriteBatch::SetBlendModeAlpha方法的典型用法代码示例。如果您正苦于以下问题:C++ SpriteBatch::SetBlendModeAlpha方法的具体用法?C++ SpriteBatch::SetBlendModeAlpha怎么用?C++ SpriteBatch::SetBlendModeAlpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpriteBatch
的用法示例。
在下文中一共展示了SpriteBatch::SetBlendModeAlpha方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
/// @summary Submits a single frame to the GPU for rendering. Runs once per
/// application tick at a variable timestep.
/// @param currentTime The current absolute time, in seconds. This represents
/// the time at which the current tick started.
/// @param elapsedTime The time elapsed since the previous tick, in seconds.
/// @param t A value in [0, 1] indicating how far into the current simulation
/// step we are at the time the frame is generated.
/// @param width The width of the default framebuffer, in pixels.
/// @param height The height of the default framebuffer, in pixels.
static void render(double currentTime, double elapsedTime, double t, int width, int height)
{
UNUSED_ARG(currentTime);
UNUSED_ARG(elapsedTime);
UNUSED_ARG(t);
DisplayManager *dm = gDisplayManager;
SpriteBatch *batch = dm->GetBatch();
SpriteFont *font = dm->GetFont();
float rgba[]= {1.0f, 0.0f, 0.0f, 1.0f};
dm->SetViewport(width, height);
dm->Clear(0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0);
dm->BeginFrame();
batch->SetBlendModeAlpha();
font->Draw("Hello, world!", 0, 0, 1, rgba, 5.0f, 5.0f, batch);
gEntityManager->Draw(currentTime, elapsedTime, dm);
dm->EndFrame();
}