Start in maximized window.

I can’t find working solution to this, even SDL_MaximizeWindow(Window.Handle);. Is there any build-in way to set starting window maximized?

#Edit
Looks like making Cross Platform Desktop Project makes a difference. Here is what worked for me.

[DllImport("SDL2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void SDL_MaximizeWindow(IntPtr window);
public Game1()
{
    graphics = new GraphicsDeviceManager(this)
    {
        PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width,
        PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height
    };
    Window.AllowUserResizing = true;
    Content.RootDirectory = "Content";
}

protected override void Initialize()
{
    Window.Position = new Point(0, 0);
    SDL_MaximizeWindow(Window.Handle);
    base.Initialize();
}
4 Likes