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

Author Topic: New global inputs in SFML 2  (Read 24997 times)

0 Members and 1 Guest are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
New global inputs in SFML 2
« Reply #30 on: July 08, 2011, 11:02:49 am »
Quote from: "Laurent"
people will hate me if I change the same code everyday
Don't they hate you even more if you change it every week, so that they have already adapted all their code and can change it again? ;)

But I think apart from bindings like Groogy's, this change isn't problematic. As we concluded earlier, the method to get the desktop position is nearly useless anyway :D
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
New global inputs in SFML 2
« Reply #31 on: July 08, 2011, 11:10:16 am »
Quote from: "Nexus"
But I think apart from bindings like Groogy's
and the Mac port. :roll:
SFML / OS X developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
New global inputs in SFML 2
« Reply #32 on: July 08, 2011, 11:26:41 am »
In C++, you can directly implement overloaded functions, while Groogy has to find ugly workarounds. For the Mac port, you only need to rename the function.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
New global inputs in SFML 2
« Reply #33 on: July 08, 2011, 11:42:05 am »
Quote from: "Nexus"
For the Mac port, you only need to rename the function.
I was referring to that. If it's only a rename thing then it's fine, goes fast and everybody is happy. But if the API changes everyday (like sf::Input to what's now) I'll get crazy (OS X is a mess for low-level application, really! When I'll commit the update for the new input system you'll understand my pain.).

Laurent, I'm of course not saying that you should not change anything. Hell no! But don't do it every day, please.  :lol:
SFML / OS X developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
New global inputs in SFML 2
« Reply #34 on: July 08, 2011, 06:58:23 pm »
Well, I'm not unhappy either if the SFML API doesn't change every day, since I have much dependent code, especially in Thor. But sometimes, API breaks are worth the new features :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New global inputs in SFML 2
« Reply #35 on: July 08, 2011, 07:18:22 pm »
Don't forget that:
- SFML 2 is not even in alpha state so I can change whatever I want, whenever I want :lol:
- once SFML 2 is officially released, I won't break the API anymore in the 2.x branch
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
New global inputs in SFML 2
« Reply #36 on: July 10, 2011, 12:18:36 pm »
Now that SFML has sf::Vector2u for unsigned int, why don't sf::Mouse::GetPosition() and sf::Mouse::SetPosition() use it?

For example, it would simplify the usage with sf::RenderWindow::ConvertCoords(), even more if there were a direct overload to take vectors instead of separate unsigned ints.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New global inputs in SFML 2
« Reply #37 on: July 10, 2011, 12:46:11 pm »
Quote
Now that SFML has sf::Vector2u for unsigned int, why don't sf::Mouse::GetPosition() and sf::Mouse::SetPosition() use it?

I didn't see any reason to disallow coordinates outside the screen.

Quote
For example, it would simplify the usage with sf::Window::ConvertCoords(), even more if there were a direct overload to take vectors instead of separate unsigned ints.

Hmm that's true.
Laurent Gomila - SFML developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
New global inputs in SFML 2
« Reply #38 on: July 10, 2011, 03:52:00 pm »
I've implemented the keyboard and mouse part of the new input system. Could some of you check if it works fine on your computer too ? Thanks.
(Joystick part will follow soon.)
SFML / OS X developer

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
New global inputs in SFML 2
« Reply #39 on: July 12, 2011, 08:36:06 pm »
I'm a bit embarrassed to ask because it's probably really simple but,
What replaced the real-time input function GetInput()?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New global inputs in SFML 2
« Reply #40 on: July 12, 2011, 09:01:09 pm »
Nothing. The new system is only made of static class functions, so they can be called directly without instanciating or getting anything.
Laurent Gomila - SFML developer

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
New global inputs in SFML 2
« Reply #41 on: July 12, 2011, 09:09:19 pm »
Ah I understand now. Thank you.

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
New global inputs in SFML 2
« Reply #42 on: July 13, 2011, 09:33:41 pm »
Nice!
Looks like I need to get the latest build and update JSFML. :D
JSFML - The Java binding to SFML.

Haikarainen

  • Guest
New global inputs in SFML 2
« Reply #43 on: July 15, 2011, 01:10:59 am »
:D Nice stuff! Think i'll wait until SFML2 is fully released before i updated my libraries again though, have toooo much to fix right now :P

coolhome

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
New global inputs in SFML 2
« Reply #44 on: July 15, 2011, 06:56:49 am »
Very nice! I love the new API for inputs. I went to update to the latest commit (since I was behind a few) and it totally broke my engine. I was wondering where some of the functions went haha I guess that's the price of development releases. Keep it up.
CoderZilla - Everything Programming