Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Bindings - other languages
»
C
»
sfMouse_getPosition with sfRenderWindow*?
Print
Pages: [
1
]
Author
Topic: sfMouse_getPosition with sfRenderWindow*? (Read 6960 times)
0 Members and 1 Guest are viewing this topic.
nulloid
Full Member
Posts: 134
sfMouse_getPosition with sfRenderWindow*?
«
on:
May 01, 2012, 12:46:09 pm »
I have an sfRenderWindow*, but sfMouse_getPosition() wants an sfWindow*. I couldn't find any method to make/get an sfWindow* from an sfRenderWindow* without modifying the source. Is there an orthodox (and fast) method, or should I just hack CSFML?
Logged
nulloid
Full Member
Posts: 134
Re: sfMouse_getPosition with sfRenderWindow*?
«
Reply #1 on:
May 01, 2012, 12:52:41 pm »
Hm... trying casting from sfRenderWindow* to sfWindow*. I'll write the results here once I'm finished.
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 10972
Re: sfMouse_getPosition with sfRenderWindow*?
«
Reply #2 on:
May 01, 2012, 01:02:57 pm »
If you'd use SFML with C++ it wouldn't matter since
sf::RenderWindow
is inherited from
sf::Window
.
I'm just curious what's the advantage of using C instead of C++?
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
nulloid
Full Member
Posts: 134
Re: sfMouse_getPosition with sfRenderWindow*?
«
Reply #3 on:
May 01, 2012, 01:30:01 pm »
Ok, it works that way ^^
Well, I want to write a game in Haskell using SFML. So I make the rendering engine, keyboard and mouse handling and sound in sfml using C, because Haskell interfaces better with C, then with C++.
Logged
Laurent
Administrator
Hero Member
Posts: 32504
Re: sfMouse_getPosition with sfRenderWindow*?
«
Reply #4 on:
May 01, 2012, 06:32:00 pm »
In fact there should be overloads for sfRenderWindow, I forgot to implement them. There's no clean workaround, any attempt to cast types produces undefined behaviour.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Bindings - other languages
»
C
»
sfMouse_getPosition with sfRenderWindow*?
anything