/// <summary> /// /// </summary> /// <param name="op"></param> /// <param name="value"></param> public static void glAccum(uint op, float value) { SoftGLRenderContext context = StaticCalls.GetCurrentContextObj(); if (context != null) { //context.Accum(op, value); throw new NotImplementedException(); } }
/// <summary> /// Make specified <paramref name="renderContext"/> the current one of current thread. /// </summary> /// <param name="deviceContext"></param> /// <param name="renderContext"></param> public static void MakeCurrent(IntPtr deviceContext, IntPtr renderContext) { SoftGLRenderContext context = GetContextObj(renderContext); var device = SoftGLDeviceContext.FromHandle(deviceContext); bool firstBound = ((context != null) && (device != null) && (!context.Bounded)); ContextManager.MakeCurrent(deviceContext, renderContext); if (firstBound) { int x = 0, y = 0, width = device.Width, height = device.Height; SoftGLRenderContext.glViewport(x, y, width, height); } }
/// <summary> /// Returns a parameter from a shader object. /// </summary> /// <param name="name">Specifies the shader object to be queried.</param> /// <param name="pname">Specifies the object parameter. Accepted symbolic names are GL_SHADER_TYPE, GL_DELETE_STATUS, GL_COMPILE_STATUS, GL_INFO_LOG_LENGTH, GL_SHADER_SOURCE_LENGTH.</param> /// <param name="pValues">Returns the requested object parameter.</param> public static void glGetShaderiv(uint name, uint pname, int[] pValues) { SoftGLRenderContext.glGetShaderiv(name, pname, pValues); }
/// <summary> /// define an array of generic vertex attribute data. /// </summary> /// <param name="index">Specifies the index of the generic vertex attribute to be modified.</param> /// <param name="size">Specifies the number of components per generic vertex attribute. Must be 1, 2, 3, 4. Additionally, the symbolic constant GL_BGRA is accepted by glVertexAttribPointer. The initial value is 4.</param> /// <param name="type">Specifies the data type of each component in the array. The different functions take different values. /// This method takes only GL_DOUBLE. The initial value is GL_FLOAT..</param> /// <param name="stride">Specifies the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in the array. The initial value is 0.</param> /// <param name="pointer">Specifies a offset of the first component of the first generic vertex attribute in the array in the data store of the buffer currently bound to the GL_ARRAY_BUFFER target. The initial value is 0.</param> public static void glVertexAttribLPointer(uint index, int size, uint type, int stride, IntPtr pointer) { SoftGLRenderContext.glVertexAttribLPointer(index, size, type, stride, pointer); }
/// <summary> /// determine if a name corresponds to a vertex array object. /// </summary> /// <param name="name">Specifies a value that may be the name of a vertex array object.</param> public static bool glIsVertexArray(uint name) { return(SoftGLRenderContext.glIsVertexArray(name)); }
// https://www.khronos.org/opengl/wiki/GLAPI/glClear /// <summary> /// clear buffers to preset values. /// </summary> /// <param name="mask">Bitwise OR of masks that indicate the buffers to be cleared. The three masks are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT.</param> public static void glClear(uint mask) { SoftGLRenderContext.glClear(mask); }
/// <summary> /// specify the clear value for the depth buffer. /// </summary> /// <param name="depth">Specifies the depth value used when the depth buffer is cleared. The initial value is 1.</param> public static void glClearDepth(double depth) { SoftGLRenderContext.glClearDepth(depth); }
/// <summary> /// specify clear values for the color buffers. /// </summary> /// <param name="r">Specify the red value used when the color buffers are cleared. The initial value is 0.</param> /// <param name="g">Specify the green value used when the color buffers are cleared. The initial value is 0.</param> /// <param name="b">Specify the blue value used when the color buffers are cleared. The initial value is 0.</param> /// <param name="a">Specify the alpha value used when the color buffers are cleared. The initial value is 0.</param> public static void glClearColor(float r, float g, float b, float a) { SoftGLRenderContext.glClearColor(r, g, b, a); }
/// <summary> /// establish data storage, format and dimensions of a renderbuffer object's image. /// </summary> /// <param name="target">Specifies a binding to which the target of the allocation and must be GL_RENDERBUFFER.</param> /// <param name="internalformat">Specifies the internal format to use for the renderbuffer object's image.</param> /// <param name="width">Specifies the width of the renderbuffer, in pixels.</param> /// <param name="height">Specifies the height of the renderbuffer, in pixels.</param> public static void glRenderbufferStorage(uint target, uint internalformat, int width, int height) { SoftGLRenderContext.glRenderbufferStorage(target, internalformat, width, height); }
/// <summary> /// Returns the location of an attribute variable. /// </summary> /// <param name="program">Specifies the program object to be queried.</param> /// <param name="name">Points to a null terminated string containing the name of the attribute variable whose location is to be queried.</param> public static int glGetAttribLocation(uint program, string name) { return(SoftGLRenderContext.glGetAttribLocation(program, name)); }
/// <summary> /// Links a program object. /// </summary> /// <param name="name">Specifies the handle of the program object to be linked.</param> public static void glLinkProgram(uint name) { SoftGLRenderContext.glLinkProgram(name); }
/// <summary> /// Attaches a shader object to a program object. /// </summary> /// <param name="program">Specifies the program object to which a shader object will be attached.</param> /// <param name="shader">Specifies the shader object that is to be attached.</param> public static void glAttachShader(uint program, uint shader) { SoftGLRenderContext.glAttachShader(program, shader); }
/// <summary> /// Creates a program object. /// </summary> /// <returns></returns> public static uint glCreateProgram() { return(SoftGLRenderContext.glCreateProgram()); }
/// <summary> /// attach a renderbuffer as a logical buffer to the currently bound framebuffer object. /// </summary> /// <param name="target">Specifies the framebuffer target. target must be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER, or GL_FRAMEBUFFER. GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER.</param> /// <param name="attachmentPoint">Specifies the attachment point of the framebuffer.</param> /// <param name="renderbufferTarget">Specifies the renderbuffer target and must be GL_RENDERBUFFER.</param> /// <param name="renderbufferName">Specifies the name of an existing renderbuffer object of type renderbuffertarget to attach.</param> public static void glFramebufferRenderbuffer(uint target, uint attachmentPoint, uint renderbufferTarget, uint renderbufferName) { SoftGLRenderContext.glFramebufferRenderbuffer(target, attachmentPoint, renderbufferTarget, renderbufferName); }
/// <summary> /// bind a renderbuffer to a renderbuffer target. /// </summary> /// <param name="target">Specifies the renderbuffer target of the binding operation. target must be GL_RENDERBUFFER.</param> /// <param name="name">Specifies the name of the renderbuffer object to bind.</param> public static void glBindRenderbuffer(uint target, uint name) { SoftGLRenderContext.glBindRenderbuffer(target, name); }
/// <summary> /// Installs a program object as part of current rendering state. /// </summary> /// <param name="program">Specifies the handle of the program object whose executables are to be used as part of current rendering state.</param> public static void glUseProgram(uint program) { SoftGLRenderContext.glUseProgram(program); }
/// <summary> /// determine if a name corresponds to a renderbuffer object. /// </summary> /// <param name="name">Specifies a value that may be the name of a renderbuffer object.</param> /// <returns></returns> public static bool glIsRenderbuffer(uint name) { return(SoftGLRenderContext.glIsRenderbuffer(name)); }
/// <summary> /// Returns a parameter from a program object. /// </summary> /// <param name="program">Specifies the program object to be queried.</param> /// <param name="pname">Specifies the object parameter. Accepted symbolic names are GL_DELETE_STATUS, GL_LINK_STATUS, GL_VALIDATE_STATUS, GL_INFO_LOG_LENGTH, GL_ATTACHED_SHADERS, GL_ACTIVE_ATOMIC_COUNTER_BUFFERS, GL_ACTIVE_ATTRIBUTES, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, GL_ACTIVE_UNIFORMS, GL_ACTIVE_UNIFORM_BLOCKS, GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, GL_ACTIVE_UNIFORM_MAX_LENGTH, GL_COMPUTE_WORK_GROUP_SIZEGL_PROGRAM_BINARY_LENGTH, GL_TRANSFORM_FEEDBACK_BUFFER_MODE, GL_TRANSFORM_FEEDBACK_VARYINGS, GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, GL_GEOMETRY_VERTICES_OUT, GL_GEOMETRY_INPUT_TYPE, and GL_GEOMETRY_OUTPUT_TYPE.</param> /// <param name="pValues">Returns the requested object parameter.</param> public static void glGetProgramiv(uint program, uint pname, int[] pValues) { SoftGLRenderContext.glGetProgramiv(program, pname, pValues); }
/// <summary> /// delete renderbuffer objects. /// </summary> /// <param name="count">Specifies the number of renderbuffer objects to be deleted.</param> /// <param name="names">A pointer to an array containing <paramref name="count"/> renderbuffer objects to be deleted.</param> public static void glDeleteRenderbuffers(int count, uint[] names) { SoftGLRenderContext.glDeleteRenderbuffers(count, names); }
/// <summary> /// read a block of pixels from the frame buffer. /// </summary> /// <param name="x">Specify the window coordinates of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels.</param> /// <param name="y">Specify the window coordinates of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels.</param> /// <param name="width">Specify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel.</param> /// <param name="height">Specify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel.</param> /// <param name="format">Specifies the format of the pixel data. For transfers of depth, stencil, or depth/stencil data, you must use GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, or GL_DEPTH_STENCIL, where appropriate. For transfers of normalized integer or floating-point color image data, you must use one of the following: GL_RED, GL_GREEN, GL_BLUE, GL_RG, GL_RGB, GL_BGR, GL_RGBA, and GL_BGRA. For transfers of non-normalized integer data, you must use one of the following: GL_RED_INTEGER, GL_GREEN_INTEGER, GL_BLUE_INTEGER, GL_RG_INTEGER, GL_RGB_INTEGER, GL_BGR_INTEGER, GL_RGBA_INTEGER, and GL_BGRA_INTEGER. Even if no actual pixel transfer is made (data is NULL and no buffer is bound to GL_PIXEL_UNPACK_BUFFER), you must set this parameter correctly for the internal format of the destination image.</param> /// <param name="type">Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV.</param> /// <param name="data">Specifies a pointer to the image data in memory, or if a buffer is bound to GL_PIXEL_PACK_BUFFER, this provides an integer offset into the bound buffer object. If a buffer is not bound to GL_PIXEL_PACK_BUFFER, this parameter may not be NULL.</param> public static void glReadPixels(int x, int y, int width, int height, uint format, uint type, IntPtr data) { SoftGLRenderContext.glReadPixels(x, y, width, height, format, type, data); }
/// <summary> /// specify the clear value for the depth buffer. /// </summary> /// <param name="depth">Specifies the depth value used when the depth buffer is cleared. The initial value is 1.</param> public static void glClearDepthf(float depth) { SoftGLRenderContext.glClearDepthf(depth); }
/// <summary> /// Specifies a list of color buffers to be drawn into. /// </summary> /// <param name="count">Specifies the number of buffers in <paramref name="buffers"/>.</param> /// <param name="buffers">Points to an array of symbolic constants specifying the buffers into which fragment colors or data values will be written.</param> public static void glDrawBuffers(int count, uint[] buffers) { SoftGLRenderContext.glDrawBuffers(count, buffers); }
/// <summary> /// specify the clear value for the stencil buffer. /// </summary> /// <param name="s">Specifies the index used when the stencil buffer is cleared. The initial value is 0.</param> public static void glClearStencil(int s) { SoftGLRenderContext.glClearStencil(s); }
/// <summary> /// creates and initializes a buffer object's data store. /// </summary> /// <param name="target">Specifies the target buffer object. The symbolic constant must be GL_ARRAY_BUFFER, GL_ATOMIC_COUNTER_BUFFER, GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, GL_DRAW_INDIRECT_BUFFER, GL_DISPATCH_INDIRECT_BUFFER, GL_ELEMENT_ARRAY_BUFFER, GL_PIXEL_PACK_BUFFER, GL_PIXEL_UNPACK_BUFFER, GL_QUERY_BUFFER, GL_SHADER_STORAGE_BUFFER, GL_TEXTURE_BUFFER, GL_TRANSFORM_FEEDBACK_BUFFER, or GL_UNIFORM_BUFFER.</param> /// <param name="size">Specifies the size in bytes of the buffer object's new data store.</param> /// <param name="data">Specifies a pointer to data that will be copied into the data store for initialization, or NULL if no data is to be copied.</param> /// <param name="usage">Specifies the expected usage pattern of the data store. The symbolic constant must be GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY, GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY, GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, or GL_DYNAMIC_COPY.</param> public static void glBufferData(uint target, int size, IntPtr data, uint usage) { SoftGLRenderContext.glBufferData(target, size, data, usage); }
/// <summary> /// bind a vertex array object. /// </summary> /// <param name="name">Specifies the name of the vertex array to bind.</param> public static void glBindVertexArray(uint name) { SoftGLRenderContext.glBindVertexArray(name); }
public static void glSamplerParameteri(uint sampler, uint pname, int param) { SoftGLRenderContext.glSamplerParameteri(sampler, pname, param); }
/// <summary> /// delete vertex array objects. /// </summary> /// <param name="count">Specifies the number of vertex array objects to be deleted.</param> /// <param name="names">Specifies the address of an array containing the n names of the objects to be deleted.</param> public static void glDeleteVertexArrays(int count, uint[] names) { SoftGLRenderContext.glDeleteVertexArrays(count, names); }
/// <summary> /// check the completeness status of a framebuffer. /// </summary> /// <param name="target">Specify the target of the framebuffer completeness check.</param> /// <returns></returns> public static uint glCheckFramebufferStatus(uint target) { return(SoftGLRenderContext.glCheckFramebufferStatus(target)); }
/// <summary> /// Enable a generic vertex attribute array. /// </summary> /// <param name="index">Specifies the index of the generic vertex attribute to be enabled or disabled.</param> public static void glEnableVertexAttribArray(uint index) { SoftGLRenderContext.glEnableVertexAttribArray(index); }
/// <summary> /// Compiles a shader object. /// </summary> /// <param name="name">Specifies the shader object to be compiled.</param> public static void glCompileShader(uint name) { SoftGLRenderContext.glCompileShader(name); }