Do naming refactoring on Ryujinx.Graphics (#611)
* Renaming part 1 * Renaming part 2 * Renaming part 3 * Renaming part 4 * Renaming part 5 * Renaming part 6 * Renaming part 7 * Renaming part 8 * Renaming part 9 * Renaming part 10 * General cleanup * Thought I got all of these * Apply #595 * Additional renaming * Tweaks from feedback * Rename files
This commit is contained in:
parent
8e71ea0812
commit
1f554c1093
125 changed files with 9121 additions and 9120 deletions
55
Ryujinx.Graphics/Gal/OpenGL/OglStreamBuffer.cs
Normal file
55
Ryujinx.Graphics/Gal/OpenGL/OglStreamBuffer.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Gal.OpenGL
|
||||
{
|
||||
class OglStreamBuffer : IDisposable
|
||||
{
|
||||
public int Handle { get; protected set; }
|
||||
|
||||
public long Size { get; protected set; }
|
||||
|
||||
protected BufferTarget Target { get; private set; }
|
||||
|
||||
public OglStreamBuffer(BufferTarget target, long size)
|
||||
{
|
||||
Target = target;
|
||||
Size = size;
|
||||
|
||||
Handle = GL.GenBuffer();
|
||||
|
||||
GL.BindBuffer(target, Handle);
|
||||
|
||||
GL.BufferData(target, (IntPtr)size, IntPtr.Zero, BufferUsageHint.StreamDraw);
|
||||
}
|
||||
|
||||
public void SetData(long size, IntPtr hostAddress)
|
||||
{
|
||||
GL.BindBuffer(Target, Handle);
|
||||
|
||||
GL.BufferSubData(Target, IntPtr.Zero, (IntPtr)size, hostAddress);
|
||||
}
|
||||
|
||||
public void SetData(byte[] data)
|
||||
{
|
||||
GL.BindBuffer(Target, Handle);
|
||||
|
||||
GL.BufferSubData(Target, IntPtr.Zero, (IntPtr)data.Length, data);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && Handle != 0)
|
||||
{
|
||||
GL.DeleteBuffer(Handle);
|
||||
|
||||
Handle = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue