Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Removed graphics debug and profile.
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefreeman committed May 22, 2020
1 parent 3680576 commit cae2c9b
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 139 deletions.
6 changes: 3 additions & 3 deletions Disks/PixelVisionOS/System/Tools/WorkspaceTool/saves.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"GameChip":
{
"savedData":{
"lastPath": "/Workspace/",
"selection": "0",
"sessionID": "202005221006002520",
"scrollPos": "0",
"sessionID": "202005220959413809"
"selection": "0",
"lastPath": "/Workspace/"
}
}
}
48 changes: 24 additions & 24 deletions MonoGame/MonoGame.Framework/Graphics/GraphicsDebug.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

namespace Microsoft.Xna.Framework.Graphics
{
public partial class GraphicsDebug
{
/// <summary>
/// Attempt to dequeue a debugging message from the graphics subsystem.
/// </summary>
/// <remarks>
/// When running on a graphics device with debugging enabled, this allows you to retrieve
/// subsystem-specific (e.g. DirectX, OpenGL, etc.) debugging messages including information
/// about improper usage of shaders and APIs.
/// </remarks>
/// <param name="message">The graphics debugging message if retrieved, null otherwise.</param>
/// <returns>True if a graphics debugging message was retrieved, false otherwise.</returns>
public bool TryDequeueMessage(out GraphicsDebugMessage message)
{
return PlatformTryDequeueMessage(out message);
}
}
}
// // MonoGame - Copyright (C) The MonoGame Team
// // This file is subject to the terms and conditions defined in
// // file 'LICENSE.txt', which is part of this source code package.
//
// namespace Microsoft.Xna.Framework.Graphics
// {
// public partial class GraphicsDebug
// {
// /// <summary>
// /// Attempt to dequeue a debugging message from the graphics subsystem.
// /// </summary>
// /// <remarks>
// /// When running on a graphics device with debugging enabled, this allows you to retrieve
// /// subsystem-specific (e.g. DirectX, OpenGL, etc.) debugging messages including information
// /// about improper usage of shaders and APIs.
// /// </remarks>
// /// <param name="message">The graphics debugging message if retrieved, null otherwise.</param>
// /// <returns>True if a graphics debugging message was retrieved, false otherwise.</returns>
// public bool TryDequeueMessage(out GraphicsDebugMessage message)
// {
// return PlatformTryDequeueMessage(out message);
// }
// }
// }
38 changes: 19 additions & 19 deletions MonoGame/MonoGame.Framework/Graphics/GraphicsDebugMessage.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

namespace Microsoft.Xna.Framework.Graphics
{
public class GraphicsDebugMessage
{
public string Message { get; set; }

public string Severity { get; set; }

public int Id { get; set; }

public string IdName { get; set; }

public string Category { get; set; }
}
}
// // MonoGame - Copyright (C) The MonoGame Team
// // This file is subject to the terms and conditions defined in
// // file 'LICENSE.txt', which is part of this source code package.
//
// namespace Microsoft.Xna.Framework.Graphics
// {
// public class GraphicsDebugMessage
// {
// public string Message { get; set; }
//
// public string Severity { get; set; }
//
// public int Id { get; set; }
//
// public string IdName { get; set; }
//
// public string Category { get; set; }
// }
// }
18 changes: 9 additions & 9 deletions MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,20 +254,20 @@ public GraphicsAdapter Adapter
/// <exception cref="ArgumentNullException">
/// <paramref name="presentationParameters"/> is <see langword="null"/>.
/// </exception>
public GraphicsDevice(GraphicsAdapter adapter, GraphicsProfile graphicsProfile, bool preferHalfPixelOffset, PresentationParameters presentationParameters)
public GraphicsDevice(GraphicsAdapter adapter/*, GraphicsProfile graphicsProfile*/, bool preferHalfPixelOffset, PresentationParameters presentationParameters)
{
if (adapter == null)
throw new ArgumentNullException("adapter");
if (!adapter.IsProfileSupported(graphicsProfile))
throw new NoSuitableGraphicsDeviceException(String.Format("Adapter '{0}' does not support the {1} profile.", adapter.Description, graphicsProfile));
// if (!adapter.IsProfileSupported(graphicsProfile))
// throw new NoSuitableGraphicsDeviceException(String.Format("Adapter '{0}' does not support the {1} profile.", adapter.Description, graphicsProfile));
if (presentationParameters == null)
throw new ArgumentNullException("presentationParameters");
#if DIRECTX
// TODO we need to figure out how to inject the half pixel offset into DX shaders
preferHalfPixelOffset = false;
#endif
Adapter = adapter;
_graphicsProfile = graphicsProfile;
// _graphicsProfile = graphicsProfile;
UseHalfPixelOffset = preferHalfPixelOffset;
PresentationParameters = presentationParameters;
Setup();
Expand Down Expand Up @@ -751,11 +751,11 @@ public Viewport Viewport
}
}

