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

Author Topic: What to do with multiple windows?  (Read 3274 times)

0 Members and 2 Guests are viewing this topic.

svrtgujbhk

  • Newbie
  • *
  • Posts: 20
    • View Profile
What to do with multiple windows?
« on: June 05, 2011, 01:48:42 pm »
Beware, this may sound like a very noobish question! Why does SFML (and many other game dev libraries) offer a way to create multiple windows? I never saw a game with more than one window and honestly, as a beginning game developer, I can't conceive of any way I might use more than one window.

Are they used as separate game views/states (in-game, main menu, pause menu, etc)? If that's so, how do you switch between windows seamlessly? Why not use the same windows to draw multiple states?

Lupinius

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
What to do with multiple windows?
« Reply #1 on: June 05, 2011, 02:37:52 pm »
My guess is that creating multiple windows is a free bonus you get with object orientation. Each window is independent anyways, so why not allow multiple ones?

Mjonir

  • Full Member
  • ***
  • Posts: 142
    • View Profile
What to do with multiple windows?
« Reply #2 on: June 05, 2011, 02:48:41 pm »
I've seen a chess game use multiple windows. The main window for the game, other windows for miscancellous information about it (list of moves, information about AI, ...) that you could drag where you want.

You could also use another window to display debug information.

Let's say you make a windowed RPG, maybe have the inventory always displayed in another window?


So it's not often necessary, but there are some rare uses... and why not? :)

svrtgujbhk

  • Newbie
  • *
  • Posts: 20
    • View Profile
What to do with multiple windows?
« Reply #3 on: June 05, 2011, 02:58:04 pm »
Quote from: "Mjonir"
So it's not often necessary, but there are some rare uses... and why not? :)


It's not that I'm saying it should be available in the library. I just wanted to make sure my understanding of how games are usually written is flawed. There's nothing wrong with having this extra functionality.

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
What to do with multiple windows?
« Reply #4 on: June 06, 2011, 08:52:49 am »
Well, I think SFML is a multimedia library rather than a game library...

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
What to do with multiple windows?
« Reply #5 on: June 06, 2011, 02:47:33 pm »
Having multiple windows is just something SFML happens to support as it's a multimedia library and not a game library. As one noted since it's well written in an object oriented manner we get this for free.

Also if we look more into details we could say a sf::RenderImage is a in-memory window that is never shown but we can still draw on it. And that gives us pretty many possibilities for games.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
What to do with multiple windows?
« Reply #6 on: June 06, 2011, 06:25:35 pm »
My (commercial) games are all dual screen, thus I have a window for each monitor in use...
SFML 2.1