From 2590beb0c0327156ad794a4fde4b92bf0c51827f Mon Sep 17 00:00:00 2001 From: FrederikJA Date: Fri, 12 Apr 2024 14:16:44 +0200 Subject: [PATCH] Tmp --- JAngine/Rendering/OpenGL/GL.cs | 65 +++++++++++++++++++++++++++++++++ JAngine/Shaders/Untitled.tga | Bin 0 -> 2394 bytes 2 files changed, 65 insertions(+) create mode 100644 JAngine/Shaders/Untitled.tga diff --git a/JAngine/Rendering/OpenGL/GL.cs b/JAngine/Rendering/OpenGL/GL.cs index ae52da2..c972e34 100644 --- a/JAngine/Rendering/OpenGL/GL.cs +++ b/JAngine/Rendering/OpenGL/GL.cs @@ -309,6 +309,51 @@ internal enum VertexAttribType : Enum // GL_UNSIGNED_INT_10F_11F_11F_REV } + internal enum TextureTarget : Enum + { + Texture2D = 0x0DE1, + ProxyTexture2D = 0x8064, + Texture1DArray = 0x8C18, + ProxyTexture1DArray = 0x8C19, + TextureRectangle = 0x84F5, + ProxyTextureRectangle = 0x84F7, + TextureCubeMapPositiveX = 0x8515, + TextureCubeMapNegativeX = 0x8516, + TextureCubeMapPositiveY = 0x8517, + TextureCubeMapNegativeY = 0x8518, + TextureCubeMapPositiveZ = 0x8519, + TextureCubeMapNegativeZ = 0x851A, + ProxyTextureCubeMap = 0x851B, + } + + internal enum PixelFormat : Enum + { + Red = 0x1903, + Rg = 0x8227, + Rgb = 0x1907, + Bgr = 0x80E0, + Rgba = 0x1908, + Bgra = 0x80E1, + RedInteger = 0x8D94, + RgInteger = 0x8228, + RgbInteger = 0x8D98, + BgrInteger = 0x8D9A, + RgbaInteger = 0x8D99, + BgraInteger = 0x8D9B, + StencilIndex = 0x1901, + DepthComponent = 0x1902, + DepthStencil = 0x821A, + } + + internal enum PixelType : Enum + { + GL_UNSIGNED_BYTE0x1401, + GL_BYTE0x1400, + GL_UNSIGNED_SHORT0x1403, + GL_SHORT0x1402 + // TODO: Not done yet. + } + private static readonly delegate* unmanaged ViewportPtr = (delegate* unmanaged)Glfw.GetProcAddress("glViewport"); private static readonly delegate* unmanaged EnablePtr = @@ -398,6 +443,14 @@ internal enum VertexAttribType : Enum private static readonly delegate* unmanaged VertexArrayAttribLFormatPtr = (delegate* unmanaged)Glfw.GetProcAddress("glVertexArrayAttribLFormat"); + private static readonly delegate* unmanaged GenTexturesPtr = + (delegate* unmanaged)Glfw.GetProcAddress("glGenTextures"); + private static readonly delegate* unmanaged DeleteTexturesPtr = + (delegate* unmanaged)Glfw.GetProcAddress("glDeleteTextures"); + private static readonly delegate* unmanaged TexImage2D = + (delegate* unmanaged)Glfw.GetProcAddress("glTexImage2D"); + + internal static void Viewport(int x, int y, int width, int height) { ViewportPtr(x, y, width, height); @@ -661,4 +714,16 @@ internal static void VertexArrayAttribLFormat(uint vao, uint attribIndex, int si { VertexArrayAttribLFormatPtr(vao, attribIndex, size, type, relativeOffset); } + + internal static uint GenTexture() + { + uint texture = 0; + GenTexturesPtr(1, &texture); + return texture; + } + + internal static void DeleteTexture(uint texture) + { + DeleteVertexArraysPtr(1, &texture); + } } diff --git a/JAngine/Shaders/Untitled.tga b/JAngine/Shaders/Untitled.tga new file mode 100644 index 0000000000000000000000000000000000000000..3c3d6f7c0e3daa8caba4572030acef8b13cf55dc GIT binary patch literal 2394 zcmZve+iqJ`5Qf+Gw%v#);3eQ0dQ+rG2qaG8b#~I6?buG5w25;*m83~c8hS`Wl9tdD z6%<4(M8yT=hH?Wp6S)8pT2`O5OY`>GwjCVV-~ZTff%^Hm^@B==$8D@> zOLtN}VeMz|VJ4}t&u%YJ`p4<4zY?T&41iQLwX z_3!Lj%InO65d}gLCaX<2$0CRVRY^=42ZtitUb3lK8*N%PRJZl6bp0U9aNoVIvM3IT zcV4qA>K12bhH8d8IdcULl_0NAfdrffSSARJCN7F4T>IeM^Tkd3^2olvZ-7Yn>kHLK zmDD5SKn7 z_(+aQdB>Gjf<{KXDya2MTU@jDqPU_C)vbs>mq<6DIpX6sNQgR*LcsX=E2~e~8o-1? zzkT9%)liOh>e}2C>1X1E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