mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 03:25:14 -04:00
Last attempt at fixing OSX cursor movement.
This commit is contained in:
parent
61745c33c5
commit
e16c34c90e
@ -182,7 +182,7 @@ namespace ClassicalSharp {
|
|||||||
const int ticksFrequency = 20;
|
const int ticksFrequency = 20;
|
||||||
const double ticksPeriod = 1.0 / ticksFrequency;
|
const double ticksPeriod = 1.0 / ticksFrequency;
|
||||||
const double imageCheckPeriod = 30.0;
|
const double imageCheckPeriod = 30.0;
|
||||||
const double cameraPeriod = 1.0 / 10.0;
|
const double cameraPeriod = 1.0 / 120.0;
|
||||||
double ticksAccumulator = 0, imageCheckAccumulator = 0, cameraAccumulator = 0;
|
double ticksAccumulator = 0, imageCheckAccumulator = 0, cameraAccumulator = 0;
|
||||||
|
|
||||||
protected override void OnRenderFrame( FrameEventArgs e ) {
|
protected override void OnRenderFrame( FrameEventArgs e ) {
|
||||||
|
@ -220,31 +220,23 @@ namespace OpenTK.Platform.MacOS
|
|||||||
Application.WindowEventHandler = this;
|
Application.WindowEventHandler = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Activate()
|
void Activate() {
|
||||||
{
|
|
||||||
API.SelectWindow(window.WindowRef);
|
API.SelectWindow(window.WindowRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Show()
|
void Show() {
|
||||||
{
|
|
||||||
IntPtr parent = IntPtr.Zero;
|
|
||||||
|
|
||||||
API.ShowWindow(window.WindowRef);
|
API.ShowWindow(window.WindowRef);
|
||||||
API.RepositionWindow(window.WindowRef, parent, WindowPositionMethod);
|
API.RepositionWindow(window.WindowRef, IntPtr.Zero, WindowPositionMethod);
|
||||||
API.SelectWindow(window.WindowRef);
|
API.SelectWindow(window.WindowRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hide()
|
void Hide() {
|
||||||
{
|
|
||||||
API.HideWindow(window.WindowRef);
|
API.HideWindow(window.WindowRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SetFullscreen(AglContext context)
|
internal void SetFullscreen(AglContext context) {
|
||||||
{
|
|
||||||
windowedBounds = bounds;
|
windowedBounds = bounds;
|
||||||
|
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
context.SetFullScreen(window, out width, out height);
|
context.SetFullScreen(window, out width, out height);
|
||||||
|
|
||||||
Debug.Print("Prev Size: {0}, {1}", Width, Height);
|
Debug.Print("Prev Size: {0}, {1}", Width, Height);
|
||||||
@ -253,13 +245,10 @@ namespace OpenTK.Platform.MacOS
|
|||||||
|
|
||||||
// TODO: if we go full screen we need to make this use the device specified.
|
// TODO: if we go full screen we need to make this use the device specified.
|
||||||
bounds = mDisplayDevice.Bounds;
|
bounds = mDisplayDevice.Bounds;
|
||||||
|
|
||||||
|
|
||||||
windowState = WindowState.Fullscreen;
|
windowState = WindowState.Fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void UnsetFullscreen(AglContext context)
|
internal void UnsetFullscreen(AglContext context) {
|
||||||
{
|
|
||||||
context.UnsetFullScreen(window);
|
context.UnsetFullScreen(window);
|
||||||
|
|
||||||
Debug.Print("Telling Carbon to reset window state to " + windowState.ToString());
|
Debug.Print("Telling Carbon to reset window state to " + windowState.ToString());
|
||||||
@ -1035,7 +1024,9 @@ namespace OpenTK.Platform.MacOS
|
|||||||
set {
|
set {
|
||||||
HIPoint point = default( HIPoint );
|
HIPoint point = default( HIPoint );
|
||||||
point.X = value.X; point.Y = value.Y;
|
point.X = value.X; point.Y = value.Y;
|
||||||
|
CG.CGAssociateMouseAndMouseCursorPosition( 0 );
|
||||||
CG.CGDisplayMoveCursorToPoint( CG.CGMainDisplayID(), point );
|
CG.CGDisplayMoveCursorToPoint( CG.CGMainDisplayID(), point );
|
||||||
|
CG.CGAssociateMouseAndMouseCursorPosition( 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user