SFML community forums

Help => Window => Topic started by: Revan1985 on April 22, 2011, 11:36:58 am

Title: SFML RenderWindow do not display it when created
Post by: Revan1985 on April 22, 2011, 11:36:58 am
Good morning at all.
I've a little question about the RenderWindow.
There is a way to not display it after created, but only when i want?

The code i use is this :

Code: [Select]

        sf::VideoMode mode;
sf::ContextSettings settings;

mode.Width = 1280;
mode.Height = 720;
mode.BitsPerPixel = 32;

settings.DepthBits = 24;
settings.StencilBits = 8;
settings.AntialiasingLevel = 2;

settings.MajorVersion = 3;
settings.MinorVersion = 3;

sf::RenderWindow App(mode, "SFML OpenGL - Render Window Test", sf::Style::Default, settings);
App.Show(false);
if(GLEW_OK != glewInit())
{
std::cout << "Cannot initialize GLEW context" << std::endl;
sf::Sleep(2.5f);
return EXIT_FAILURE;
}

if(!glewIsSupported("GL_ARB_vertex_buffer_object"))
{
std::cout << "VBO Is not supported, go get yourself a real graphics card" << std::endl;
sf::Sleep(2.5f);
return EXIT_FAILURE;
}

int glVersion[2] = { -1, -1 };
glGetIntegerv(GL_MAJOR_VERSION , &glVersion[0]);
glGetIntegerv(GL_MINOR_VERSION , &glVersion[1]);
std::cout << "Currently using OpenGL " << glVersion[0] << "." << glVersion[1] << std::endl;

thor::StopWatch stopWatch;

GLShaderProgram background;
if(!background.Initialize("", ""))
{
sf::Sleep(5.0f);
return EXIT_FAILURE;
}

App.Show(true);


now, as you can see, i've use an App.Show(false) after the creation, but i can see it "be created and hidden".
It's a thing that i don't want.
How can i do?

Best Regards
Davide Galli
Title: SFML RenderWindow do not display it when created
Post by: Laurent on April 22, 2011, 12:01:59 pm
Quote
There is a way to not display it after created, but only when i want?

No, but that would be cool ;)

It will probably be added for SFML 2.0 or 2.x.