Skip to content

Commit

Permalink
Use CSFML 2.6.1 and add missing WindowBase functions
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed May 22, 2024
1 parent 321101d commit a3b95da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion SFML.Module.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSFML" Version="2.6.0" />
<PackageReference Include="CSFML" Version="2.6.1" />
</ItemGroup>

</Project>
23 changes: 16 additions & 7 deletions src/SFML.Window/WindowBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public virtual void SetMouseCursorVisible(bool show)
/// Grab or release the mouse cursor
/// </summary>
/// <param name="grabbed">True to grab, false to release</param>
///
///
/// <remarks>
/// If set, grabs the mouse cursor inside this window's client
/// area so it may no longer be moved outside its bounds.
Expand All @@ -220,7 +220,7 @@ public virtual void SetMouseCursorGrabbed(bool grabbed)
////////////////////////////////////////////////////////////
/// <summary>
/// Set the displayed cursor to a native system cursor
///
///
/// Upon window creation, the arrow cursor is used by default.
/// </summary>
/// <param name="cursor">Native system cursor type to display</param>
Expand All @@ -233,11 +233,11 @@ public virtual void SetMouseCursor(Cursor cursor)
////////////////////////////////////////////////////////////
/// <summary>
/// Enable or disable automatic key-repeat.
///
///
/// If key repeat is enabled, you will receive repeated
/// <see cref="KeyPressed"/> events while keeping a key pressed. If it is
/// disabled, you will only get a single event when the key is pressed.
///
///
/// Automatic key-repeat is enabled by default
/// </summary>
/// <param name="enable">True to enable, false to disable</param>
Expand Down Expand Up @@ -394,7 +394,7 @@ protected virtual bool WaitEvent(out Event eventToFill)
////////////////////////////////////////////////////////////
protected internal virtual Vector2i InternalGetMousePosition()
{
throw new NotImplementedException("Currently not available");
return sfMouse_getPositionWindowBase(CPointer);
}

////////////////////////////////////////////////////////////
Expand All @@ -407,7 +407,7 @@ protected internal virtual Vector2i InternalGetMousePosition()
////////////////////////////////////////////////////////////
protected internal virtual void InternalSetMousePosition(Vector2i position)
{
throw new NotImplementedException("Currently not available");
sfMouse_setPositionWindowBase(position, CPointer);
}

////////////////////////////////////////////////////////////
Expand All @@ -421,7 +421,7 @@ protected internal virtual void InternalSetMousePosition(Vector2i position)
////////////////////////////////////////////////////////////
protected internal virtual Vector2i InternalGetTouchPosition(uint Finger)
{
throw new NotImplementedException("Currently not available");
return sfTouch_getPositionWindowBase(Finger, CPointer);
}

////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -783,6 +783,15 @@ private void CallEventHandler(Event e)

[DllImport(CSFML.window, CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
private static extern bool sfWindowBase_createVulkanSurface(IntPtr CPointer, IntPtr vkInstance, out IntPtr surface, IntPtr vkAllocator);

[DllImport(CSFML.window, CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
private static extern Vector2i sfMouse_getPositionWindowBase(IntPtr CPointer);

[DllImport(CSFML.window, CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
private static extern void sfMouse_setPositionWindowBase(Vector2i position, IntPtr CPointer);

[DllImport(CSFML.window, CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
private static extern Vector2i sfTouch_getPositionWindowBase(uint Finger, IntPtr RelativeTo);
#endregion
}
}

0 comments on commit a3b95da

Please sign in to comment.