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

Commit

Permalink
Removed model and 3d stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefreeman committed May 21, 2020
1 parent 28e0299 commit 751768c
Show file tree
Hide file tree
Showing 7 changed files with 374 additions and 363 deletions.
34 changes: 17 additions & 17 deletions MonoGame/MonoGame.Framework/Graphics/Effect/EffectParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,23 +306,23 @@ public Texture2D GetValueTexture2D ()
return (Texture2D)Data;
}

#if !GLES
public Texture3D GetValueTexture3D ()
{
if (ParameterClass != EffectParameterClass.Object || ParameterType != EffectParameterType.Texture3D)
throw new InvalidCastException();

return (Texture3D)Data;
}
#endif

public TextureCube GetValueTextureCube ()
{
if (ParameterClass != EffectParameterClass.Object || ParameterType != EffectParameterType.TextureCube)
throw new InvalidCastException();

return (TextureCube)Data;
}
// #if !GLES
// public Texture3D GetValueTexture3D ()
// {
// if (ParameterClass != EffectParameterClass.Object || ParameterType != EffectParameterType.Texture3D)
// throw new InvalidCastException();
//
// return (Texture3D)Data;
// }
// #endif
//
// public TextureCube GetValueTextureCube ()
// {
// if (ParameterClass != EffectParameterClass.Object || ParameterType != EffectParameterType.TextureCube)
// throw new InvalidCastException();
//
// return (TextureCube)Data;
// }

public Vector2 GetValueVector2 ()
{
Expand Down
24 changes: 12 additions & 12 deletions MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -795,18 +795,18 @@ public void SetRenderTarget(RenderTarget2D renderTarget)
}
}

public void SetRenderTarget(RenderTargetCube renderTarget, CubeMapFace cubeMapFace)
{
if (renderTarget == null)
{
SetRenderTargets(null);
}
else
{
_tempRenderTargetBinding[0] = new RenderTargetBinding(renderTarget, cubeMapFace);
SetRenderTargets(_tempRenderTargetBinding);
}
}
// public void SetRenderTarget(RenderTargetCube renderTarget, CubeMapFace cubeMapFace)
// {
// if (renderTarget == null)
// {
// SetRenderTargets(null);
// }
// else
// {
// _tempRenderTargetBinding[0] = new RenderTargetBinding(renderTarget, cubeMapFace);
// SetRenderTargets(_tempRenderTargetBinding);
// }
// }

public void SetRenderTargets(params RenderTargetBinding[] renderTargets)
{
Expand Down
22 changes: 11 additions & 11 deletions MonoGame/MonoGame.Framework/Graphics/RenderTargetBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ public RenderTargetBinding(RenderTarget2D renderTarget)
_depthFormat = renderTarget.DepthStencilFormat;
}

public RenderTargetBinding(RenderTargetCube renderTarget, CubeMapFace cubeMapFace)
{
if (renderTarget == null)
throw new ArgumentNullException("renderTarget");
if (cubeMapFace < CubeMapFace.PositiveX || cubeMapFace > CubeMapFace.NegativeZ)
throw new ArgumentOutOfRangeException("cubeMapFace");

_renderTarget = renderTarget;
_arraySlice = (int)cubeMapFace;
_depthFormat = renderTarget.DepthStencilFormat;
}
// public RenderTargetBinding(RenderTargetCube renderTarget, CubeMapFace cubeMapFace)
// {
// if (renderTarget == null)
// throw new ArgumentNullException("renderTarget");
// if (cubeMapFace < CubeMapFace.PositiveX || cubeMapFace > CubeMapFace.NegativeZ)
// throw new ArgumentOutOfRangeException("cubeMapFace");
//
// _renderTarget = renderTarget;
// _arraySlice = (int)cubeMapFace;
// _depthFormat = renderTarget.DepthStencilFormat;
// }

#if DIRECTX

Expand Down
11 changes: 11 additions & 0 deletions MonoGame/MonoGame.Framework/MonoGame.Framework.DesktopGL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ This package provides you with MonoGame Framework that uses OpenGL for rendering
<Compile Remove="Graphics\Effect\SkinnedEffect.cs" />
<Compile Remove="Graphics\GraphicsAdapter.cs" />
<Compile Remove="Graphics\Model.cs" />
<Compile Remove="Graphics\ModelBone.cs" />
<Compile Remove="Graphics\ModelBoneCollection.cs" />
<Compile Remove="Graphics\ModelEffectCollection.cs" />
<Compile Remove="Graphics\ModelMesh.cs" />
<Compile Remove="Graphics\ModelMeshCollection.cs" />
<Compile Remove="Graphics\ModelMeshPart.cs" />
<Compile Remove="Graphics\ModelMeshPartCollection.cs" />
<Compile Remove="Graphics\OcclusionQuery.cs" />
<Compile Remove="Graphics\RenderTargetCube.cs" />
<Compile Remove="Graphics\Texture3D.cs" />
<Compile Remove="Graphics\TextureCube.cs" />
<Compile Remove="IDrawable.cs" />
<Compile Remove="IGameComponent.cs" />
<Compile Remove="IPlatformBackButton.cs" />
Expand Down
128 changes: 64 additions & 64 deletions MonoGame/MonoGame.Framework/Platform/Graphics/OcclusionQuery.OpenGL.cs
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
// 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.

using MonoGame.OpenGL;

