Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
Resizable window fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Aug 29, 2013
1 parent f3c1d67 commit 766cb17
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions MonoGame.Framework/SDL2/SDL2_GameWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ 1. Definitions
*/
#endregion License

#region RESIZABLE_WINDOW Option
// #define RESIZABLE_WINDOW
/* So we've got this silly issue in SDL2's video API at the moment. We can't
* add/remove the resizable property to the SDL_Window*!
*
* So, if you want to have your GameWindow be resizable, uncomment this define.
* -flibit
*/
#endregion

#region THREADED_GL Option
// #define THREADED_GL
/* Ah, so I see you've run into some issues with threaded GL...
Expand Down Expand Up @@ -372,6 +382,9 @@ public void INTERNAL_RunLoop()
{
Mouse.INTERNAL_WindowWidth = evt.window.data1;
Mouse.INTERNAL_WindowHeight = evt.window.data2;

// Should be called on user resize as well as ApplyChanges().
OnClientSizeChanged();
}

// Mouse Focus
Expand Down Expand Up @@ -573,7 +586,11 @@ public SDL2_GameWindow()
SDL.SDL_WindowFlags.SDL_WINDOW_INPUT_FOCUS |
SDL.SDL_WindowFlags.SDL_WINDOW_MOUSE_FOCUS
);
#if RESIZABLE_WINDOW
AllowUserResizing = true;
#else
AllowUserResizing = false;
#endif

SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_RED_SIZE, 8);
SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_GREEN_SIZE, 8);
Expand Down

0 comments on commit 766cb17

Please sign in to comment.