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

Author Topic: Move Window BEFORE Appearing  (Read 7156 times)

0 Members and 2 Guests are viewing this topic.

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
Move Window BEFORE Appearing
« on: August 07, 2010, 11:53:45 pm »
Why can't I move the window before it appears on the screen? I'd like to create a window being at a certain position, but when creating the window it is centered first. When using SetPosition() immetiately after creating I still might see flashing the window on the screen center for a very short moment. That is annoying.

I don't want to use WinAPI or something to create the window at the prefered position.

So, what's about the feature either to choose window position on creating function or creating window hidden first to move it somewhere for example?
Please note that my previous display name was "Shy Guy".

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6288
  • Thor Developer
    • View Profile
    • Bromeon
Move Window BEFORE Appearing
« Reply #1 on: August 08, 2010, 12:09:52 am »
I would find it comfortable to specify whether the sf::Window is initially hidden. This covers also the case where the programmer wants to create windows that are invisible at startup.

This could be either achieved through a default parameter in the constructor and Create(), or a Create() call paying attention to parameters that have been set in advance. I prefer the first option, since 1. it's more intuitive when Create() completely overwrites the current state, and 2. it avoids the need to default-initialize the window just to set one parameter and call Create().
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Move Window BEFORE Appearing
« Reply #2 on: August 08, 2010, 10:16:47 am »
It could be interesting, I'll think about it. Thanks for your feedback.
Laurent Gomila - SFML developer

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
Move Window BEFORE Appearing
« Reply #3 on: August 08, 2010, 04:00:57 pm »
I think it's also quite easy to implement as looking in the source in the Win32 part.
Please note that my previous display name was "Shy Guy".

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Move Window BEFORE Appearing
« Reply #4 on: August 08, 2010, 07:27:29 pm »
Nothing is really hard to implement in SFML ;)
Laurent Gomila - SFML developer

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
Move Window BEFORE Appearing
« Reply #5 on: August 08, 2010, 10:40:50 pm »
Quote from: "Laurent"
Nothing is really hard to implement in SFML ;)

Nothing? So what's about 8-bit sprites, sprites having palettes so that I can switch between them easily without needing much memory?

I was planning a game with a different library using some of those sprites, and now I found SFML. But it doesn't seem to have such a feature. :(
Please note that my previous display name was "Shy Guy".

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6288
  • Thor Developer
    • View Profile
    • Bromeon
Move Window BEFORE Appearing
« Reply #6 on: August 08, 2010, 11:15:34 pm »
Quote from: "Shy Guy"
Quote from: "Laurent"
Nothing is really hard to implement in SFML ;)
Nothing? So what's about ...
The difficulty of a feature implementation is rarely the decisive factor when it comes to the choice of providing a new functionality or not. Much more important are points like: How many users really benefit from the feature, how well it integrates into the rest of the library, whether it is beyond the scope of a basic multimedia framework, and so on.

In summary: Don't add a feature only because it's easy to add. :)


Quote from: "Shy Guy"
... 8-bit sprites, sprites having palettes so that I can switch between them easily without needing much memory?
Can't you achieve this with sf::Image? Switching an image referenced by a sprite is very efficient, if it already exists.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Move Window BEFORE Appearing
« Reply #7 on: August 09, 2010, 08:45:32 am »
Quote
Nothing? So what's about 8-bit sprites, sprites having palettes so that I can switch between them easily without needing much memory?

SFML doesn't support 8-bits images with palettes, but it has nothing to do with the difficulty of implementing it.

Do you really need this feature? I think it was good 20 years ago when video memory was counted in KB, but now with the gigabytes of memory available, who cares?
Laurent Gomila - SFML developer

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
Move Window BEFORE Appearing
« Reply #8 on: August 09, 2010, 05:32:04 pm »
Quote from: "Laurent"
Do you really need this feature? I think it was good 20 years ago when video memory was counted in KB, but now with the gigabytes of memory available, who cares?

I just really like it  :roll:
Please note that my previous display name was "Shy Guy".

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Move Window BEFORE Appearing
« Reply #9 on: August 09, 2010, 05:53:47 pm »
Ok, but you can achieve the same effect with sf::Image and a little bit more coding.
Laurent Gomila - SFML developer

_LB

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Move Window BEFORE Appearing
« Reply #10 on: February 12, 2015, 01:51:20 am »
It's been four years. I'm looking at SFML 2.2 and I don't see a way to create a window initially hidden - am I missing the obvious? Surely it got added years ago?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Move Window BEFORE Appearing
« Reply #11 on: February 25, 2015, 01:04:05 am »
It's been four years. I'm looking at SFML 2.2 and I don't see a way to create a window initially hidden - am I missing the obvious? Surely it got added years ago?

Still does not exist and is not really high on the feature list. Feel free however to investigate it yourself  ;)
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Move Window BEFORE Appearing
« Reply #12 on: February 27, 2015, 06:26:00 pm »
Not sure it's that easy to be done, but I wouldn't call this complicated either.

How about a flag "sf::Style::Hidden"? There'd have to be some way to make it visible again though. Or just some "SetVisible()"? There are some discussions to allow minimizing/maximizing/restoring windows, so all these things might fit into the same general topic.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11053
    • View Profile
    • development blog
    • Email
Re: Move Window BEFORE Appearing
« Reply #13 on: February 28, 2015, 11:29:58 am »
I don't know exactly where, but we've already had this discussion of changing how window "states" and window "styles" are managed. Though that would probably be API breaking...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Move Window BEFORE Appearing
« Reply #14 on: February 28, 2015, 02:09:39 pm »
Yeah, it was a discussion about styles being something static that won't change at "runtime" (or more specific after window creation) and states that could change without recreating the window. Not sure where it's been either though.

 

anything