namespace Microsoft.Xna.Framework.Graphics
{
partial class OcclusionQuery
{
private int glQueryId = -1;

private void PlatformConstruct()
{
GL.GenQueries(1, out glQueryId);
GraphicsExtensions.CheckGLError();
}

private void PlatformBegin()
{
GL.BeginQuery(QueryTarget.SamplesPassed, glQueryId);
GraphicsExtensions.CheckGLError();
}

private void PlatformEnd()
{
GL.EndQuery(QueryTarget.SamplesPassed);
GraphicsExtensions.CheckGLError();
}

private bool PlatformGetResult(out int pixelCount)
{
int resultReady = 0;
GL.GetQueryObject(glQueryId, GetQueryObjectParam.QueryResultAvailable, out resultReady);
GraphicsExtensions.CheckGLError();

if (resultReady == 0)
{
pixelCount = 0;
return false;
}

GL.GetQueryObject(glQueryId, GetQueryObjectParam.QueryResult, out pixelCount);
GraphicsExtensions.CheckGLError();

return true;
}

protected override void Dispose(bool disposing)
{
if (!IsDisposed)
{
if (glQueryId > -1)
{
GraphicsDevice.DisposeQuery(glQueryId);
glQueryId = -1;
}
}

base.Dispose(disposing);
}
}
}

// // 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.
//
// using MonoGame.OpenGL;
//
// namespace Microsoft.Xna.Framework.Graphics
// {
// partial class OcclusionQuery
// {
// private int glQueryId = -1;
//
// private void PlatformConstruct()
// {
// GL.GenQueries(1, out glQueryId);
// GraphicsExtensions.CheckGLError();
// }
//
// private void PlatformBegin()
// {
// GL.BeginQuery(QueryTarget.SamplesPassed, glQueryId);
// GraphicsExtensions.CheckGLError();
// }
//
// private void PlatformEnd()
// {
// GL.EndQuery(QueryTarget.SamplesPassed);
// GraphicsExtensions.CheckGLError();
// }
//
// private bool PlatformGetResult(out int pixelCount)
// {
// int resultReady = 0;
// GL.GetQueryObject(glQueryId, GetQueryObjectParam.QueryResultAvailable, out resultReady);
// GraphicsExtensions.CheckGLError();
//
// if (resultReady == 0)
// {
// pixelCount = 0;
// return false;
// }
//
// GL.GetQueryObject(glQueryId, GetQueryObjectParam.QueryResult, out pixelCount);
// GraphicsExtensions.CheckGLError();
//
// return true;
// }
//
// protected override void Dispose(bool disposing)
// {
// if (!IsDisposed)
// {
// if (glQueryId > -1)
// {
// GraphicsDevice.DisposeQuery(glQueryId);
// glQueryId = -1;
// }
// }
//
// base.Dispose(disposing);
// }
// }
// }
//
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
// 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.

using MonoGame.OpenGL;

namespace Microsoft.Xna.Framework.Graphics
{
public partial class RenderTargetCube
{
int IRenderTarget.GLTexture
{
get { return glTexture; }
}

TextureTarget IRenderTarget.GLTarget
{
get { return glTarget; }
}

int IRenderTarget.GLColorBuffer { get; set; }
int IRenderTarget.GLDepthBuffer { get; set; }
int IRenderTarget.GLStencilBuffer { get; set; }

TextureTarget IRenderTarget.GetFramebufferTarget(RenderTargetBinding renderTargetBinding)
{
return TextureTarget.TextureCubeMapPositiveX + renderTargetBinding.ArraySlice;
}

private void PlatformConstruct(GraphicsDevice graphicsDevice, bool mipMap, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage)
{
Threading.BlockOnUIThread(() =>
{
graphicsDevice.PlatformCreateRenderTarget(this, size, size, mipMap, this.Format, preferredDepthFormat, preferredMultiSampleCount, usage);
});
}

protected override void Dispose(bool disposing)
{
if (!IsDisposed)
{
if (GraphicsDevice != null)
{
Threading.BlockOnUIThread(() =>
{
this.GraphicsDevice.PlatformDeleteRenderTarget(this);
});
}
}

base.Dispose(disposing);
}
}
}
// // 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.
//
// using MonoGame.OpenGL;
//
// namespace Microsoft.Xna.Framework.Graphics
// {
// public partial class RenderTargetCube
// {
// int IRenderTarget.GLTexture
// {
// get { return glTexture; }
// }
//
// TextureTarget IRenderTarget.GLTarget
// {
// get { return glTarget; }
// }
//
// int IRenderTarget.GLColorBuffer { get; set; }
// int IRenderTarget.GLDepthBuffer { get; set; }
// int IRenderTarget.GLStencilBuffer { get; set; }
//
// TextureTarget IRenderTarget.GetFramebufferTarget(RenderTargetBinding renderTargetBinding)
// {
// return TextureTarget.TextureCubeMapPositiveX + renderTargetBinding.ArraySlice;
// }
//
// private void PlatformConstruct(GraphicsDevice graphicsDevice, bool mipMap, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage)
// {
// Threading.BlockOnUIThread(() =>
// {
// graphicsDevice.PlatformCreateRenderTarget(this, size, size, mipMap, this.Format, preferredDepthFormat, preferredMultiSampleCount, usage);
// });
// }
//
// protected override void Dispose(bool disposing)
// {
// if (!IsDisposed)
// {
// if (GraphicsDevice != null)
// {
// Threading.BlockOnUIThread(() =>
// {
// this.GraphicsDevice.PlatformDeleteRenderTarget(this);
// });
// }
// }
//
// base.Dispose(disposing);
// }
// }
// }

0 comments on commit 751768c

Please sign in to comment.