Improve exception docs in Bizware.*
This commit is contained in:
parent
89b475661a
commit
3bab282e8d
|
@ -30,7 +30,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.GdiPlus
|
||||||
CornerColors[which] = color;
|
CornerColors[which] = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentException"><paramref name="colors"/> does not have exactly <c>4</c> elements</exception>
|
||||||
public void SetCornerColors(OpenTK.Graphics.Color4[] colors)
|
public void SetCornerColors(OpenTK.Graphics.Color4[] colors)
|
||||||
{
|
{
|
||||||
Flush(); //dont really need to flush with current implementation. we might as well roll modulate color into it too.
|
Flush(); //dont really need to flush with current implementation. we might as well roll modulate color into it too.
|
||||||
|
@ -142,7 +142,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.GdiPlus
|
||||||
//no batching, nothing to do here yet
|
//no batching, nothing to do here yet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><see cref="IsActive"/> is <see langword="false"/></exception>
|
||||||
public void End()
|
public void End()
|
||||||
{
|
{
|
||||||
if (!IsActive)
|
if (!IsActive)
|
||||||
|
|
|
@ -178,6 +178,10 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
||||||
public List<int> SamplerLocs;
|
public List<int> SamplerLocs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">
|
||||||
|
/// <paramref name="required"/> is <see langword="true"/> and either <paramref name="vertexShader"/> or <paramref name="fragmentShader"/> is unavailable (their <see cref="Shader.Available"/> property is <see langword="false"/>), or
|
||||||
|
/// <c>glLinkProgram</c> call did not produce expected result
|
||||||
|
/// </exception>
|
||||||
public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, Shader fragmentShader, bool required, string memo)
|
public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, Shader fragmentShader, bool required, string memo)
|
||||||
{
|
{
|
||||||
//if the shaders arent available, the pipeline isn't either
|
//if the shaders arent available, the pipeline isn't either
|
||||||
|
@ -362,6 +366,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
||||||
GL.DeleteShader(sw.sid);
|
GL.DeleteShader(sw.sid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><paramref name="pipeline"/>.<see cref="Pipeline.Available"/> is <see langword="false"/></exception>
|
||||||
public void BindPipeline(Pipeline pipeline)
|
public void BindPipeline(Pipeline pipeline)
|
||||||
{
|
{
|
||||||
_CurrPipeline = pipeline;
|
_CurrPipeline = pipeline;
|
||||||
|
@ -525,6 +530,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
||||||
GL.Ext.DeleteFramebuffer((int)rt.Opaque);
|
GL.Ext.DeleteFramebuffer((int)rt.Opaque);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">framebuffer creation unsuccessful</exception>
|
||||||
public unsafe RenderTarget CreateRenderTarget(int w, int h)
|
public unsafe RenderTarget CreateRenderTarget(int w, int h)
|
||||||
{
|
{
|
||||||
//create a texture for it
|
//create a texture for it
|
||||||
|
|
|
@ -173,6 +173,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX
|
||||||
public Dictionary<string, string> MapNativeToCode;
|
public Dictionary<string, string> MapNativeToCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><paramref name="required"/> is <see langword="true"/> and compilation error occurred</exception>
|
||||||
public Shader CreateFragmentShader(bool cg, string source, string entry, bool required)
|
public Shader CreateFragmentShader(bool cg, string source, string entry, bool required)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -231,6 +232,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><paramref name="required"/> is <see langword="true"/> and compilation error occurred</exception>
|
||||||
public Shader CreateVertexShader(bool cg, string source, string entry, bool required)
|
public Shader CreateVertexShader(bool cg, string source, string entry, bool required)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -371,6 +373,10 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX
|
||||||
public IBlendState BlendNoneOpaque { get { return _rsBlendNoneOpaque; } }
|
public IBlendState BlendNoneOpaque { get { return _rsBlendNoneOpaque; } }
|
||||||
public IBlendState BlendNormal { get { return _rsBlendNormal; } }
|
public IBlendState BlendNormal { get { return _rsBlendNormal; } }
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">
|
||||||
|
/// <paramref name="required"/> is <see langword="true"/> and either <paramref name="vertexShader"/> or <paramref name="fragmentShader"/> is unavailable (their <see cref="Shader.Available"/> property is <see langword="false"/>), or
|
||||||
|
/// one of <paramref name="vertexLayout"/>'s items has an unsupported value in <see cref="LayoutItem.AttribType"/>, <see cref="LayoutItem.Components"/>, or <see cref="LayoutItem.Usage"/>
|
||||||
|
/// </exception>
|
||||||
public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, Shader fragmentShader, bool required, string memo)
|
public Pipeline CreatePipeline(VertexLayout vertexLayout, Shader vertexShader, Shader fragmentShader, bool required, string memo)
|
||||||
{
|
{
|
||||||
if (!vertexShader.Available || !fragmentShader.Available)
|
if (!vertexShader.Available || !fragmentShader.Available)
|
||||||
|
@ -712,6 +718,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">GDI+ call returned unexpected data</exception>
|
||||||
public unsafe void LoadTextureData(Texture2d tex, BitmapBuffer bmp)
|
public unsafe void LoadTextureData(Texture2d tex, BitmapBuffer bmp)
|
||||||
{
|
{
|
||||||
sdi.BitmapData bmp_data = bmp.LockBits();
|
sdi.BitmapData bmp_data = bmp.LockBits();
|
||||||
|
@ -739,6 +746,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">SlimDX call returned unexpected data</exception>
|
||||||
public unsafe BitmapBuffer ResolveTexture2d(Texture2d tex)
|
public unsafe BitmapBuffer ResolveTexture2d(Texture2d tex)
|
||||||
{
|
{
|
||||||
//TODO - lazy create and cache resolving target in RT
|
//TODO - lazy create and cache resolving target in RT
|
||||||
|
@ -824,6 +832,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX
|
||||||
surface.Dispose();
|
surface.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><paramref name="control"/> does not match control passed to <see cref="BeginControl"/></exception>
|
||||||
public void EndControl(GLControlWrapper_SlimDX9 control)
|
public void EndControl(GLControlWrapper_SlimDX9 control)
|
||||||
{
|
{
|
||||||
if (control != _CurrentControl)
|
if (control != _CurrentControl)
|
||||||
|
@ -949,6 +958,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="NotSupportedException"><paramref name="mode"/> is <see cref="gl.PrimitiveType.TriangleStrip"/></exception>
|
||||||
public unsafe void DrawArrays(gl.PrimitiveType mode, int first, int count)
|
public unsafe void DrawArrays(gl.PrimitiveType mode, int first, int count)
|
||||||
{
|
{
|
||||||
PrimitiveType pt = PrimitiveType.TriangleStrip;
|
PrimitiveType pt = PrimitiveType.TriangleStrip;
|
||||||
|
|
|
@ -33,7 +33,9 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
private GCHandle CurrLockHandle;
|
private GCHandle CurrLockHandle;
|
||||||
private BitmapData CurrLock;
|
private BitmapData CurrLock;
|
||||||
|
|
||||||
public BitmapData LockBits() //TODO - add read/write semantic, for wraps
|
/// <exception cref="InvalidOperationException">already locked</exception>
|
||||||
|
/// <remarks>TODO add read/write semantic, for wraps</remarks>
|
||||||
|
public BitmapData LockBits()
|
||||||
{
|
{
|
||||||
if(CurrLock != null)
|
if(CurrLock != null)
|
||||||
throw new InvalidOperationException($"{nameof(BitmapBuffer)} can only be locked once!");
|
throw new InvalidOperationException($"{nameof(BitmapBuffer)} can only be locked once!");
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
CornerColors[which] = color;
|
CornerColors[which] = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="ArgumentException"><paramref name="colors"/> does not have exactly <c>4</c> elements</exception>
|
||||||
public void SetCornerColors(OpenTK.Graphics.Color4[] colors)
|
public void SetCornerColors(OpenTK.Graphics.Color4[] colors)
|
||||||
{
|
{
|
||||||
Flush(); //dont really need to flush with current implementation. we might as well roll modulate color into it too.
|
Flush(); //dont really need to flush with current implementation. we might as well roll modulate color into it too.
|
||||||
|
@ -77,6 +77,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
DefaultPipeline.Dispose();
|
DefaultPipeline.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><see cref="IsActive"/> is <see langword="true"/></exception>
|
||||||
public void SetPipeline(Pipeline pipeline)
|
public void SetPipeline(Pipeline pipeline)
|
||||||
{
|
{
|
||||||
if (IsActive)
|
if (IsActive)
|
||||||
|
@ -147,7 +148,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
Owner.SetViewport(width, height);
|
Owner.SetViewport(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">no pipeline set (need to call <see cref="SetPipeline"/>)</exception>
|
||||||
public void Begin()
|
public void Begin()
|
||||||
{
|
{
|
||||||
//uhhmmm I want to throw an exception if its already active, but its annoying.
|
//uhhmmm I want to throw an exception if its already active, but its annoying.
|
||||||
|
@ -176,7 +177,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
//no batching, nothing to do here yet
|
//no batching, nothing to do here yet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException"><see cref="IsActive"/> is <see langword="false"/></exception>
|
||||||
public void End()
|
public void End()
|
||||||
{
|
{
|
||||||
if (!IsActive)
|
if (!IsActive)
|
||||||
|
|
|
@ -26,9 +26,8 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
public IEnumerable<UniformInfo> UniformInfos { get { return _UniformInfos; } }
|
public IEnumerable<UniformInfo> UniformInfos { get { return _UniformInfos; } }
|
||||||
List<UniformInfo> _UniformInfos = new List<UniformInfo>();
|
List<UniformInfo> _UniformInfos = new List<UniformInfo>();
|
||||||
|
|
||||||
/// <summary>
|
/// <returns>the first and only <see cref="UniformInfo"/></returns>
|
||||||
/// Returns the sole UniformInfo or throws an exception if there's more than one
|
/// <exception cref="InvalidOperationException">more than one <see cref="UniformInfo"/> exists</exception>
|
||||||
/// </summary>
|
|
||||||
public UniformInfo Sole
|
public UniformInfo Sole
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -43,6 +43,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
RefCount++;
|
RefCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <exception cref="InvalidOperationException">already closed (by call to <see cref="Close"/>)</exception>
|
||||||
public void DefineVertexAttribute(string name, int index, int components, VertexAttribPointerType attribType, AttributeUsage usage, bool normalized, int stride, int offset = 0)
|
public void DefineVertexAttribute(string name, int index, int components, VertexAttribPointerType attribType, AttributeUsage usage, bool normalized, int stride, int offset = 0)
|
||||||
{
|
{
|
||||||
if (Closed)
|
if (Closed)
|
||||||
|
|
Loading…
Reference in New Issue