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

Commit

Permalink
Fix SDL2 GraphicsAdapter.CurrentDisplayMode
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Jul 6, 2013
1 parent 1d04373 commit fee6195
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions MonoGame.Framework/Graphics/GraphicsAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public sealed class GraphicsAdapter : IDisposable
private static ReadOnlyCollection<GraphicsAdapter> adapters;

#if SDL2
private IntPtr _screen;
internal GraphicsAdapter(IntPtr sdlWindow)
private SDL2_GameWindow _screen;
internal GraphicsAdapter(SDL2_GameWindow sdlWindow)
{
_screen = sdlWindow;
}
Expand All @@ -83,11 +83,9 @@ public DisplayMode CurrentDisplayMode
get
{
#if SDL2
int x = 0, y = 0;
SDL2.SDL.SDL_GetWindowSize(_screen, ref x, ref y);
return new DisplayMode(
x,
y,
_screen.INTERNAL_glFramebufferWidth,
_screen.INTERNAL_glFramebufferHeight,
60, // FIXME: Assumption!
SurfaceFormat.Color
);
Expand Down Expand Up @@ -116,7 +114,7 @@ public static GraphicsAdapter DefaultAdapter
adapters = new ReadOnlyCollection<GraphicsAdapter>(
new GraphicsAdapter[]
{
new GraphicsAdapter(Game.Instance.Window.Handle)
new GraphicsAdapter((SDL2_GameWindow) Game.Instance.Window)
}
);
#elif IOS
Expand Down
2 changes: 1 addition & 1 deletion MonoGame.Framework/SDL2/SDL2_GameWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public class SDL2_GameWindow : GameWindow
private int INTERNAL_glColorAttachment;
private int INTERNAL_glDepthStencilAttachment;

// These are internal for the SDL2_GamePlatform.
// These are internal for the SDL2_GamePlatform and GraphicsAdapter.
internal int INTERNAL_glFramebufferWidth;
internal int INTERNAL_glFramebufferHeight;

Expand Down

0 comments on commit fee6195

Please sign in to comment.