mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
Make the new launcher cross-platform.
This commit is contained in:
parent
f639de8f7b
commit
c205b03726
@ -60,7 +60,12 @@ namespace Launcher2 {
|
||||
Window.Visible = true;
|
||||
Drawer = new GdiPlusDrawer2D( null );
|
||||
Init();
|
||||
|
||||
if( !ResourceFetcher.CheckAllResourcesExist() ) {
|
||||
SetScreen( new ResourcesScreen( this ) );
|
||||
} else {
|
||||
SetScreen( new MainScreen( this ) );
|
||||
}
|
||||
|
||||
while( true ) {
|
||||
Window.ProcessEvents();
|
||||
@ -78,10 +83,8 @@ namespace Launcher2 {
|
||||
if( screen != null )
|
||||
screen.Dirty = false;
|
||||
|
||||
WinWindowInfo info = (WinWindowInfo)Window.WindowInfo;
|
||||
IntPtr dc = info.DeviceContext;
|
||||
|
||||
using( Graphics g = Graphics.FromHdc( dc ) )
|
||||
IntPtr hwnd = Window.WindowInfo.WinHandle;
|
||||
using( Graphics g = Graphics.FromHwnd( hwnd ) )
|
||||
g.DrawImage( Framebuffer, 0, 0, Framebuffer.Width, Framebuffer.Height );
|
||||
}
|
||||
|
||||
|
@ -13,5 +13,6 @@ namespace OpenTK.Platform
|
||||
/// <summary>Descibes an OS window.</summary>
|
||||
public interface IWindowInfo : IDisposable
|
||||
{
|
||||
IntPtr WinHandle { get; }
|
||||
}
|
||||
}
|
||||
|
@ -88,6 +88,11 @@ namespace OpenTK.Platform.MacOS
|
||||
|
||||
#endregion
|
||||
|
||||
// TODO: I have no idea if this is right.
|
||||
public IntPtr WinHandle {
|
||||
get { return windowRef; }
|
||||
}
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
|
@ -112,5 +112,9 @@ namespace OpenTK.Platform.Windows {
|
||||
~WinWindowInfo() {
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
public IntPtr WinHandle {
|
||||
get { return WindowHandle; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,5 +77,9 @@ namespace OpenTK.Platform.X11 {
|
||||
public override int GetHashCode() {
|
||||
return WindowHandle.GetHashCode() ^ Display.GetHashCode();
|
||||
}
|
||||
|
||||
public IntPtr WinHandle {
|
||||
get { return WindowHandle; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user