Implement missing functions

This commit is contained in:
Miron Alexandru authored and Chris Thrasher committed 2024-03-09 20:29:30 -07:00
1 parent 16ae40d383
commit e0589c302b
11 files changed
+211

No files matched your search

+10
View File
@@ -561,6 +561,7 @@ void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow*
sf::Mouse::setPosition(sf::Vector2i(position.x, position.y));
}
////////////////////////////////////////////////////////////
sfVector2i sfTouch_getPositionRenderWindow(unsigned int finger, const sfRenderWindow* relativeTo)
{
@@ -574,3 +575,12 @@ sfVector2i sfTouch_getPositionRenderWindow(unsigned int finger, const sfRenderWi
sfVector2i position = { sfmlPosition.x, sfmlPosition.y };
return position;
}
////////////////////////////////////////////////////////////
sfBool sfRenderWindow_createVulkanSurface(sfRenderWindow* renderWindow, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator)
{
CSFML_CHECK_RETURN(instance, sfFalse);
CSFML_CHECK_RETURN(surface, sfFalse);
CSFML_CALL_RETURN(renderWindow, createVulkanSurface(*instance, *surface, allocator), sfFalse);
}
+37
View File
@@ -0,0 +1,37 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented;
// you must not claim that you wrote the original software.
// If you use this software in a product, an acknowledgment
// in the product documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such,
// and must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
//
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/System/Alloc.h>
#include <stdlib.h>
////////////////////////////////////////////////////////////
void sfFree(void* ptr)
{
free(ptr);
}
+2
View File
@@ -6,6 +6,8 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/src/SFML/System)
set(SRC
${PROJECT_SOURCE_DIR}/include/SFML/GPUPreference.h
${INCROOT}/Export.h
${SRCROOT}/Alloc.cpp
${INCROOT}/Alloc.h
${SRCROOT}/Buffer.cpp
${SRCROOT}/BufferStruct.h
${INCROOT}/Buffer.h
+25
View File
@@ -26,6 +26,7 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window/Mouse.h>
#include <SFML/Window/WindowBaseStruct.h>
#include <SFML/Window/WindowStruct.h>
#include <SFML/Window/Mouse.hpp>
#include <SFML/Internal.h>
@@ -60,3 +61,27 @@ void sfMouse_setPosition(sfVector2i position, const sfWindow* relativeTo)
else
sf::Mouse::setPosition(sf::Vector2i(position.x, position.y));
}
////////////////////////////////////////////////////////////
sfVector2i sfMouse_getPositionWindowBase(const sfWindowBase* relativeTo)
{
sf::Vector2i sfmlPos;
if (relativeTo)
sfmlPos = sf::Mouse::getPosition(relativeTo->This);
else
sfmlPos = sf::Mouse::getPosition();
sfVector2i position = { sfmlPos.x, sfmlPos.y };
return position;
}
////////////////////////////////////////////////////////////
void sfMouse_setPositionWindowBase(sfVector2i position, const sfWindowBase* relativeTo)
{
if (relativeTo)
sf::Mouse::setPosition(sf::Vector2i(position.x, position.y), relativeTo->This);
else
sf::Mouse::setPosition(sf::Vector2i(position.x, position.y));
}
+14
View File
@@ -27,6 +27,7 @@
////////////////////////////////////////////////////////////
#include <SFML/Window/Touch.h>
#include <SFML/Window/Touch.hpp>
#include <SFML/Window/WindowBaseStruct.h>
#include <SFML/Window/WindowStruct.h>
#include <SFML/Internal.h>
@@ -51,3 +52,16 @@ sfVector2i sfTouch_getPosition(unsigned int finger, const sfWindow* relativeTo)
return position;
}
////////////////////////////////////////////////////////////
sfVector2i sfTouch_getPositionWindowBase(unsigned int finger, const sfWindowBase* 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;
}
+9
View File
@@ -322,3 +322,12 @@ sfWindowHandle sfWindow_getSystemHandle(const sfWindow* window)
return static_cast<sfWindowHandle>(window->This.getSystemHandle());
}
////////////////////////////////////////////////////////////
sfBool sfWindow_createVulkanSurface(sfWindow* window, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator)
{
CSFML_CHECK_RETURN(instance, sfFalse);
CSFML_CHECK_RETURN(surface, sfFalse);
CSFML_CALL_RETURN(window, createVulkanSurface(*instance, *surface, allocator), sfFalse);
}