private readonly GraphicsProfile _graphicsProfile;
public GraphicsProfile GraphicsProfile
{
get { return _graphicsProfile; }
}
// private readonly GraphicsProfile _graphicsProfile;
// public GraphicsProfile GraphicsProfile
// {
// get { return _graphicsProfile; }
// }

public Rectangle ScissorRectangle
{
Expand Down
42 changes: 21 additions & 21 deletions MonoGame/MonoGame.Framework/Graphics/GraphicsProfile.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

namespace Microsoft.Xna.Framework.Graphics
{
/// <summary>
/// Defines a set of graphic capabilities.
/// </summary>
public enum GraphicsProfile
{
/// <summary>
/// Use a limited set of graphic features and capabilities, allowing the game to support the widest variety of devices.
/// </summary>
Reach,
/// <summary>
/// Use the largest available set of graphic features and capabilities to target devices, that have more enhanced graphic capabilities.
/// </summary>
HiDef
}
}
// // MonoGame - Copyright (C) The MonoGame Team
// // This file is subject to the terms and conditions defined in
// // file 'LICENSE.txt', which is part of this source code package.
//
// namespace Microsoft.Xna.Framework.Graphics
// {
// /// <summary>
// /// Defines a set of graphic capabilities.
// /// </summary>
// public enum GraphicsProfile
// {
// /// <summary>
// /// Use a limited set of graphic features and capabilities, allowing the game to support the widest variety of devices.
// /// </summary>
// Reach,
// /// <summary>
// /// Use the largest available set of graphic features and capabilities to target devices, that have more enhanced graphic capabilities.
// /// </summary>
// // HiDef
// }
// }
2 changes: 1 addition & 1 deletion MonoGame/MonoGame.Framework/GraphicsDeviceInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class GraphicsDeviceInformation
/// <summary>
/// The requested graphics device feature set.
/// </summary>
public GraphicsProfile GraphicsProfile { get; set; }
// public GraphicsProfile GraphicsProfile { get; set; }

/// <summary>
/// The settings that define how graphics will be presented to the display.
Expand Down
58 changes: 29 additions & 29 deletions MonoGame/MonoGame.Framework/GraphicsDeviceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public partial class GraphicsDeviceManager : IGraphicsDeviceService, IDisposable
private bool _hardwareModeSwitch = true;
private bool _preferHalfPixelOffset = false;
private bool _wantFullScreen;
private GraphicsProfile _graphicsProfile;
// private GraphicsProfile _graphicsProfile;
// dirty flag for ApplyChanges
private bool _shouldApplyChanges;

Expand Down Expand Up @@ -83,7 +83,7 @@ public GraphicsDeviceManager(Game game)

// XNA would read this from the manifest, but it would always default
// to reach unless changed. So lets mimic that without the manifest bit.
GraphicsProfile = GraphicsProfile.Reach;
// GraphicsProfile = GraphicsProfile.Reach;

// Let the plaform optionally overload construction defaults.
PlatformConstruct();
Expand Down Expand Up @@ -129,7 +129,7 @@ private void CreateDevice(GraphicsDeviceInformation gdi)
if (_graphicsDevice != null)
return;

_graphicsDevice = new GraphicsDevice(gdi.Adapter, gdi.GraphicsProfile, this.PreferHalfPixelOffset, gdi.PresentationParameters);
_graphicsDevice = new GraphicsDevice(gdi.Adapter/*, gdi.GraphicsProfile*/, this.PreferHalfPixelOffset, gdi.PresentationParameters);
_shouldApplyChanges = false;

// hook up reset events
Expand Down Expand Up @@ -284,7 +284,7 @@ private void PreparePresentationParameters(PresentationParameters presentationPa
private void PrepareGraphicsDeviceInformation(GraphicsDeviceInformation gdi)
{
gdi.Adapter = GraphicsAdapter.DefaultAdapter;
gdi.GraphicsProfile = GraphicsProfile;
// gdi.GraphicsProfile = GraphicsProfile;
var pp = new PresentationParameters();
PreparePresentationParameters(pp);
gdi.PresentationParameters = pp;
Expand Down Expand Up @@ -313,23 +313,23 @@ public void ApplyChanges()
// PrepareDeviceSettings event this information should be applied to the GraphicsDevice
var gdi = DoPreparingDeviceSettings();

if (gdi.GraphicsProfile != GraphicsDevice.GraphicsProfile)
{
// if the GraphicsProfile changed we need to create a new GraphicsDevice
DisposeGraphicsDevice();
CreateDevice(gdi);
return;
}
// if (gdi.GraphicsProfile != GraphicsDevice.GraphicsProfile)
// {
// // if the GraphicsProfile changed we need to create a new GraphicsDevice
// DisposeGraphicsDevice();
// CreateDevice(gdi);
// return;
// }

GraphicsDevice.Reset(gdi.PresentationParameters);
}

private void DisposeGraphicsDevice()
{
_graphicsDevice.Dispose();
EventHelpers.Raise(this, DeviceDisposing, EventArgs.Empty);
_graphicsDevice = null;
}
// private void DisposeGraphicsDevice()
// {
// _graphicsDevice.Dispose();
// EventHelpers.Raise(this, DeviceDisposing, EventArgs.Empty);
// _graphicsDevice = null;
// }

partial void PlatformInitialize(PresentationParameters presentationParameters);

Expand Down Expand Up @@ -373,18 +373,18 @@ private void OnPresentationChanged(object sender, PresentationEventArgs args)
/// <summary>
/// The profile which determines the graphics feature level.
/// </summary>
public GraphicsProfile GraphicsProfile
{
get
{
return _graphicsProfile;
}
set
{
_shouldApplyChanges = true;
_graphicsProfile = value;
}
}
// public GraphicsProfile GraphicsProfile
// {
// get
// {
// return _graphicsProfile;
// }
// set
// {
// _shouldApplyChanges = true;
// _graphicsProfile = value;
// }
// }

/// <summary>
/// Returns the graphics device for this manager.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ This package provides you with MonoGame Framework that uses OpenGL for rendering
<Compile Remove="Graphics\Effect\IEffectMatrices.cs" />
<Compile Remove="Graphics\Effect\SkinnedEffect.cs" />
<Compile Remove="Graphics\GraphicsAdapter.cs" />
<Compile Remove="Graphics\GraphicsDebug.cs" />
<Compile Remove="Graphics\GraphicsDebugMessage.cs" />
<Compile Remove="Graphics\GraphicsProfile.cs" />
<Compile Remove="Graphics\Model.cs" />
<Compile Remove="Graphics\ModelBone.cs" />
<Compile Remove="Graphics\ModelBoneCollection.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static bool UseReferenceDevice
/// <param name="selectedMultiSampleCount">Set to the best count supported by the adaptor for the requested multisample count.</param>
/// <returns>True if the requested format is supported by the adaptor. False if one or more of the values was changed.</returns>
public bool QueryRenderTargetFormat(
GraphicsProfile graphicsProfile,
// GraphicsProfile graphicsProfile,
SurfaceFormat format,
// DepthFormat depthFormat,
int multiSampleCount,
Expand Down Expand Up @@ -393,23 +393,23 @@ public bool IsWideScreen
}
}

public bool IsProfileSupported(GraphicsProfile graphicsProfile)
{
if(UseReferenceDevice)
return true;

switch(graphicsProfile)
{
case GraphicsProfile.Reach:
return true;
case GraphicsProfile.HiDef:
bool result = true;
// TODO: check adapter capabilities...
return result;
default:
throw new InvalidOperationException();
}
}
// public bool IsProfileSupported(GraphicsProfile graphicsProfile)
// {
// if(UseReferenceDevice)
// return true;
//
// switch(graphicsProfile)
// {
// case GraphicsProfile.Reach:
// return true;
// // case GraphicsProfile.HiDef:
// // bool result = true;
// // // TODO: check adapter capabilities...
// return result;
// default:
// throw new InvalidOperationException();
// }
// }

#if WINDOWS && !OPENGL
[System.Runtime.InteropServices.DllImport("gdi32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true, ExactSpelling = true)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

namespace Microsoft.Xna.Framework.Graphics
{
public partial class GraphicsDebug
{
private bool PlatformTryDequeueMessage(out GraphicsDebugMessage message)
{
message = null;
return false;
}
}
}
// // MonoGame - Copyright (C) The MonoGame Team
// // This file is subject to the terms and conditions defined in
// // file 'LICENSE.txt', which is part of this source code package.
//
// namespace Microsoft.Xna.Framework.Graphics
// {
// public partial class GraphicsDebug
// {
// private bool PlatformTryDequeueMessage(out GraphicsDebugMessage message)
// {
// message = null;
// return false;
// }
// }
// }

0 comments on commit cae2c9b

Please sign in to comment.