Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zacintosh

Pages: [1]
1
Window / Re: Make window hidden when created
« on: December 18, 2012, 06:41:32 am »
Thanks, I haven't messed with view much yet. It worked perfect.  Except I had to recenter it.

Final working code for a square screen.
int windowScale = 2;
int windowSize = 256;
sf::RenderWindow window(sf::VideoMode(windowSize*windowScale, windowSize*windowScale), "Resize test");

sf::View gameView;
gameView.setSize(windowSize, windowSize);
gameView.setCenter(windowSize/2,windowSize/2);
window.setView(gameView);

//...rest of code
 

2
Window / Make window hidden when created
« on: December 18, 2012, 06:16:05 am »
Hello, I'm using SFML 2.0 and am trying to make a simple game using small textures. I want it to display at x2 the original size when first loaded, so immediately after creating the renderwindow I resize and move it.

int windowScale = 2;
sf::RenderWindow window(sf::VideoMode(256, 256), "Resize test");
window.setSize(sf::Vector2u(window.getSize().x*windowScale,window.getSize().x*windowScale));
window.setPosition(window.getPosition()-sf::Vector2i(window.getPosition().x/windowScale,window.getPosition().y)/windowScale);

//...rest of code
 

Here's the problem, the small screen appears for a brief moment before resizing.

Is there any way to make a window hidden until after it's resized?
I even tried hiding it using setVisible to hide it immediately after creation, resizing, then making it visible again. It didn't work.

Pages: [1]