daily update on 20240104 by nitload youmu, double threading not work
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
public interface IglFunc
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Align a sets of code to frame update of a <see cref="Form"/>.
|
||||
/// Usually, a call of <see cref="AfterAlign(Form,Action)"/> is required.
|
||||
/// This method is used as sigle thread method. If more than one
|
||||
/// alignment is requested, a <see cref="InvalidOperationException"/> will throw.
|
||||
/// Same function as OpenGL api glActiveTexture
|
||||
/// </summary>
|
||||
/// <param name="form">The form used as frame update benchmark.</param>
|
||||
/// <exception cref="InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
void AlignFrame(Form form);
|
||||
/// <param name="type">type of texture to activate</param>
|
||||
void ActiveTexture(uint type);
|
||||
|
||||
/// <summary>
|
||||
/// Operation after alignment by calling <see cref="AlignFrame(Form)"/>.
|
||||
@@ -28,10 +26,14 @@ namespace StgSharp.Graphics
|
||||
void AfterAlign(Form form, Action action);
|
||||
|
||||
/// <summary>
|
||||
/// Same function as OpenGL api glActiveTexture
|
||||
/// Align a sets of code to frame update of a <see cref="Form"/>.
|
||||
/// Usually, a call of <see cref="AfterAlign(Form,Action)"/> is required.
|
||||
/// This method is used as sigle thread method. If more than one
|
||||
/// alignment is requested, a <see cref="InvalidOperationException"/> will throw.
|
||||
/// </summary>
|
||||
/// <param name="type">type of texture to activate</param>
|
||||
void ActiveTexture(uint type);
|
||||
/// <param name="form">The form used as frame update benchmark.</param>
|
||||
/// <exception cref="InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
void AlignFrame(Form form);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucntion as OpenGL api glAttachShader
|
||||
@@ -76,6 +78,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="B">Specify the red values used when the color buffers are cleared.</param>
|
||||
/// <param name="A">Specify the red values used when the color buffers are cleared.</param>
|
||||
void ClearColor(float R, float G, float B, float A);
|
||||
|
||||
void ClearGraphicError();
|
||||
|
||||
/// <summary>
|
||||
@@ -96,53 +99,59 @@ namespace StgSharp.Graphics
|
||||
/// <summary>
|
||||
/// Creates a form and its associated
|
||||
/// </summary>
|
||||
/// <param name="handle">The instance of created form</param>
|
||||
/// <param name="width">Required width</param>
|
||||
/// <param name="height">Required width</param>
|
||||
/// <param name="tittle">Tittle of the window </param>
|
||||
/// <param name="monitor"></param>
|
||||
/// <param name="share"></param>
|
||||
/// <returns>The instance of created form</returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
IntPtr CreateWindowHandle(int width, int height, string tittle, IntPtr monitor, Form share);
|
||||
|
||||
uint CreatGraphicProgram();
|
||||
|
||||
/// <summary>
|
||||
/// Same function as OpenGL api, glDeleteBuffer.
|
||||
/// Same function as OpenGL api, glDeleteBuffer. This method can delete one buffer in one call
|
||||
/// </summary>
|
||||
/// <param name="handle">a handle representing the buffer to be deleted</param>
|
||||
unsafe void DeleteBuffer(uint handle);
|
||||
|
||||
/// <summary>
|
||||
/// Same function as OpenGL api, glDeleteBuffer. This method can delete a sets of buffers in one call.
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of bufferd to be deleted</param>
|
||||
/// <param name="ptr">Pointer of buffer to be deleted</param>
|
||||
unsafe void DeleteBuffers(int count, uint* ptr);
|
||||
/// <param name="handle">Array of buffers to be deleted</param>
|
||||
unsafe void DeleteBuffers(uint count, uint[] handle);
|
||||
|
||||
/// <summary>
|
||||
/// Same function as OpenGL api, glDeleteVertexArrays
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of vao to be deleted</param>
|
||||
/// <param name="ptr">pointer of vao sign array</param>
|
||||
unsafe void DeleteVertexArrays(int count, uint* ptr);
|
||||
/// <param name="arrays">A array representing a colletion of vertex objects.</param>
|
||||
unsafe void DeleteVertexArrays(uint count, uint[] arrays);
|
||||
|
||||
void DrawElements(GepmetryType mode, int count, Type type, IntPtr ptr);
|
||||
void DrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucntion as the OpenGL api glGenBuffers
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="ptr"></param>
|
||||
unsafe void GenBuffers(int count, uint* ptr);
|
||||
unsafe void GenBuffers(uint count, uint* ptr);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucnction as OpenGL api glGenTextures.
|
||||
/// </summary>
|
||||
/// <param name="count">amount of textures to generate</param>
|
||||
/// <param name="ptr">pointer to texture signs' array</param>
|
||||
unsafe void GenTextures(int count, uint* ptr);
|
||||
unsafe void GenTextures(uint count, uint* ptr);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucntion as OpenGL api, glGenVertexArray
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of vao to be generated</param>
|
||||
/// <param name="ptr">Pointer of vao sign array</param>
|
||||
unsafe void GenVertexArrays(int count, uint* ptr);
|
||||
unsafe void GenVertexArrays(uint count, uint* ptr);
|
||||
|
||||
void GetGraphicError();
|
||||
|
||||
@@ -174,18 +183,66 @@ namespace StgSharp.Graphics
|
||||
/// <param name="handler">Method hadler </param>
|
||||
void SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U,V,W}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U,V,W}"/> target</param>
|
||||
/// <param name="v0">The first value to be set</param>
|
||||
/// <param name="v1">The second value to be set</param>
|
||||
/// <param name="v2">The third value to be set</param>
|
||||
/// <param name="v3">The forth value to be set</param>
|
||||
void SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U,V,W}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U,V,W}"/> target</param>
|
||||
/// <param name="vec">A <see cref="Vec4d"/> packing four parameters of the uniform </param>
|
||||
void SetValue(Uniform<float, float, float, float> uniform, Vec4d vec);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U,V}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U,V}"/> target</param>
|
||||
/// <param name="v0">The first value to be set</param>
|
||||
/// <param name="v1">The second value to be set</param>
|
||||
/// <param name="v2">The third value to be set</param>
|
||||
void SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U}"/> target</param>
|
||||
/// <param name="v0">The first value to be set</param>
|
||||
/// <param name="v1">The second value to be set</param>
|
||||
void SetValue(Uniform<float, float> uniform, float v0, float v1);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T}"/> target</param>
|
||||
/// <param name="v0">The value to be set</param>
|
||||
void SetValue(Uniform<float> uniform, float v0);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a int <see cref="Uniform{T}"/>,
|
||||
/// all types of parameters are int.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T}"/> target</param>
|
||||
/// <param name="i0">The value to be set</param>
|
||||
void SetValue(Uniform<int> uniform, int i0);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T}"/>,
|
||||
/// all types of parameters are <see cref="Vec4d"/>.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T}"/> target</param>
|
||||
/// <param name="vec">A <see cref="Vec4d"/> value of the uniform </param>
|
||||
void SetValue(Uniform<Vec4d> uniform, Vec4d vec);
|
||||
|
||||
/// <summary>
|
||||
@@ -197,7 +254,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="normalized"></param>
|
||||
/// <param name="stride">Pixels stride of each sets of data</param>
|
||||
/// <param name="pointer"></param>
|
||||
void SetVertexAttribute(uint index, int size, Type t, bool normalized, int stride, int pointer);
|
||||
void SetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer);
|
||||
|
||||
void SwapBuffers(Form form);
|
||||
|
||||
@@ -212,7 +269,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="format">color channels of this image</param>
|
||||
/// <param name="type">how this image express each pixel</param>
|
||||
/// <param name="pixels">pointer to data array of pixels</param>
|
||||
unsafe void TextureImage2d(uint target, int level, uint internalformat, int width, int height, uint format, uint type, void* pixels);
|
||||
unsafe void TextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucntion as OpenGL api glTexParameteri
|
||||
@@ -227,6 +284,7 @@ namespace StgSharp.Graphics
|
||||
/// </summary>
|
||||
/// <param name="program">Sign of program to be used</param>
|
||||
void UseProgram(uint program);
|
||||
|
||||
/// <summary>
|
||||
/// Same function as the OpenGL api, glViewPort
|
||||
/// </summary>
|
||||
@@ -234,7 +292,9 @@ namespace StgSharp.Graphics
|
||||
/// <param name="y"></param>
|
||||
/// <param name="width"></param>
|
||||
/// <param name="height"></param>
|
||||
void Viewport(int x, int y, int width, int height);
|
||||
void Viewport(int x, int y, uint width, uint height);
|
||||
|
||||
void SetWindowShouldClose(Form form, bool mark);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user