mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 13:06:13 +01:00
Added sfTouch_getPositionRenderWindow(...) function
This commit is contained in:
1 parent
91a09b3ce5
commit
109a02c829
2 files changed
+32
-3
No files matched your search
@@ -36,6 +36,7 @@
|
||||
#include <SFML/Graphics/RectangleShapeStruct.h>
|
||||
#include <SFML/Graphics/VertexArrayStruct.h>
|
||||
#include <SFML/Graphics/ConvertRenderStates.hpp>
|
||||
#include <SFML/Window/Touch.hpp>
|
||||
#include <SFML/Internal.h>
|
||||
#include <SFML/ConvertEvent.h>
|
||||
|
||||
@@ -533,3 +534,17 @@ void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow*
|
||||
else
|
||||
sf::Mouse::setPosition(sf::Vector2i(position.x, position.y));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2i sfTouch_getPositionRenderWindow(unsigned int finger, const sfRenderWindow* relativeTo)
|
||||
{
|
||||
sf::Vector2i sfmlPosition;
|
||||
|
||||
if (relativeTo)
|
||||
sfmlPosition = sf::Touch::getPosition(finger, relativeTo->This);
|
||||
else
|
||||
sfmlPosition = sf::Touch::getPosition(finger);
|
||||
|
||||
sfVector2i position = { sfmlPosition.x, sfmlPosition.y };
|
||||
return position;
|
||||
}
|
||||
Reference in new issue
Block a user