fix some Window stuff

pull/17/head
cosmonaut 2022-03-02 14:46:55 -08:00
parent 9c83423c79
commit 111df04c0f
2 changed files with 19 additions and 3 deletions

View File

@ -6,9 +6,9 @@ namespace MoonWorks
public class Window : IDisposable
{
internal IntPtr Handle { get; }
public ScreenMode ScreenMode { get; }
public uint Width { get; }
public uint Height { get; }
public ScreenMode ScreenMode { get; private set; }
public uint Width { get; private set; }
public uint Height { get; private set; }
private bool IsDisposed;
@ -53,6 +53,8 @@ namespace MoonWorks
windowFlag = SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
}
ScreenMode = screenMode;
SDL.SDL_SetWindowFullscreen(Handle, (uint) windowFlag);
}
@ -65,6 +67,8 @@ namespace MoonWorks
public void SetWindowSize(uint width, uint height)
{
SDL.SDL_SetWindowSize(Handle, (int) width, (int) height);
Width = width;
Height = height;
}
protected virtual void Dispose(bool disposing)

View File

@ -6,5 +6,17 @@
public uint WindowWidth;
public uint WindowHeight;
public ScreenMode ScreenMode;
public WindowCreateInfo(
string windowTitle,
uint windowWidth,
uint windowHeight,
ScreenMode screenMode
) {
WindowTitle = windowTitle;
WindowWidth = windowWidth;
WindowHeight = windowHeight;
ScreenMode = screenMode;
}
}
}