hide main window until Game.Run is called
parent
dfddc24d0e
commit
66c6ceec04
|
@ -1,4 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using SDL2;
|
using SDL2;
|
||||||
using MoonWorks.Audio;
|
using MoonWorks.Audio;
|
||||||
using MoonWorks.Graphics;
|
using MoonWorks.Graphics;
|
||||||
|
@ -67,7 +67,7 @@ namespace MoonWorks
|
||||||
debugMode
|
debugMode
|
||||||
);
|
);
|
||||||
|
|
||||||
MainWindow = new Window(windowCreateInfo, GraphicsDevice.WindowFlags);
|
MainWindow = new Window(windowCreateInfo, GraphicsDevice.WindowFlags | SDL.SDL_WindowFlags.SDL_WINDOW_HIDDEN);
|
||||||
|
|
||||||
if (!GraphicsDevice.ClaimWindow(MainWindow, windowCreateInfo.PresentMode))
|
if (!GraphicsDevice.ClaimWindow(MainWindow, windowCreateInfo.PresentMode))
|
||||||
{
|
{
|
||||||
|
@ -79,6 +79,8 @@ namespace MoonWorks
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
|
MainWindow.Show();
|
||||||
|
|
||||||
while (!quit)
|
while (!quit)
|
||||||
{
|
{
|
||||||
Tick();
|
Tick();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using SDL2;
|
using SDL2;
|
||||||
|
|
||||||
|
@ -92,6 +92,11 @@ namespace MoonWorks
|
||||||
return idLookup.ContainsKey(windowID) ? idLookup[windowID] : null;
|
return idLookup.ContainsKey(windowID) ? idLookup[windowID] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void Show()
|
||||||
|
{
|
||||||
|
SDL.SDL_ShowWindow(Handle);
|
||||||
|
}
|
||||||
|
|
||||||
internal void SizeChanged(uint width, uint height)
|
internal void SizeChanged(uint width, uint height)
|
||||||
{
|
{
|
||||||
Width = width;
|
Width = width;
|
||||||
|
|
Loading…
Reference in New Issue