|
@@ -1,10 +1,116 @@
|
|
|
+/**********************************************************************************************
|
|
|
+*
|
|
|
+* rlgl v4.5 - A multi-OpenGL abstraction layer with an immediate-mode style API
|
|
|
+*
|
|
|
+* An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0)
|
|
|
+* that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
|
|
|
+*
|
|
|
+* When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are
|
|
|
+* initialized on rlglInit() to accumulate vertex data.
|
|
|
+*
|
|
|
+* When an internal state change is required all the stored vertex data is renderer in batch,
|
|
|
+* additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch.
|
|
|
+*
|
|
|
+* Some additional resources are also loaded for convenience, here the complete list:
|
|
|
+* - Default batch (RLGL.defaultBatch): RenderBatch system to accumulate vertex data
|
|
|
+* - Default texture (RLGL.defaultTextureId): 1x1 white pixel R8G8B8A8
|
|
|
+* - Default shader (RLGL.State.defaultShaderId, RLGL.State.defaultShaderLocs)
|
|
|
+*
|
|
|
+* Internal buffer (and additional resources) must be manually unloaded calling rlglClose().
|
|
|
+*
|
|
|
+*
|
|
|
+* CONFIGURATION:
|
|
|
+*
|
|
|
+* #define GRAPHICS_API_OPENGL_11
|
|
|
+* #define GRAPHICS_API_OPENGL_21
|
|
|
+* #define GRAPHICS_API_OPENGL_33
|
|
|
+* #define GRAPHICS_API_OPENGL_43
|
|
|
+* #define GRAPHICS_API_OPENGL_ES2
|
|
|
+* Use selected OpenGL graphics backend, should be supported by platform
|
|
|
+* Those preprocessor defines are only used on rlgl module, if OpenGL version is
|
|
|
+* required by any other module, use rlGetVersion() to check it
|
|
|
+*
|
|
|
+* #define RLGL_IMPLEMENTATION
|
|
|
+* Generates the implementation of the library into the included file.
|
|
|
+* If not defined, the library is in header only mode and can be included in other headers
|
|
|
+* or source files without problems. But only ONE file should hold the implementation.
|
|
|
+*
|
|
|
+* #define RLGL_RENDER_TEXTURES_HINT
|
|
|
+* Enable framebuffer objects (fbo) support (enabled by default)
|
|
|
+* Some GPUs could not support them despite the OpenGL version
|
|
|
+*
|
|
|
+* #define RLGL_SHOW_GL_DETAILS_INFO
|
|
|
+* Show OpenGL extensions and capabilities detailed logs on init
|
|
|
+*
|
|
|
+* #define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT
|
|
|
+* Enable debug context (only available on OpenGL 4.3)
|
|
|
+*
|
|
|
+* rlgl capabilities could be customized just defining some internal
|
|
|
+* values before library inclusion (default values listed):
|
|
|
+*
|
|
|
+* #define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits
|
|
|
+* #define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering)
|
|
|
+* #define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture)
|
|
|
+* #define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
|
|
|
+*
|
|
|
+* #define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack
|
|
|
+* #define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
|
|
|
+* #define RL_CULL_DISTANCE_NEAR 0.01 // Default projection matrix near cull distance
|
|
|
+* #define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance
|
|
|
+*
|
|
|
+* When loading a shader, the following vertex attribute and uniform
|
|
|
+* location names are tried to be set automatically:
|
|
|
+*
|
|
|
+* #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: 0
|
|
|
+* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: 1
|
|
|
+* #define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: 2
|
|
|
+* #define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: 3
|
|
|
+* #define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: 4
|
|
|
+* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
|
|
|
+* #define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix
|
|
|
+* #define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix
|
|
|
+* #define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix
|
|
|
+* #define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView))
|
|
|
+* #define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color)
|
|
|
+* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0)
|
|
|
+* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1)
|
|
|
+* #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2)
|
|
|
+*
|
|
|
+* DEPENDENCIES:
|
|
|
+*
|
|
|
+* - OpenGL libraries (depending on platform and OpenGL version selected)
|
|
|
+* - GLAD OpenGL extensions loading library (only for OpenGL 3.3 Core, 4.3 Core)
|
|
|
+*
|
|
|
+*
|
|
|
+* LICENSE: zlib/libpng
|
|
|
+*
|
|
|
+* Copyright (c) 2014-2023 Ramon Santamaria (@raysan5)
|
|
|
+*
|
|
|
+* This software is provided "as-is", without any express or implied warranty. In no event
|
|
|
+* will the authors be held liable for any damages arising from the use of this software.
|
|
|
+*
|
|
|
+* Permission is granted to anyone to use this software for any purpose, including commercial
|
|
|
+* applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
|
|
+*
|
|
|
+* 1. The origin of this software must not be misrepresented; you must not claim that you
|
|
|
+* wrote the original software. If you use this software in a product, an acknowledgment
|
|
|
+* in the product documentation would be appreciated but is not required.
|
|
|
+*
|
|
|
+* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
|
|
+* as being the original software.
|
|
|
+*
|
|
|
+* 3. This notice may not be removed or altered from any source distribution.
|
|
|
+*
|
|
|
+**********************************************************************************************/
|
|
|
+
|
|
|
+
|
|
|
package raylib
|
|
|
|
|
|
import "core:c"
|
|
|
|
|
|
when ODIN_OS == .Windows {
|
|
|
foreign import lib {
|
|
|
- "raylib.lib",
|
|
|
+ "windows/raylib.lib",
|
|
|
"system:Winmm.lib",
|
|
|
"system:Gdi32.lib",
|
|
|
"system:User32.lib",
|
|
@@ -13,37 +119,51 @@ when ODIN_OS == .Windows {
|
|
|
} else when ODIN_OS == .Linux {
|
|
|
foreign import lib "linux/libraylib.a"
|
|
|
} else when ODIN_OS == .Darwin {
|
|
|
- foreign import lib "macos/libraylib.a"
|
|
|
+ when ODIN_ARCH == .arm64 {
|
|
|
+ foreign import lib {
|
|
|
+ "macos-arm64/libraylib.a",
|
|
|
+ "system:Cocoa.framework",
|
|
|
+ "system:OpenGL.framework",
|
|
|
+ "system:IOKit.framework",
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ foreign import lib {
|
|
|
+ "macos/libraylib.a",
|
|
|
+ "system:Cocoa.framework",
|
|
|
+ "system:OpenGL.framework",
|
|
|
+ "system:IOKit.framework",
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
foreign import lib "system:raylib"
|
|
|
}
|
|
|
|
|
|
-GRAPHICS_API_OPENGL_11 :: false
|
|
|
-GRAPHICS_API_OPENGL_21 :: true
|
|
|
-GRAPHICS_API_OPENGL_33 :: GRAPHICS_API_OPENGL_21
|
|
|
-GRAPHICS_API_OPENGL_ES2 :: false
|
|
|
-GRAPHICS_API_OPENGL_43 :: false
|
|
|
+RL_GRAPHICS_API_OPENGL_11 :: false
|
|
|
+RL_GRAPHICS_API_OPENGL_21 :: true
|
|
|
+RL_GRAPHICS_API_OPENGL_33 :: RL_GRAPHICS_API_OPENGL_21 // default currently
|
|
|
+RL_GRAPHICS_API_OPENGL_ES2 :: false
|
|
|
+RL_GRAPHICS_API_OPENGL_43 :: false
|
|
|
|
|
|
-when !GRAPHICS_API_OPENGL_ES2 {
|
|
|
+when !RL_GRAPHICS_API_OPENGL_ES2 {
|
|
|
// This is the maximum amount of elements (quads) per batch
|
|
|
// NOTE: Be careful with text, every letter maps to a quad
|
|
|
- DEFAULT_BATCH_BUFFER_ELEMENTS :: 8192
|
|
|
+ RL_DEFAULT_BATCH_BUFFER_ELEMENTS :: 8192
|
|
|
} else {
|
|
|
// We reduce memory sizes for embedded systems (RPI and HTML5)
|
|
|
// NOTE: On HTML5 (emscripten) this is allocated on heap,
|
|
|
// by default it's only 16MB!...just take care...
|
|
|
- DEFAULT_BATCH_BUFFER_ELEMENTS :: 2048
|
|
|
+ RL_DEFAULT_BATCH_BUFFER_ELEMENTS :: 2048
|
|
|
}
|
|
|
|
|
|
-DEFAULT_BATCH_BUFFERS :: 1 // Default number of batch buffers (multi-buffering)
|
|
|
-DEFAULT_BATCH_DRAWCALLS :: 256 // Default number of batch draw calls (by state changes: mode, texture)
|
|
|
-MAX_BATCH_ACTIVE_TEXTURES :: 4 // Maximum number of additional textures that can be activated on batch drawing (SetShaderValueTexture())
|
|
|
+RL_DEFAULT_BATCH_BUFFERS :: 1 // Default number of batch buffers (multi-buffering)
|
|
|
+RL_DEFAULT_BATCH_DRAWCALLS :: 256 // Default number of batch draw calls (by state changes: mode, texture)
|
|
|
+RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS :: 4 // Maximum number of additional textures that can be activated on batch drawing (SetShaderValueTexture())
|
|
|
|
|
|
// Internal Matrix stack
|
|
|
-MAX_MATRIX_STACK_SIZE :: 32 // Maximum size of Matrix stack
|
|
|
+RL_MAX_MATRIX_STACK_SIZE :: 32 // Maximum size of Matrix stack
|
|
|
|
|
|
// Shader limits
|
|
|
-MAX_SHADER_LOCATIONS :: 32 // Maximum number of shader locations supported
|
|
|
+RL_MAX_SHADER_LOCATIONS :: 32 // Maximum number of shader locations supported
|
|
|
|
|
|
// Projection matrix culling
|
|
|
RL_CULL_DISTANCE_NEAR :: 0.01 // Default near cull distance
|
|
@@ -98,87 +218,129 @@ RL_FRAGMENT_SHADER :: 0x8B30 // GL_FRAGMENT_SHADER
|
|
|
RL_VERTEX_SHADER :: 0x8B31 // GL_VERTEX_SHADER
|
|
|
RL_COMPUTE_SHADER :: 0x91B9 // GL_COMPUTE_SHADER
|
|
|
|
|
|
+// GL blending factors
|
|
|
+RL_ZERO :: 0 // GL_ZERO
|
|
|
+RL_ONE :: 1 // GL_ONE
|
|
|
+RL_SRC_COLOR :: 0x0300 // GL_SRC_COLOR
|
|
|
+RL_ONE_MINUS_SRC_COLOR :: 0x0301 // GL_ONE_MINUS_SRC_COLOR
|
|
|
+RL_SRC_ALPHA :: 0x0302 // GL_SRC_ALPHA
|
|
|
+RL_ONE_MINUS_SRC_ALPHA :: 0x0303 // GL_ONE_MINUS_SRC_ALPHA
|
|
|
+RL_DST_ALPHA :: 0x0304 // GL_DST_ALPHA
|
|
|
+RL_ONE_MINUS_DST_ALPHA :: 0x0305 // GL_ONE_MINUS_DST_ALPHA
|
|
|
+RL_DST_COLOR :: 0x0306 // GL_DST_COLOR
|
|
|
+RL_ONE_MINUS_DST_COLOR :: 0x0307 // GL_ONE_MINUS_DST_COLOR
|
|
|
+RL_SRC_ALPHA_SATURATE :: 0x0308 // GL_SRC_ALPHA_SATURATE
|
|
|
+RL_CONSTANT_COLOR :: 0x8001 // GL_CONSTANT_COLOR
|
|
|
+RL_ONE_MINUS_CONSTANT_COLOR :: 0x8002 // GL_ONE_MINUS_CONSTANT_COLOR
|
|
|
+RL_CONSTANT_ALPHA :: 0x8003 // GL_CONSTANT_ALPHA
|
|
|
+RL_ONE_MINUS_CONSTANT_ALPHA :: 0x8004 // GL_ONE_MINUS_CONSTANT_ALPHA
|
|
|
+
|
|
|
+// GL blending functions/equations
|
|
|
+RL_FUNC_ADD :: 0x8006 // GL_FUNC_ADD
|
|
|
+RL_MIN :: 0x8007 // GL_MIN
|
|
|
+RL_MAX :: 0x8008 // GL_MAX
|
|
|
+RL_FUNC_SUBTRACT :: 0x800A // GL_FUNC_SUBTRACT
|
|
|
+RL_FUNC_REVERSE_SUBTRACT :: 0x800B // GL_FUNC_REVERSE_SUBTRACT
|
|
|
+RL_BLEND_EQUATION :: 0x8009 // GL_BLEND_EQUATION
|
|
|
+RL_BLEND_EQUATION_RGB :: 0x8009 // GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)
|
|
|
+RL_BLEND_EQUATION_ALPHA :: 0x883D // GL_BLEND_EQUATION_ALPHA
|
|
|
+RL_BLEND_DST_RGB :: 0x80C8 // GL_BLEND_DST_RGB
|
|
|
+RL_BLEND_SRC_RGB :: 0x80C9 // GL_BLEND_SRC_RGB
|
|
|
+RL_BLEND_DST_ALPHA :: 0x80CA // GL_BLEND_DST_ALPHA
|
|
|
+RL_BLEND_SRC_ALPHA :: 0x80CB // GL_BLEND_SRC_ALPHA
|
|
|
+RL_BLEND_COLOR :: 0x8005 // GL_BLEND_COLOR
|
|
|
+
|
|
|
|
|
|
//----------------------------------------------------------------------------------
|
|
|
// Types and Structures Definition
|
|
|
//----------------------------------------------------------------------------------
|
|
|
-GlVersion :: enum c.int { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 }
|
|
|
-
|
|
|
-FramebufferAttachType :: enum c. int {
|
|
|
- COLOR_CHANNEL0 = 0,
|
|
|
- COLOR_CHANNEL1,
|
|
|
- COLOR_CHANNEL2,
|
|
|
- COLOR_CHANNEL3,
|
|
|
- COLOR_CHANNEL4,
|
|
|
- COLOR_CHANNEL5,
|
|
|
- COLOR_CHANNEL6,
|
|
|
- COLOR_CHANNEL7,
|
|
|
- DEPTH = 100,
|
|
|
- STENCIL = 200,
|
|
|
-}
|
|
|
|
|
|
-FramebufferAttachTextureType :: enum c.int {
|
|
|
- CUBEMAP_POSITIVE_X = 0,
|
|
|
- CUBEMAP_NEGATIVE_X,
|
|
|
- CUBEMAP_POSITIVE_Y,
|
|
|
- CUBEMAP_NEGATIVE_Y,
|
|
|
- CUBEMAP_POSITIVE_Z,
|
|
|
- CUBEMAP_NEGATIVE_Z,
|
|
|
- TEXTURE2D = 100,
|
|
|
- RENDERBUFFER = 200,
|
|
|
-}
|
|
|
|
|
|
-VertexBufferIndexType :: c.ushort when GRAPHICS_API_OPENGL_ES2 else c.uint
|
|
|
+VertexBufferIndexType :: c.ushort when RL_GRAPHICS_API_OPENGL_ES2 else c.uint
|
|
|
|
|
|
// Dynamic vertex buffers (position + texcoords + colors + indices arrays)
|
|
|
VertexBuffer :: struct {
|
|
|
- elementsCount: c.int, // Number of elements in the buffer (QUADS)
|
|
|
-
|
|
|
- vCounter: c.int, // Vertex position counter to process (and draw) from full buffer
|
|
|
- tcCounter: c.int, // Vertex texcoord counter to process (and draw) from full buffer
|
|
|
- cCounter: c.int, // Vertex color counter to process (and draw) from full buffer
|
|
|
-
|
|
|
- vertices: [^]f32, // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
|
|
- texcoords: [^]f32, // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
|
|
- colors: [^]u8, // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
|
|
- indices: [^]VertexBufferIndexType, // Vertex indices (in case vertex data comes indexed) (6 indices per quad)
|
|
|
- vaoId: u32, // OpenGL Vertex Array Object id
|
|
|
- vboId: [4]u32, // OpenGL Vertex Buffer Objects id (4 types of vertex data)
|
|
|
-}
|
|
|
+ elementCount: c.int, // Number of elements in the buffer (QUADS)
|
|
|
+
|
|
|
+ vertices: [^]f32, // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
|
|
+ texcoords: [^]f32, // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
|
|
+ colors: [^]u8, // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
|
|
+ indices: [^]VertexBufferIndexType, // Vertex indices (in case vertex data comes indexed) (6 indices per quad)
|
|
|
+ vaoId: c.uint, // OpenGL Vertex Array Object id
|
|
|
+ vboId: [4]c.uint, // OpenGL Vertex Buffer Objects id (4 types of vertex data)
|
|
|
+}
|
|
|
|
|
|
// Draw call type
|
|
|
// NOTE: Only texture changes register a new draw, other state-change-related elements are not
|
|
|
// used at this moment (vaoId, shaderId, matrices), raylib just forces a batch draw call if any
|
|
|
// of those state-change happens (this is done in core module)
|
|
|
DrawCall :: struct {
|
|
|
- mode: c.int, // Drawing mode: LINES, TRIANGLES, QUADS
|
|
|
- vertexCount: c.int, // Number of vertex of the draw
|
|
|
- vertexAlignment: c.int, // Number of vertex required for index alignment (LINES, TRIANGLES)
|
|
|
- //vaoId: u32, // Vertex array id to be used on the draw -> Using RLGL.currentBatch->vertexBuffer.vaoId
|
|
|
- //shaderId: u32, // Shader id to be used on the draw -> Using RLGL.currentShader.id
|
|
|
- textureId: u32, // Texture id to be used on the draw -> Use to create new draw call if changes
|
|
|
-
|
|
|
- //projection: Matrix, // Projection matrix for this draw -> Using RLGL.projection by default
|
|
|
- //modelview: Matrix, // Modelview matrix for this draw -> Using RLGL.modelview by default
|
|
|
-}
|
|
|
+ mode: c.int, // Drawing mode: LINES, TRIANGLES, QUADS
|
|
|
+ vertexCount: c.int, // Number of vertex of the draw
|
|
|
+ vertexAlignment: c.int, // Number of vertex required for index alignment (LINES, TRIANGLES)
|
|
|
+ textureId: c.uint, // Texture id to be used on the draw -> Use to create new draw call if changes
|
|
|
+}
|
|
|
|
|
|
// RenderBatch type
|
|
|
RenderBatch :: struct {
|
|
|
- buffersCount: c.int, // Number of vertex buffers (multi-buffering support)
|
|
|
+ bufferCount: c.int, // Number of vertex buffers (multi-buffering support)
|
|
|
currentBuffer: c.int, // Current buffer tracking in case of multi-buffering
|
|
|
vertexBuffer: [^]VertexBuffer, // Dynamic buffer(s) for vertex data
|
|
|
|
|
|
- draws: [^]DrawCall, // Draw calls array, depends on textureId
|
|
|
- drawsCounter: c.int, // Draw calls counter
|
|
|
- currentDepth: f32, // Current depth value for next draw
|
|
|
+ draws: [^]DrawCall, // Draw calls array, depends on textureId
|
|
|
+ drawCounter: c.int, // Draw calls counter
|
|
|
+ currentDepth: f32, // Current depth value for next draw
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+// OpenGL version
|
|
|
+GlVersion :: enum c.int {
|
|
|
+ OPENGL_11 = 1, // OpenGL 1.1
|
|
|
+ OPENGL_21, // OpenGL 2.1 (GLSL 120)
|
|
|
+ OPENGL_33, // OpenGL 3.3 (GLSL 330)
|
|
|
+ OPENGL_43, // OpenGL 4.3 (using GLSL 330)
|
|
|
+ OPENGL_ES_20, // OpenGL ES 2.0 (GLSL 100)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
// Shader attribute data types
|
|
|
ShaderAttributeDataType :: enum c.int {
|
|
|
- FLOAT = 0,
|
|
|
- VEC2,
|
|
|
- VEC3,
|
|
|
- VEC4,
|
|
|
+ FLOAT = 0, // Shader attribute type: float
|
|
|
+ VEC2, // Shader attribute type: vec2 (2 float)
|
|
|
+ VEC3, // Shader attribute type: vec3 (3 float)
|
|
|
+ VEC4, // Shader attribute type: vec4 (4 float)
|
|
|
+}
|
|
|
+
|
|
|
+// Framebuffer attachment type
|
|
|
+// NOTE: By default up to 8 color channels defined, but it can be more
|
|
|
+FramebufferAttachType :: enum c.int {
|
|
|
+ COLOR_CHANNEL0 = 0, // Framebuffer attachment type: color 0
|
|
|
+ COLOR_CHANNEL1, // Framebuffer attachment type: color 1
|
|
|
+ COLOR_CHANNEL2, // Framebuffer attachment type: color 2
|
|
|
+ COLOR_CHANNEL3, // Framebuffer attachment type: color 3
|
|
|
+ COLOR_CHANNEL4, // Framebuffer attachment type: color 4
|
|
|
+ COLOR_CHANNEL5, // Framebuffer attachment type: color 5
|
|
|
+ COLOR_CHANNEL6, // Framebuffer attachment type: color 6
|
|
|
+ COLOR_CHANNEL7, // Framebuffer attachment type: color 7
|
|
|
+ DEPTH = 100, // Framebuffer attachment type: depth
|
|
|
+ STENCIL = 200, // Framebuffer attachment type: stencil
|
|
|
+}
|
|
|
+
|
|
|
+// Framebuffer texture attachment type
|
|
|
+FramebufferAttachTextureType :: enum c.int {
|
|
|
+ CUBEMAP_POSITIVE_X = 0, // Framebuffer texture attachment type: cubemap, +X side
|
|
|
+ CUBEMAP_NEGATIVE_X, // Framebuffer texture attachment type: cubemap, -X side
|
|
|
+ CUBEMAP_POSITIVE_Y, // Framebuffer texture attachment type: cubemap, +Y side
|
|
|
+ CUBEMAP_NEGATIVE_Y, // Framebuffer texture attachment type: cubemap, -Y side
|
|
|
+ CUBEMAP_POSITIVE_Z, // Framebuffer texture attachment type: cubemap, +Z side
|
|
|
+ CUBEMAP_NEGATIVE_Z, // Framebuffer texture attachment type: cubemap, -Z side
|
|
|
+ TEXTURE2D = 100, // Framebuffer texture attachment type: texture2d
|
|
|
+ RENDERBUFFER = 200, // Framebuffer texture attachment type: renderbuffer
|
|
|
+}
|
|
|
+
|
|
|
+CullMode :: enum c.int {
|
|
|
+ FRONT = 0,
|
|
|
+ BACK,
|
|
|
}
|
|
|
|
|
|
@(default_calling_convention="c")
|
|
@@ -219,38 +381,38 @@ foreign lib {
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
|
// Vertex buffers state
|
|
|
- rlEnableVertexArray :: proc(vaoId: u32) -> bool --- // Enable vertex array (VAO, if supported)
|
|
|
- rlDisableVertexArray :: proc() --- // Disable vertex array (VAO, if supported)
|
|
|
- rlEnableVertexBuffer :: proc(id: u32) --- // Enable vertex buffer (VBO)
|
|
|
- rlDisableVertexBuffer :: proc() --- // Disable vertex buffer (VBO)
|
|
|
- rlEnableVertexBufferElement :: proc(id: u32) --- // Enable vertex buffer element (VBO element)
|
|
|
- rlDisableVertexBufferElement :: proc() --- // Disable vertex buffer element (VBO element)
|
|
|
- rlEnableVertexAttribute :: proc(index: u32) --- // Enable vertex attribute index
|
|
|
- rlDisableVertexAttribute :: proc(index: u32) --- // Disable vertex attribute index
|
|
|
- when GRAPHICS_API_OPENGL_11 {
|
|
|
+ rlEnableVertexArray :: proc(vaoId: c.uint) -> bool --- // Enable vertex array (VAO, if supported)
|
|
|
+ rlDisableVertexArray :: proc() --- // Disable vertex array (VAO, if supported)
|
|
|
+ rlEnableVertexBuffer :: proc(id: c.uint) --- // Enable vertex buffer (VBO)
|
|
|
+ rlDisableVertexBuffer :: proc() --- // Disable vertex buffer (VBO)
|
|
|
+ rlEnableVertexBufferElement :: proc(id: c.uint) --- // Enable vertex buffer element (VBO element)
|
|
|
+ rlDisableVertexBufferElement :: proc() --- // Disable vertex buffer element (VBO element)
|
|
|
+ rlEnableVertexAttribute :: proc(index: c.uint) --- // Enable vertex attribute index
|
|
|
+ rlDisableVertexAttribute :: proc(index: c.uint) --- // Disable vertex attribute index
|
|
|
+ when RL_GRAPHICS_API_OPENGL_11 {
|
|
|
rlEnableStatePointer :: proc(vertexAttribType: c.int, buffer: rawptr) ---
|
|
|
rlDisableStatePointer :: proc(vertexAttribType: c.int) ---
|
|
|
}
|
|
|
|
|
|
// Textures state
|
|
|
- rlActiveTextureSlot :: proc(slot: c.int) --- // Select and active a texture slot
|
|
|
- rlEnableTexture :: proc(id: u32) --- // Enable texture
|
|
|
- rlDisableTexture :: proc() --- // Disable texture
|
|
|
- rlEnableTextureCubemap :: proc(id: u32) --- // Enable texture cubemap
|
|
|
- rlDisableTextureCubemap :: proc() --- // Disable texture cubemap
|
|
|
- rlTextureParameters :: proc(id: u32, param: c.int, value: c.int) --- // Set texture parameters (filter, wrap)
|
|
|
+ rlActiveTextureSlot :: proc(slot: c.int) --- // Select and active a texture slot
|
|
|
+ rlEnableTexture :: proc(id: c.uint) --- // Enable texture
|
|
|
+ rlDisableTexture :: proc() --- // Disable texture
|
|
|
+ rlEnableTextureCubemap :: proc(id: c.uint) --- // Enable texture cubemap
|
|
|
+ rlDisableTextureCubemap :: proc() --- // Disable texture cubemap
|
|
|
+ rlTextureParameters :: proc(id: c.uint, param: c.int, value: c.int) --- // Set texture parameters (filter, wrap)
|
|
|
+ rlCubemapParameters :: proc(id: i32, param: c.int, value: c.int) --- // Set cubemap parameters (filter, wrap)
|
|
|
|
|
|
// Shader state
|
|
|
- rlEnableShader :: proc(id: u32) --- // Enable shader program
|
|
|
+ rlEnableShader :: proc(id: c.uint) --- // Enable shader program
|
|
|
rlDisableShader :: proc() --- // Disable shader program
|
|
|
|
|
|
// Framebuffer state
|
|
|
- rlEnableFramebuffer :: proc(id: u32) --- // Enable render texture (fbo)
|
|
|
+ rlEnableFramebuffer :: proc(id: c.uint) --- // Enable render texture (fbo)
|
|
|
rlDisableFramebuffer :: proc() --- // Disable render texture (fbo), return to default framebuffer
|
|
|
rlActiveDrawBuffers :: proc(count: c.int) --- // Activate multiple draw color buffers
|
|
|
|
|
|
// General render state
|
|
|
- rlEnableColorBlend :: proc() --- // Enable color blending
|
|
|
rlDisableColorBlend :: proc() --- // Disable color blending
|
|
|
rlEnableDepthTest :: proc() --- // Enable depth test
|
|
|
rlDisableDepthTest :: proc() --- // Disable depth test
|
|
@@ -258,6 +420,7 @@ foreign lib {
|
|
|
rlDisableDepthMask :: proc() --- // Disable depth write
|
|
|
rlEnableBackfaceCulling :: proc() --- // Enable backface culling
|
|
|
rlDisableBackfaceCulling :: proc() --- // Disable backface culling
|
|
|
+ rlSetCullFace :: proc(mode: CullMode) --- // Set face culling mode
|
|
|
rlEnableScissorTest :: proc() --- // Enable scissor test
|
|
|
rlDisableScissorTest :: proc() --- // Disable scissor test
|
|
|
rlScissor :: proc(x, y, width, height: c.int) --- // Scissor test
|
|
@@ -271,102 +434,107 @@ foreign lib {
|
|
|
rlDisableStereoRender :: proc() --- // Disable stereo rendering
|
|
|
rlIsStereoRenderEnabled :: proc() -> bool --- // Check if stereo render is enabled
|
|
|
|
|
|
- rlClearColor :: proc(r, g, b, a: u8) --- // Clear color buffer with color
|
|
|
- rlClearScreenBuffers :: proc() --- // Clear used screen buffers (color and depth)
|
|
|
- rlCheckErrors :: proc() --- // Check and log OpenGL error codes
|
|
|
- rlSetBlendMode :: proc(mode: c.int) --- // Set blending mode
|
|
|
- rlSetBlendFactors :: proc(glSrcFactor, glDstFactor, glEquation: c.int) --- // Set blending mode factor and equation (using OpenGL factors)
|
|
|
+
|
|
|
+ rlClearColor :: proc(r, g, b, a: u8) --- // Clear color buffer with color
|
|
|
+ rlClearScreenBuffers :: proc() --- // Clear used screen buffers (color and depth)
|
|
|
+ rlCheckErrors :: proc() --- // Check and log OpenGL error codes
|
|
|
+ rlSetBlendMode :: proc(mode: c.int) --- // Set blending mode
|
|
|
+ rlSetBlendFactors :: proc(glSrcFactor, glDstFactor, glEquation: c.int) --- // Set blending mode factor and equation (using OpenGL factors)
|
|
|
+ rlSetBlendFactorsSeparate :: proc(glSrcRGB, glDstRGB, glSrcAlpha, glDstAlpha, glEqRGB, glEqAlpha: c.int) --- // Set blending mode factors and equations separately (using OpenGL factors)
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
// Functions Declaration - rlgl functionality
|
|
|
//------------------------------------------------------------------------------------
|
|
|
// rlgl initialization functions
|
|
|
- rlglInit :: proc(width, height: c.int) --- // Initialize rlgl (buffers, shaders, textures, states)
|
|
|
- rlglClose :: proc() --- // De-inititialize rlgl (buffers, shaders, textures)
|
|
|
- rlLoadExtensions :: proc(loader: rawptr) --- // Load OpenGL extensions (loader function pointer required)
|
|
|
- rlGetVersion :: proc() -> GlVersion --- // Returns current OpenGL version
|
|
|
- rlGetFramebufferWidth :: proc() -> c.int --- // Get default framebuffer width
|
|
|
- rlGetFramebufferHeight :: proc() -> c.int --- // Get default framebuffer height
|
|
|
+ rlglInit :: proc(width, height: c.int) --- // Initialize rlgl (buffers, shaders, textures, states)
|
|
|
+ rlglClose :: proc() --- // De-initialize rlgl (buffers, shaders, textures)
|
|
|
+ rlLoadExtensions :: proc(loader: rawptr) --- // Load OpenGL extensions (loader function required)
|
|
|
+ rlGetVersion :: proc() -> GlVersion --- // Get current OpenGL version
|
|
|
+ rlSetFramebufferWidth :: proc(width: c.int) --- // Set current framebuffer width
|
|
|
+ rlGetFramebufferWidth :: proc() -> c.int --- // Get default framebuffer width
|
|
|
+ rlSetFramebufferHeight :: proc(height: c.int) --- // Set current framebuffer height
|
|
|
+ rlGetFramebufferHeight :: proc() -> c.int --- // Get default framebuffer height
|
|
|
|
|
|
- rlGetTextureIdDefault :: proc() -> u32 --- // Get default texture id
|
|
|
- rlGetShaderIdDefault :: proc() -> u32 --- // Get default shader id
|
|
|
- rlGetShaderLocsDefault :: proc() -> [^]i32 --- // Get default shader locations
|
|
|
+
|
|
|
+ rlGetTextureIdDefault :: proc() -> c.uint --- // Get default texture id
|
|
|
+ rlGetShaderIdDefault :: proc() -> c.uint --- // Get default shader id
|
|
|
+ rlGetShaderLocsDefault :: proc() -> [^]c.int --- // Get default shader locations
|
|
|
|
|
|
// Render batch management
|
|
|
// NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode
|
|
|
// but this render batch API is exposed in case of custom batches are required
|
|
|
- rlLoadRenderBatch :: proc(numBuffers, bufferElements: c.int) -> RenderBatch --- // Load a render batch system
|
|
|
- rlUnloadRenderBatch :: proc(batch: RenderBatch) --- // Unload render batch system
|
|
|
- rlDrawRenderBatch :: proc(batch: ^RenderBatch) --- // Draw render batch data (Update->Draw->Reset)
|
|
|
- rlSetRenderBatchActive :: proc(batch: ^RenderBatch) --- // Set the active render batch for rlgl (NULL for default internal)
|
|
|
- rlDrawRenderBatchActive :: proc() --- // Update and draw internal render batch
|
|
|
- rlCheckRenderBatchLimit :: proc(vCount: c.int) -> bool --- // Check internal buffer overflow for a given number of vertex
|
|
|
- rlSetTexture :: proc(id: u32) --- // Set current texture for render batch and check buffers limits
|
|
|
+ rlLoadRenderBatch :: proc(numBuffers, bufferElements: c.int) -> RenderBatch --- // Load a render batch system
|
|
|
+ rlUnloadRenderBatch :: proc(batch: RenderBatch) --- // Unload render batch system
|
|
|
+ rlDrawRenderBatch :: proc(batch: ^RenderBatch) --- // Draw render batch data (Update->Draw->Reset)
|
|
|
+ rlSetRenderBatchActive :: proc(batch: ^RenderBatch) --- // Set the active render batch for rlgl (NULL for default internal)
|
|
|
+ rlDrawRenderBatchActive :: proc() --- // Update and draw internal render batch
|
|
|
+ rlCheckRenderBatchLimit :: proc(vCount: c.int) -> c.int --- // Check internal buffer overflow for a given number of vertex
|
|
|
+
|
|
|
+ rlSetTexture :: proc(id: c.uint) --- // Set current texture for render batch and check buffers limits
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
// Vertex buffers management
|
|
|
- rlLoadVertexArray :: proc() -> u32 --- // Load vertex array (vao) if supported
|
|
|
- rlLoadVertexBuffer :: proc(buffer: rawptr, size: c.int, is_dynamic: bool) -> u32 --- // Load a vertex buffer attribute
|
|
|
- rlLoadVertexBufferElement :: proc(buffer: rawptr, size: c.int, is_dynamic: bool) -> u32 --- // Load a new attributes element buffer
|
|
|
- rlUpdateVertexBuffer :: proc(bufferId: c.int, data: rawptr, dataSize: c.int, offset: c.int) -> u32 --- // Update GPU buffer with new data
|
|
|
- rlUnloadVertexArray :: proc(vaoId: u32) ---
|
|
|
- rlUnloadVertexBuffer :: proc(vboId: u32) ---
|
|
|
- rlSetVertexAttribute :: proc(index: u32, compSize: c.int, type: c.int, normalized: bool, stride: c.int, pointer: uintptr) ---
|
|
|
- rlSetVertexAttributeDivisor :: proc(index: u32, divisor: c.int) ---
|
|
|
- rlSetVertexAttributeDefault :: proc(locIndex: c.int, value: rawptr, attribType: c.int, count: c.int) --- // Set vertex attribute default value
|
|
|
+ rlLoadVertexArray :: proc() -> c.uint --- // Load vertex array (vao) if supported
|
|
|
+ rlLoadVertexBuffer :: proc(buffer: rawptr, size: c.int, is_dynamic: bool) -> c.uint --- // Load a vertex buffer attribute
|
|
|
+ rlLoadVertexBufferElement :: proc(buffer: rawptr, size: c.int, is_dynamic: bool) -> c.uint --- // Load a new attributes element buffer
|
|
|
+ rlUpdateVertexBuffer :: proc(bufferId: c.uint, data: rawptr, dataSize: c.int, offset: c.int) --- // Update GPU buffer with new data
|
|
|
+ rlUpdateVertexBufferElements :: proc(id: c.uint, data: rawptr, dataSize: c.int, offset: c.int) --- // Update vertex buffer elements with new data
|
|
|
+ rlUnloadVertexArray :: proc(vaoId: c.uint) ---
|
|
|
+ rlUnloadVertexBuffer :: proc(vboId: c.uint) ---
|
|
|
+ rlSetVertexAttribute :: proc(index: c.uint, compSize: c.int, type: c.int, normalized: bool, stride: c.int, pointer: rawptr) ---
|
|
|
+ rlSetVertexAttributeDivisor :: proc(index: c.uint, divisor: c.int) ---
|
|
|
+ rlSetVertexAttributeDefault :: proc(locIndex: c.int, value: rawptr, attribType: c.int, count: c.int) --- // Set vertex attribute default value
|
|
|
rlDrawVertexArray :: proc(offset: c.int, count: c.int) ---
|
|
|
rlDrawVertexArrayElements :: proc(offset: c.int, count: c.int, buffer: rawptr) ---
|
|
|
rlDrawVertexArrayInstanced :: proc(offset: c.int, count: c.int, instances: c.int) ---
|
|
|
rlDrawVertexArrayElementsInstanced :: proc(offset: c.int, count: c.int, buffer: rawptr, instances: c.int) ---
|
|
|
|
|
|
// Textures management
|
|
|
- rlLoadTexture :: proc(data: rawptr, width, height: c.int, format: c.int, mipmapCount: c.int) -> u32 --- // Load texture in GPU
|
|
|
- rlLoadTextureDepth :: proc(width, height: c.int, useRenderBuffer: bool) -> u32 --- // Load depth texture/renderbuffer (to be attached to fbo)
|
|
|
- rlLoadTextureCubemap :: proc(data: rawptr, size: c.int, format: c.int) -> u32 --- // Load texture cubemap
|
|
|
- rlUpdateTexture :: proc(id: u32, offsetX, offsetY, width, height: c.int, format: c.int, data: rawptr) --- // Update GPU texture with new data
|
|
|
- rlGetGlTextureFormats :: proc(format: c.int, glInternalFormat: ^u32, glFormat: ^u32, glType: ^u32) --- // Get OpenGL internal formats
|
|
|
- rlGetPixelFormatName :: proc(format: PixelFormat) -> cstring --- // Get name string for pixel format
|
|
|
- rlUnloadTexture :: proc(id: u32) --- // Unload texture from GPU memory
|
|
|
- rlGenerateMipmaps :: proc(texture: ^Texture2D) --- // Generate mipmap data for selected texture
|
|
|
- rlReadTexturePixels :: proc(texture: Texture2D) -> rawptr --- // Read texture pixel data
|
|
|
- rlReadScreenPixels :: proc(width, height: c.int) -> [^]u8 --- // Read screen pixel data (color buffer)
|
|
|
+ rlLoadTexture :: proc(data: rawptr, width, height: c.int, format: c.int, mipmapCount: c.int) -> c.uint --- // Load texture in GPU
|
|
|
+ rlLoadTextureDepth :: proc(width, height: c.int, useRenderBuffer: bool) -> c.uint --- // Load depth texture/renderbuffer (to be attached to fbo)
|
|
|
+ rlLoadTextureCubemap :: proc(data: rawptr, size: c.int, format: c.int) -> c.uint --- // Load texture cubemap
|
|
|
+ rlUpdateTexture :: proc(id: c.uint, offsetX, offsetY: c.int, width, height: c.int, format: c.int, data: rawptr) --- // Update GPU texture with new data
|
|
|
+ rlGetGlTextureFormats :: proc(format: c.int, glInternalFormat, glFormat, glType: ^c.uint) --- // Get OpenGL internal formats
|
|
|
+ rlGetPixelFormatName :: proc(format: c.uint) -> cstring --- // Get name string for pixel format
|
|
|
+ rlUnloadTexture :: proc(id: c.uint) --- // Unload texture from GPU memory
|
|
|
+ rlGenTextureMipmaps :: proc(id: c.uint, width, height: c.int, format: c.int, mipmaps: ^c.int) --- // Generate mipmap data for selected texture
|
|
|
+ rlReadTexturePixels :: proc(id: c.uint, width, height: c.int, format: c.int) -> rawptr --- // Read texture pixel data
|
|
|
+ rlReadScreenPixels :: proc(width, height: c.int) -> [^]byte --- // Read screen pixel data (color buffer)
|
|
|
|
|
|
// Framebuffer management (fbo)
|
|
|
- rlLoadFramebuffer :: proc(width, height: c.int) -> u32 --- // Load an empty framebuffer
|
|
|
- rlFramebufferAttach :: proc(fboId: u32, texId: u32, attachType: c.int, texType: c.int, mipLevel: c.int) --- // Attach texture/renderbuffer to a framebuffer
|
|
|
- rlFramebufferComplete :: proc(id: u32) -> bool --- // Verify framebuffer is complete
|
|
|
- rlUnloadFramebuffer :: proc(id: u32) --- // Delete framebuffer from GPU
|
|
|
+ rlLoadFramebuffer :: proc(width, height: c.int) -> c.uint --- // Load an empty framebuffer
|
|
|
+ rlFramebufferAttach :: proc(fboId, texId: c.uint, attachType: c.int, texType: c.int, mipLevel: c.int) --- // Attach texture/renderbuffer to a framebuffer
|
|
|
+ rlFramebufferComplete :: proc(id: c.uint) -> bool --- // Verify framebuffer is complete
|
|
|
+ rlUnloadFramebuffer :: proc(id: c.uint) --- // Delete framebuffer from GPU
|
|
|
|
|
|
// Shaders management
|
|
|
- rlLoadShaderCode :: proc(vsCode, fsCode: cstring) -> u32 --- // Load shader from code strings
|
|
|
- rlCompileShader :: proc(shaderCode: cstring, type: c.int) -> u32 --- // Compile custom shader and return shader id (type: GL_VERTEX_SHADER, GL_FRAGMENT_SHADER)
|
|
|
- rlLoadShaderProgram :: proc(vShaderId, fShaderId: u32) -> u32 --- // Load custom shader program
|
|
|
- rlUnloadShaderProgram :: proc(id: u32) --- // Unload shader program
|
|
|
- rlGetLocationUniform :: proc(shaderId: u32, uniformName: cstring) -> c.int --- // Get shader location uniform
|
|
|
- rlGetLocationAttrib :: proc(shaderId: u32, attribName: cstring) -> c.int --- // Get shader location attribute
|
|
|
+ rlLoadShaderCode :: proc(vsCode, fsCode: cstring) -> c.uint --- // Load shader from code strings
|
|
|
+ rlCompileShader :: proc(shaderCode: cstring, type: c.int) -> c.uint --- // Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
|
|
|
+ rlLoadShaderProgram :: proc(vShaderId, fShaderId: c.uint) -> c.uint --- // Load custom shader program
|
|
|
+ rlUnloadShaderProgram :: proc(id: c.uint) --- // Unload shader program
|
|
|
+ rlGetLocationUniform :: proc(shaderId: c.uint, uniformName: cstring) -> c.int --- // Get shader location uniform
|
|
|
+ rlGetLocationAttrib :: proc(shaderId: c.uint, attribName: cstring) -> c.int --- // Get shader location attribute
|
|
|
rlSetUniform :: proc(locIndex: c.int, value: rawptr, uniformType: c.int, count: c.int) --- // Set shader value uniform
|
|
|
rlSetUniformMatrix :: proc(locIndex: c.int, mat: Matrix) --- // Set shader value matrix
|
|
|
- rlSetUniformSampler :: proc(locIndex: c.int, textureId: u32) --- // Set shader value sampler
|
|
|
- rlSetShader :: proc(shader: Shader) --- // Set shader currently active
|
|
|
+ rlSetUniformSampler :: proc(locIndex: c.int, textureId: c.uint) --- // Set shader value sampler
|
|
|
+ rlSetShader :: proc(id: c.uint, locs: [^]c.int) --- // Set shader currently active (id and locations)
|
|
|
|
|
|
// Compute shader management
|
|
|
- rlLoadComputeShaderProgram :: proc(shaderId: u32) -> u32 --- // Load compute shader program
|
|
|
- rlComputeShaderDispatch :: proc(groupX, groupY, groupZ: u32) --- // Dispatch compute shader (equivalent to *draw* for graphics pilepine)
|
|
|
+ rlLoadComputeShaderProgram :: proc(shaderId: c.uint) -> c.uint --- // Load compute shader program
|
|
|
+ rlComputeShaderDispatch :: proc(groupX, groupY, groupZ: c.uint) --- // Dispatch compute shader (equivalent to *draw* for graphics pipeline)
|
|
|
|
|
|
-
|
|
|
// Shader buffer storage object management (ssbo)
|
|
|
- rlLoadShaderBuffer :: proc(size: u64, data: rawptr, usageHint: c.int) -> u32 --- // Load shader storage buffer object (SSBO)
|
|
|
- rlUnloadShaderBuffer :: proc(ssboId: u32) --- // Unload shader storage buffer object (SSBO)
|
|
|
- rlUpdateShaderBufferElements :: proc(id: u32, data: rawptr, dataSize: u64, offset: u64) --- // Update SSBO buffer data
|
|
|
- rlGetShaderBufferSize :: proc(id: u32) -> u64 --- // Get SSBO buffer size
|
|
|
- rlReadShaderBufferElements :: proc(id: u32, dest: rawptr, count: u64, offset: u64) --- // Bind SSBO buffer
|
|
|
- rlBindShaderBuffer :: proc(id: u32, index: u32) --- // Copy SSBO buffer data
|
|
|
+ rlLoadShaderBuffer :: proc(size: c.uint, data: rawptr, usageHint: c.int) -> c.uint --- // Load shader storage buffer object (SSBO)
|
|
|
+ rlUnloadShaderBuffer :: proc(ssboId: c.uint) --- // Unload shader storage buffer object (SSBO)
|
|
|
+ rlUpdateShaderBuffer :: proc(id: c.uint, data: rawptr, dataSize: c.uint, offset: c.uint) --- // Update SSBO buffer data
|
|
|
+ rlBindShaderBuffer :: proc(id: c.uint, index: c.uint) --- // Bind SSBO buffer
|
|
|
+ rlReadShaderBuffer :: proc(id: c.uint, dest: rawptr, count: c.uint, offset: c.uint) --- // Read SSBO buffer data (GPU->CPU)
|
|
|
+ rlCopyShaderBuffer :: proc(destId, srcId: c.uint, destOffset, srcOffset: c.uint, count: c.uint) --- // Copy SSBO data between buffers
|
|
|
+ rlGetShaderBufferSize :: proc(id: c.uint) -> c.uint --- // Get SSBO buffer size
|
|
|
|
|
|
// Buffer management
|
|
|
- rlCopyBuffersElements :: proc(destId, srcId: u32, destOffset, srcOffset: u64, count: u64) --- // Copy SSBO buffer data
|
|
|
- rlBindImageTexture :: proc(id: u32, index: u32, format: u32, readonly: b32) --- // Bind image texture
|
|
|
-
|
|
|
+ rlBindImageTexture :: proc(id: c.uint, index: c.uint, format: c.int, readonly: bool) --- // Bind image texture
|
|
|
|
|
|
// Matrix state management
|
|
|
rlGetMatrixModelview :: proc() -> Matrix --- // Get internal modelview matrix
|