This repository has been archived by the owner on Mar 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow game hosts to provide custom base directories and rendering dim…
…ensions (#184)
- Loading branch information
Showing
25 changed files
with
506 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Graphics; | ||
|
||
namespace Protogame | ||
{ | ||
public class DefaultBackBufferDimensions : IBackBufferDimensions | ||
{ | ||
public Point GetSize(GraphicsDevice graphicsDevice) | ||
{ | ||
return new Point( | ||
graphicsDevice.PresentationParameters.BackBufferWidth, | ||
graphicsDevice.PresentationParameters.BackBufferHeight); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
|
||
namespace Protogame | ||
{ | ||
public class DefaultBaseDirectory : IBaseDirectory | ||
{ | ||
public DefaultBaseDirectory() | ||
{ | ||
FullPath = Environment.CurrentDirectory; | ||
} | ||
|
||
public string FullPath { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Graphics; | ||
|
||
namespace Protogame | ||
{ | ||
public interface IBackBufferDimensions | ||
{ | ||
Point GetSize(GraphicsDevice graphicsDevice); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Protogame | ||
{ | ||
/// <summary> | ||
/// Provides the base directory of the game. You should always use this interface instead of | ||
/// <see cref="System.Environment.CurrentDirectory"/>, as this value is correct when the game is | ||
/// running inside an editor. | ||
/// </summary> | ||
public interface IBaseDirectory | ||
{ | ||
/// <summary> | ||
/// The full directory path to the game; this directory is the base where the content directory | ||
/// will then be searched from. | ||
/// </summary> | ||
string FullPath { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Content; | ||
using Microsoft.Xna.Framework.Graphics; | ||
using System; | ||
|
||
namespace Protogame | ||
{ | ||
public interface IHostGame | ||
{ | ||
bool IsMouseVisible { get; set; } | ||
|
||
GraphicsDevice GraphicsDevice { get; } | ||
|
||
GraphicsDeviceManager GraphicsDeviceManager { get; } | ||
|
||
IGameWindow ProtogameWindow { get; } | ||
|
||
event EventHandler<EventArgs> Exiting; | ||
|
||
GameWindow Window { get; } | ||
|
||
GameServiceContainer Services { get; } | ||
|
||
ContentManager Content { get; set; } | ||
|
||
void Exit(); | ||
|
||
SpriteBatch SplashScreenSpriteBatch { get; } | ||
|
||
Texture2D SplashScreenTexture { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.