From ce2a569a208a18b75c79266e5bf8853016d97b3e Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Thu, 16 May 2024 22:57:55 +0300 Subject: [PATCH] Add texture swizzle parameters. --- Quik/OpenGL/GL.cs | 4 ++++ Quik/OpenGL/GLEnum.cs | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/Quik/OpenGL/GL.cs b/Quik/OpenGL/GL.cs index e06250b..e4f0068 100644 --- a/Quik/OpenGL/GL.cs +++ b/Quik/OpenGL/GL.cs @@ -30,6 +30,7 @@ namespace Quik.OpenGL private static GLEnum1Proc _depthFunc; private static GLEnum1Proc _clear; private static GLI4Proc _viewport; + private static GLI4Proc _scissor; private static GLF4Proc _clearColor; private static DrawElementsProc _drawElements; private static DrawArraysProc _drawArrays; @@ -54,6 +55,7 @@ namespace Quik.OpenGL _depthFunc = GetProcAddress("glDepthFunc"); _clear = GetProcAddress("glClear"); _viewport = GetProcAddress("glViewport"); + _scissor = GetProcAddress("glScissor"); _clearColor = GetProcAddress("glClearColor"); _drawElements = GetProcAddress("glDrawElements"); _drawArrays = GetProcAddress("glDrawArrays"); @@ -82,6 +84,8 @@ namespace Quik.OpenGL [MethodImpl(AggressiveInlining)] public static void Viewport(int x, int y, int w, int h) => _viewport(x, y, w, h); [MethodImpl(AggressiveInlining)] + public static void Scissor(int x, int y, int w, int h) => _scissor(x, y, w, h); + [MethodImpl(AggressiveInlining)] public static void ClearColor(float r, float g, float b, float a) => _clearColor(r, g, b, a); [MethodImpl(AggressiveInlining)] diff --git a/Quik/OpenGL/GLEnum.cs b/Quik/OpenGL/GLEnum.cs index b0fb06e..d2ebb93 100644 --- a/Quik/OpenGL/GLEnum.cs +++ b/Quik/OpenGL/GLEnum.cs @@ -5,6 +5,8 @@ namespace Quik.OpenGL GL_OK = 0, GL_TRUE = 1, GL_FALSE = 0, + GL_ONE = 1, + GL_ZERO = 0, GL_MAJOR_VERSION = 0x821B, GL_MINOR_VERSION = 0x821C, GL_VENDOR = 0x1F00, @@ -35,6 +37,8 @@ namespace Quik.OpenGL GL_FLOAT = 0x1406, GL_RED = 0x1903, + GL_GREEN = 0x1904, + GL_BLUE = 0x1905, GL_ALPHA = 0x1906, GL_RGB = 0x1907, GL_RGBA = 0x1908, @@ -75,5 +79,11 @@ namespace Quik.OpenGL GL_REPEAT = 0x2901, GL_TRIANGLES = 0x0004, + + GL_SCISSOR_TEST = 0x0C11, + GL_TEXTURE_SWIZZLE_R = 0x8E42, + GL_TEXTURE_SWIZZLE_G = 0x8E43, + GL_TEXTURE_SWIZZLE_B = 0x8E44, + GL_TEXTURE_SWIZZLE_A = 0x8E45 } } \ No newline at end of file