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