mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-07 22:50:44 +00:00
Change bool to IntPtr.
WindowProc returns an IntPtr not a bool, so let Handle* functions return IntPtr?. If they return a value we return that, if they return null we call DefWindowProc and return the result from that.
This commit is contained in:
parent
9239fd08e3
commit
9ed32e4445
|
@ -388,15 +388,15 @@ namespace OpenTK.Platform.Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HandleSetCursor(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
|
private IntPtr? HandleSetCursor(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
|
||||||
{
|
{
|
||||||
if (cursor != MouseCursor.Default)
|
if (cursor != MouseCursor.Default)
|
||||||
{
|
{
|
||||||
Functions.SetCursor(curson_handle);
|
Functions.SetCursor(curson_handle);
|
||||||
return true;
|
return new IntPtr(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleChar(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
|
void HandleChar(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
|
||||||
|
@ -666,7 +666,7 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
IntPtr WindowProcedure(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
|
IntPtr WindowProcedure(IntPtr handle, WindowMessage message, IntPtr wParam, IntPtr lParam)
|
||||||
{
|
{
|
||||||
bool result = false;
|
IntPtr? result = null;
|
||||||
|
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
|
@ -791,10 +791,9 @@ namespace OpenTK.Platform.Windows
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result)
|
if (result.HasValue)
|
||||||
{
|
{
|
||||||
// Return TRUE
|
return result.Value;
|
||||||
return new IntPtr(1);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue