本文整理汇总了C++中sf::RenderWindow::SetActive方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderWindow::SetActive方法的具体用法?C++ RenderWindow::SetActive怎么用?C++ RenderWindow::SetActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sf::RenderWindow
的用法示例。
在下文中一共展示了RenderWindow::SetActive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PushOpenGLStates
void ParticleSystem::PushOpenGLStates(sf::RenderWindow& target) const
{
// Switch to manual OpenGL handling, save SFML's state
target.SaveGLStates();
target.SetActive();
// Switch blend mode, depending on glow effect
if (mGlow)
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
else
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
// Store attributes and assign them
glPushAttrib(GL_DEPTH_BITS | GL_TEXTURE_BIT);
glDisable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, mTexture->id);
// Initialize projection matrix (2D view)
glMatrixMode(GL_PROJECTION);
glPushMatrix();
detail::SetupOpenGL2DView(target.GetView());
// Initialize modelview matrix (will be edited in Particle::Render())
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
}
示例2: Display
void KeyboardMenu::Display(sf::RenderWindow& Window, VerticalPositions VPos, HorizontalPositions HPos)
{
Window.SetActive(true);
sf::String DisplayString;
DisplayString.SetFont(font);
DisplayString.SetSize(default_size);
DisplayString.SetColor(sf::Color::Red);
int startHeight;
int Height;
if(menu_options.size() > 10)
{
throw std::runtime_error("Not Implemented: Option List Larger than 10");
}
else
{
if(VPos == VerticalPositions::TOP)
{
startHeight = Height = 10;
for(int i = 0; i < menu_options.size(); i++)
{
DisplayString.SetText(key_list[i].OutputString + " : " + menu_options[i]);
set_string_position(DisplayString, Height, Window.GetWidth());
Window.Draw(DisplayString);
Height += default_size + 10;
}
}
else
{
startHeight = Height = Window.GetHeight() - 10;
for(int i = menu_options.size() - 1; i >= 0; i--)
{
DisplayString.SetText(key_list[i].OutputString + " : " + menu_options[i]);
Height -= DisplayString.GetRect().GetHeight();
set_string_position(DisplayString, Height, Window.GetWidth());
Window.Draw(DisplayString);
Height -= 10;
}
}
}
}