├── .editorconfig
├── .gitignore
├── .vscode
├── settings.json
└── vapi.code-snippets
├── LICENCE.md
├── README.md
├── data
└── raylib-vapi.png
├── examples
├── Camera3D
│ ├── Main.vala
│ └── meson.build
├── Physac
│ ├── Main.vala
│ └── meson.build
└── SmoothPixel
│ ├── Main.vala
│ └── meson.build
├── meson.build
├── vala-lint.conf
└── vapi
├── raylib.vapi
├── rini.vapi
└── rlgl.vapi
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | [*]
7 | indent_style = space
8 | indent_size = 4
9 | end_of_line = lf
10 | charset = utf-8
11 | trim_trailing_whitespace = true
12 | insert_final_newline = true
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 | misc/
3 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "C_Cpp.default.compileCommands": "build/vscode_compile_commands.json"
3 | }
4 |
--------------------------------------------------------------------------------
/.vscode/vapi.code-snippets:
--------------------------------------------------------------------------------
1 | {
2 | // Place your raylib-vapi workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3 | // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4 | // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5 | // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6 | // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7 | // Placeholders with the same ids are connected.
8 | // Example:
9 | // "Print to console": {
10 | // "scope": "javascript,typescript",
11 | // "prefix": "log",
12 | // "body": [
13 | // "console.log('$1');",
14 | // "$2"
15 | // ],
16 | // "description": "Log output to console"
17 | // }
18 |
19 | "CCode": {
20 | "scope": "vapi,vala",
21 | "prefix": "ccode",
22 | "body": "[CCode (cname = \"$1\")]$0"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/LICENCE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2022 Alex Macafee (@lxmcf)
2 |
3 | This software is provided "as-is", without any express or implied warranty. In no event
4 | will the authors be held liable for any damages arising from the use of this software.
5 |
6 | Permission is granted to anyone to use this software for any purpose, including commercial
7 | applications, and to alter it and redistribute it freely, subject to the following restrictions:
8 |
9 | 1. The origin of this software must not be misrepresented; you must not claim that you
10 | wrote the original software. If you use this software in a product, an acknowledgment
11 | in the product documentation would be appreciated but is not required.
12 |
13 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented
14 | as being the original software.
15 |
16 | 3. This notice may not be removed or altered from any source distribution.
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |

2 |
3 | # Raylib VAPI
4 |
5 | Bindings for [Vala](https://vala.dev/) to use the simple and easy to use graphics library [Raylib](https://github.com/raysan5/raylib).
6 |
7 | ## Description
8 | Ralib VAPI currently supports the core module of Raylib using a C style API for ease of code porting.
9 |
10 | Some VAPI's will be released to follow a more [OOP design](https://en.wikipedia.org/wiki/Object-oriented_programming) as well if you wish to use them in a more traditional Vala style.
11 |
12 | ## Supported Modules
13 |
14 | | Module | Supported | OOP Available | VAPI Name | Version |
15 | |:-------:|:------------------:|:------------------:|:-----------:|:-------:|
16 | | raylib | :heavy_check_mark: | :construction: | raylib.vapi | 5.0 |
17 | | rlgl | :heavy_check_mark: | :x: | rlgl.vapi | 4.5 |
18 | | raymath | :x: | :x: | | |
19 | | raudio | :x: | :x: | | |
20 | | raygui | :x: | :x: | | |
21 | | rpng | :x: | :x: | | |
22 | | rini | :heavy_check_mark: | :x: | rini.vapi | 1.0 |
23 | | rres | :x: | :x: | | |
24 |
25 | ## Example
26 | ```vala
27 | using Raylib;
28 |
29 | public const int WINDOW_WIDTH = 800;
30 | public const int WINDOW_HEIGHT = 450;
31 |
32 | public static int main (string[] args) {
33 | init_window (WINDOW_WIDTH, WINDOW_HEIGHT, "raylib [core] example - basic window");
34 |
35 | set_target_fps (60);
36 |
37 | while (!window_should_close ()) {
38 | begin_drawing ();
39 | clear_background (RAYWHITE);
40 |
41 | draw_text ("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
42 | end_drawing ();
43 | }
44 |
45 | close_window ();
46 |
47 | return 0;
48 | }
49 | ```
50 |
51 | ## Compiling Included Examples
52 | ```bash
53 | cd examples
54 |
55 | meson build -C build
56 |
57 | cd build/
58 |
59 | Camera3D/application # To run the 3D camera example
60 | # or
61 | SmoothPixel/application # To run the smooth pixel perfect example
62 | ```
63 |
--------------------------------------------------------------------------------
/data/raylib-vapi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lxmcf/raylib-vapi/80c136d4bdd619a4846ce423c76053c9c215cbd6/data/raylib-vapi.png
--------------------------------------------------------------------------------
/examples/Camera3D/Main.vala:
--------------------------------------------------------------------------------
1 | using Raylib;
2 |
3 | public const int MAX_COLUMNS = 20;
4 | public const int SCREEN_WIDTH = 800;
5 | public const int SCREEN_HEIGHT = 450;
6 |
7 | public static int main (string[] args) {
8 | init_window (SCREEN_WIDTH, SCREEN_HEIGHT, "raylib [core] example - 3d camera first person");
9 |
10 | Camera camera = { };
11 | camera.position = { 4.0f, 2.0f, 4.0f };
12 | camera.target = { 0.0f, 1.8f, 0.0f };
13 | camera.up = { 0.0f, 1.0f, 0.0f };
14 | camera.fovy = 60.0f;
15 | camera.projection = CameraProjection.PERSPECTIVE;
16 |
17 | float heights[MAX_COLUMNS];
18 | Vector3 positions[MAX_COLUMNS];
19 | Color colors[MAX_COLUMNS];
20 |
21 | for (int i = 0; i < MAX_COLUMNS; i++) {
22 | heights[i] = (float)get_random_value (1, 12);
23 | positions[i] = { (float)get_random_value (-15, 15), heights[i] / 2.0f, (float)get_random_value (-15, 15) };
24 | colors[i] = { (uchar)get_random_value (20, 255), (uchar)get_random_value (10, 55), 30, 255 };
25 | }
26 |
27 | set_target_fps (60);
28 |
29 | // Main game loop
30 | while (!window_should_close ()) {
31 | update_camera (camera, CameraMode.FIRST_PERSON);
32 |
33 | begin_drawing ();
34 |
35 | clear_background (RAYWHITE);
36 |
37 | begin_mode_3D (camera);
38 |
39 | draw_plane ({ 0.0f, 0.0f, 0.0f }, { 32.0f, 32.0f }, { 200, 200, 200, 255 });
40 | draw_cube ({ -16.0f, 2.5f, 0.0f }, 1.0f, 5.0f, 32.0f, BLUE);
41 | draw_cube ({ 16.0f, 2.5f, 0.0f }, 1.0f, 5.0f, 32.0f, LIME);
42 | draw_cube ({ 0.0f, 2.5f, 16.0f }, 32.0f, 5.0f, 1.0f, GOLD);
43 |
44 | // Draw some cubes around
45 | for (int i = 0; i < MAX_COLUMNS; i++) {
46 | draw_cube (positions[i], 2.0f, heights[i], 2.0f, colors[i]);
47 | draw_cube_wires (positions[i], 2.0f, heights[i], 2.0f, MAROON);
48 | }
49 |
50 | end_mode_3D ();
51 |
52 | draw_rectangle ( 10, 10, 220, 70, fade (SKYBLUE, 0.5f));
53 | draw_rectangle_lines ( 10, 10, 220, 70, BLUE);
54 |
55 | draw_text ("First person camera default controls:", 20, 20, 10, BLACK);
56 | draw_text ("- Move with keys: W, A, S, D", 40, 40, 10, DARKGRAY);
57 | draw_text ("- Mouse move to look around", 40, 60, 10, DARKGRAY);
58 |
59 | end_drawing ();
60 | }
61 |
62 | close_window ();
63 |
64 | return 0;
65 | }
66 |
--------------------------------------------------------------------------------
/examples/Camera3D/meson.build:
--------------------------------------------------------------------------------
1 | executable (
2 | 'application',
3 |
4 | 'Main.vala',
5 |
6 | dependencies: project_dependency
7 | )
8 |
--------------------------------------------------------------------------------
/examples/Physac/Main.vala:
--------------------------------------------------------------------------------
1 | using Raylib;
2 | using Physac;
3 |
4 | public const int WINDOW_WIDTH = 800;
5 | public const int WINDOW_HEIGHT = 450;
6 |
7 | public static int main (string[] args) {
8 | init_window (WINDOW_WIDTH, WINDOW_HEIGHT, "raylib [core] example - basic window");
9 |
10 | init_physics ();
11 |
12 | PhysicsBody floor = create_physics_body_rectangle ({ WINDOW_WIDTH / 2, WINDOW_HEIGHT }, 500.0f, 100.0f, 10);
13 | floor.enabled = false;
14 |
15 | PhysicsBody circle = create_physics_body_circle ({ WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2 }, 45.0f, 10.0f);
16 | circle.enabled = false;
17 |
18 | set_target_fps (60);
19 |
20 | while (!window_should_close ()) {
21 | int body_count = get_physics_bodies_count ();
22 |
23 | for (int i = body_count - 1; i >= 0; i--) {
24 | PhysicsBody? body = get_physics_body (i);
25 |
26 | if ((body != null) && body.position.y > WINDOW_HEIGHT * 2) {
27 | destroy_physics_body (body);
28 | }
29 | }
30 |
31 | begin_drawing ();
32 | clear_background (RAYWHITE);
33 |
34 | draw_text ("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
35 | end_drawing ();
36 | }
37 |
38 | close_physics ();
39 |
40 | close_window ();
41 |
42 | return 0;
43 | }
44 |
--------------------------------------------------------------------------------
/examples/Physac/meson.build:
--------------------------------------------------------------------------------
1 | executable (
2 | 'application',
3 |
4 | 'Main.vala',
5 |
6 | dependencies: project_dependency
7 | )
8 |
--------------------------------------------------------------------------------
/examples/SmoothPixel/Main.vala:
--------------------------------------------------------------------------------
1 | using Raylib;
2 |
3 | public const int SCREEN_WIDTH = 800;
4 | public const int SCREEN_HEIGHT = 450;
5 |
6 | public const int VIRTUAL_SCREEN_WIDTH = 160;
7 | public const int VIRTUAL_SCREEN_HEIGHT = 90;
8 |
9 | const float VIRTUAL_RATIO = (float)SCREEN_WIDTH / (float)VIRTUAL_SCREEN_WIDTH;
10 |
11 | public static int main () {
12 | init_window (SCREEN_WIDTH, SCREEN_HEIGHT, "raylib [core] example - smooth pixel-perfect camera");
13 |
14 | Camera2D world_space_camera = { };
15 | world_space_camera.zoom = 1.0f;
16 |
17 | Camera2D screen_space_camera = { };
18 | screen_space_camera.zoom = 1.0f;
19 |
20 | RenderTexture2D target = load_render_texture (VIRTUAL_SCREEN_WIDTH, VIRTUAL_SCREEN_HEIGHT);
21 |
22 | Rectangle rec01 = { 70.0f, 35.0f, 20.0f, 20.0f };
23 | Rectangle rec02 = { 90.0f, 55.0f, 30.0f, 10.0f };
24 | Rectangle rec03 = { 80.0f, 65.0f, 15.0f, 25.0f };
25 |
26 | Rectangle source_rectangle = { 0.0f, 0.0f, target.texture.width, -target.texture.height };
27 | Rectangle destination_rectangle = { -VIRTUAL_RATIO, -VIRTUAL_RATIO, SCREEN_WIDTH + (VIRTUAL_RATIO * 2), SCREEN_HEIGHT + (VIRTUAL_RATIO * 2) };
28 |
29 | Vector2 origin = { 0.0f, 0.0f };
30 |
31 | float rotation = 0.0f;
32 | float time = 0.0f;
33 |
34 | float camera_x = 0.0f;
35 | float camera_y = 0.0f;
36 |
37 | set_target_fps (60);
38 |
39 | // Main game loop
40 | while (!window_should_close ()) {
41 | rotation += 60.0f * get_frame_time ();
42 |
43 | time = (float)get_time ();
44 |
45 | camera_x = (sinf (time) * 50.0f) - 10.0f;
46 | camera_y = cosf (time) * 30.0f;
47 |
48 | screen_space_camera.target = { camera_x, camera_y };
49 |
50 | world_space_camera.target.x = (int)screen_space_camera.target.x;
51 | screen_space_camera.target.x -= world_space_camera.target.x;
52 | screen_space_camera.target.x *= VIRTUAL_RATIO;
53 |
54 | world_space_camera.target.y = (int)screen_space_camera.target.y;
55 | screen_space_camera.target.y -= world_space_camera.target.y;
56 | screen_space_camera.target.y *= VIRTUAL_RATIO;
57 |
58 | begin_texture_mode (target);
59 | clear_background (RAYWHITE);
60 |
61 | begin_mode_2D (world_space_camera);
62 | draw_rectangle_pro (rec01, origin, rotation, BLACK);
63 | draw_rectangle_pro (rec02, origin, -rotation, RED);
64 | draw_rectangle_pro (rec03, origin, rotation + 45.0f, BLUE);
65 | end_mode_2D ();
66 | end_texture_mode();
67 |
68 | begin_drawing ();
69 | clear_background (RED);
70 |
71 | begin_mode_2D (screen_space_camera);
72 | draw_texture_pro (target.texture, source_rectangle, destination_rectangle, origin, 0.0f, WHITE);
73 | end_mode_2D ();
74 |
75 | draw_text (@"Screen resolution: $(SCREEN_WIDTH)x$(SCREEN_HEIGHT)", 10, 10, 20, DARKBLUE);
76 | draw_text (@"World resolution: $(VIRTUAL_SCREEN_WIDTH)x$(VIRTUAL_SCREEN_HEIGHT)", 10, 40, 20, DARKGREEN);
77 | draw_fps ( get_screen_width () - 95, 10);
78 | end_drawing ();
79 | }
80 |
81 | unload_render_texture (target);
82 |
83 | close_window ();
84 |
85 | return 0;
86 | }
87 |
--------------------------------------------------------------------------------
/examples/SmoothPixel/meson.build:
--------------------------------------------------------------------------------
1 | executable (
2 | 'application',
3 |
4 | 'Main.vala',
5 |
6 | dependencies: project_dependency
7 | )
8 |
--------------------------------------------------------------------------------
/meson.build:
--------------------------------------------------------------------------------
1 | project ('Raylib-vala', [ 'vala', 'c' ], version: '4.2')
2 |
3 | # Variables
4 | source_dir = meson.current_source_dir ()
5 | vapi_dir = source_dir / 'vapi'
6 |
7 | # Build variables
8 | project_dependency = []
9 |
10 | # Compilers
11 | valac = meson.get_compiler ('vala')
12 | cc = meson.get_compiler ('c')
13 |
14 | # Compiler arguments
15 | valac_arguments = [
16 | '--vapidir', vapi_dir,
17 | '--profile=posix'
18 | ]
19 |
20 | cc_arguments = [
21 | '-DPHYSAC_IMPLEMENTATION'
22 | ]
23 |
24 | add_project_arguments (valac_arguments, language: 'vala')
25 | add_project_arguments (cc_arguments, language: 'c')
26 |
27 | project_dependency = [
28 | valac.find_library ('raylib', dirs: vapi_dir),
29 | valac.find_library ('rlgl', dirs: vapi_dir),
30 | valac.find_library ('physac', dirs: vapi_dir),
31 |
32 | cc.find_library ('raylib'),
33 | cc.find_library ('m')
34 | ]
35 |
36 | subdir ('examples/Camera3D')
37 | subdir ('examples/SmoothPixel')
38 | subdir ('examples/Physac')
39 |
--------------------------------------------------------------------------------
/vala-lint.conf:
--------------------------------------------------------------------------------
1 | [Checks]
2 | block-opening-brace-space-before=error
3 | double-semicolon=error
4 | double-spaces=error
5 | ellipsis=error
6 | line-length=warn
7 | naming-convention=null
8 | no-space=error
9 | note=warn
10 | space-before-paren=error
11 | use-of-tabs=error
12 | trailing-newlines=error
13 | trailing-whitespace=error
14 | unnecessary-string-template=error
15 |
16 | [Disabler]
17 | disable-by-inline-comments=true
18 |
19 | [line-length]
20 | max-line-length=120
21 | ignore-comments=true
22 |
23 | [naming-convention]
24 | exceptions=UUID,vertexCount,vertexData
25 |
26 | [note]
27 | keywords=
28 |
--------------------------------------------------------------------------------
/vapi/raylib.vapi:
--------------------------------------------------------------------------------
1 | [CCode (cprefix = "", cheader_filename = "raylib.h")]
2 | namespace Raylib {
3 | [CCode (cname = "RAYLIB_VERSION_MAJOR")]
4 | public const string VERSION_MAJOR;
5 |
6 | [CCode (cname = "RAYLIB_VERSION_MINOR")]
7 | public const string VERSION_MINOR;
8 |
9 | [CCode (cname = "RAYLIB_VERSION_PATCH")]
10 | public const string VERSION_PATCH;
11 |
12 | [CCode (cname = "RAYLIB_VERSION")]
13 | public const string VERSION;
14 |
15 | //----------------------------------------------------------------------------------
16 | // Some basic Defines
17 | //----------------------------------------------------------------------------------
18 | [CCode (cname = "PI")]
19 | public const float PI;
20 |
21 | [CCode (cname = "DEG2RAD")]
22 | public const float DEG2RAD;
23 |
24 | [CCode (cname = "RAD2DEG")]
25 | public const float RAD2DEG;
26 |
27 | // Some Basic Colors
28 | // NOTE: Custom raylib color palette for amazing visuals on WHITE background
29 | [CCode (cname = "LIGHTGRAY")]
30 | public const Color LIGHTGRAY;
31 |
32 | [CCode (cname = "GRAY")]
33 | public const Color GRAY;
34 |
35 | [CCode (cname = "DARKGRAY")]
36 | public const Color DARKGRAY;
37 |
38 | [CCode (cname = "YELLOW")]
39 | public const Color YELLOW;
40 |
41 | [CCode (cname = "GOLD")]
42 | public const Color GOLD;
43 |
44 | [CCode (cname = "ORANGE")]
45 | public const Color ORANGE;
46 |
47 | [CCode (cname = "PINK")]
48 | public const Color PINK;
49 |
50 | [CCode (cname = "RED")]
51 | public const Color RED;
52 |
53 | [CCode (cname = "MAROON")]
54 | public const Color MAROON;
55 |
56 | [CCode (cname = "GREEN")]
57 | public const Color GREEN;
58 |
59 | [CCode (cname = "LIME")]
60 | public const Color LIME;
61 |
62 | [CCode (cname = "DARKGREEN")]
63 | public const Color DARKGREEN;
64 |
65 | [CCode (cname = "SKYBLUE")]
66 | public const Color SKYBLUE;
67 |
68 | [CCode (cname = "BLUE")]
69 | public const Color BLUE;
70 |
71 | [CCode (cname = "DARKBLUE")]
72 | public const Color DARKBLUE;
73 |
74 | [CCode (cname = "PURPLE")]
75 | public const Color PURPLE;
76 |
77 | [CCode (cname = "VIOLET")]
78 | public const Color VIOLET;
79 |
80 | [CCode (cname = "DARKPURPLE")]
81 | public const Color DARKPURPLE;
82 |
83 | [CCode (cname = "BEIGE")]
84 | public const Color BEIGE;
85 |
86 | [CCode (cname = "BROWN")]
87 | public const Color BROWN;
88 |
89 |
90 | [CCode (cname = "DARKBROWN")]
91 | public const Color DARKBROWN;
92 |
93 | [CCode (cname = "WHITE")]
94 | public const Color WHITE;
95 |
96 | [CCode (cname = "BLACK")]
97 | public const Color BLACK;
98 |
99 | [CCode (cname = "BLANK")]
100 | public const Color BLANK;
101 |
102 | [CCode (cname = "MAGENTA")]
103 | public const Color MAGENTA;
104 |
105 | [CCode (cname = "RAYWHITE")]
106 | public const Color RAYWHITE;
107 |
108 | //----------------------------------------------------------------------------------
109 | // Structures Definition
110 | //----------------------------------------------------------------------------------
111 | [SimpleType]
112 | [CCode (cname = "Vector2")]
113 | public struct Vector2 {
114 | public float x;
115 | public float y;
116 | }
117 |
118 | [SimpleType]
119 | [CCode (cname = "Vector3")]
120 | public struct Vector3 {
121 | public float x;
122 | public float y;
123 | public float z;
124 | }
125 |
126 | [SimpleType]
127 | [CCode (cname = "Vector4")]
128 | public struct Vector4 {
129 | public float x;
130 | public float y;
131 | public float z;
132 | public float w;
133 | }
134 |
135 | [SimpleType]
136 | [CCode (cname = "Quaternion")]
137 | public struct Quaternion {
138 | public float x;
139 | public float y;
140 | public float z;
141 | public float w;
142 | }
143 |
144 | [SimpleType]
145 | [CCode (cname = "Matrix")]
146 | public struct Matrix {
147 | public float m0;
148 | public float m4;
149 | public float m8;
150 | public float m12;
151 |
152 | public float m1;
153 | public float m5;
154 | public float m9;
155 | public float m13;
156 |
157 | public float m2;
158 | public float m6;
159 | public float m10;
160 | public float m14;
161 |
162 | public float m3;
163 | public float m7;
164 | public float m11;
165 | public float m15;
166 | }
167 |
168 | [SimpleType]
169 | [CCode (cname = "Color")]
170 | public struct Color {
171 | public uchar r;
172 | public uchar g;
173 | public uchar b;
174 | public uchar a;
175 | }
176 |
177 | [SimpleType]
178 | [CCode (cname = "Rectangle")]
179 | public struct Rectangle {
180 | public float x;
181 | public float y;
182 | public float width;
183 | public float height;
184 | }
185 |
186 | [SimpleType]
187 | [CCode (cname = "Image")]
188 | public struct Image {
189 | void* data;
190 |
191 | int width;
192 | int height;
193 | int mipmaps;
194 |
195 | PixelFormat format;
196 | }
197 |
198 | [SimpleType]
199 | [CCode (cname = "Texture")]
200 | public struct Texture {
201 | public uint id; // OpenGL texture id
202 | public int width; // Texture base width
203 | public int height; // Texture base height
204 | public int mipmaps; // Mipmap levels, 1 by default
205 |
206 | public PixelFormat format; // Data format (PixelFormat type)
207 | }
208 |
209 | [SimpleType]
210 | [CCode (cname = "Texture2D")]
211 | public struct Texture2D {
212 | public uint id; // OpenGL texture id
213 | public int width; // Texture base width
214 | public int height; // Texture base height
215 | public int mipmaps; // Mipmap levels, 1 by default
216 |
217 | public PixelFormat format; // Data format (PixelFormat type)
218 | }
219 |
220 | [SimpleType]
221 | [CCode (cname = "TextureCubemap")]
222 | public struct TextureCubemap {
223 | public uint id; // OpenGL texture id
224 | public int width; // Texture base width
225 | public int height; // Texture base height
226 | public int mipmaps; // Mipmap levels, 1 by default
227 |
228 | public PixelFormat format; // Data format (PixelFormat type)
229 | }
230 |
231 | [SimpleType]
232 | [CCode (cname = "RenderTexture")]
233 | public struct RenderTexture {
234 | public uint id; // OpenGL framebuffer object id
235 |
236 | public unowned Texture2D texture; // Color buffer attachment texture
237 | public unowned Texture2D depth; // Depth buffer attachment texture
238 | }
239 |
240 | [SimpleType]
241 | [CCode (cname = "RenderTexture2D")]
242 | public struct RenderTexture2D : RenderTexture {
243 | public uint id; // OpenGL framebuffer object id
244 |
245 | public unowned Texture2D texture; // Color buffer attachment texture
246 | public unowned Texture2D depth; // Depth buffer attachment texture
247 | }
248 |
249 | [SimpleType]
250 | [CCode (cname = "NPatchInfo")]
251 | public struct NPatchInfo {
252 | public unowned Rectangle source; // Texture source rectangle
253 |
254 | public int left; // Left border offset
255 | public int top; // Top border offset
256 | public int right; // Right border offset
257 | public int bottom; // Bottom border offset
258 | public int layout; // Layout of the n-patch: 3x3, 1x3 or 3x1
259 | }
260 |
261 | [SimpleType]
262 | [CCode (cname = "GlyphInfo")]
263 | public struct GlyphInfo {
264 | public int value; // Character value (Unicode)
265 | public int offsetX; // Character offset X when drawing // vala-lint=naming-convention
266 | public int offsetY; // Character offset Y when drawing // vala-lint=naming-convention
267 | public int advanceX; // Character advance position X // vala-lint=naming-convention
268 |
269 | public unowned Image image; // Character image data
270 | }
271 |
272 | [SimpleType]
273 | [CCode (cname = "Font")]
274 | public struct Font {
275 | public int baseSize; // Base size (default chars height) // vala-lint=naming-convention
276 | public int glyphCount; // Number of glyph characters // vala-lint=naming-convention
277 | public int glyphPadding; // Padding around the glyph characters // vala-lint=naming-convention
278 |
279 | public unowned Texture2D texture; // Texture atlas containing the glyphs
280 | public unowned Rectangle[] recs; // Rectangles in texture for the glyphs
281 | public unowned GlyphInfo[] glyphs; // Glyphs info data
282 | }
283 |
284 | [SimpleType]
285 | [CCode (cname = "Camera3D")]
286 | public struct Camera3D {
287 | public unowned Vector3 position; // Camera position
288 | public unowned Vector3 target; // Camera target it looks-at
289 | public unowned Vector3 up; // Camera up vector (rotation over its axis)
290 |
291 | public float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
292 | public int projection; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
293 | }
294 |
295 | [SimpleType]
296 | [CCode (cname = "Camera")]
297 | public struct Camera : Camera3D {
298 | public unowned Vector3 position; // Camera position
299 | public unowned Vector3 target; // Camera target it looks-at
300 | public unowned Vector3 up; // Camera up vector (rotation over its axis)
301 |
302 | public float fovy; // Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic
303 | public int projection; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
304 | }
305 |
306 | [SimpleType]
307 | [CCode (cname = "Camera2D")]
308 | public struct Camera2D {
309 | public unowned Vector2 offset; // Camera offset (displacement from target)
310 | public unowned Vector2 target; // Camera target (rotation and zoom origin)
311 |
312 | public float rotation; // Camera rotation in degrees
313 | public float zoom; // Camera zoom (scaling), should be 1.0f by default
314 | }
315 |
316 | [SimpleType]
317 | [CCode (cname = "Mesh")]
318 | public struct Mesh {
319 | public int vertexCount; // Number of vertices stored in arrays // vala-lint=naming-convention
320 | public int triangleCount; // Number of triangles stored (indexed or not) // vala-lint=naming-convention
321 |
322 | // Vertex attributes data
323 | public unowned float[] vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
324 | public unowned float[] texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
325 | public unowned float[] texcoords2; // Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
326 | public unowned float[] normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
327 | public unowned float[] tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
328 | public unowned uchar[] colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
329 | public unowned ushort[] indices; // Vertex indices (in case vertex data comes indexed)
330 |
331 | // Animation vertex data
332 | public unowned float[] animVertices; // Animated vertex positions (after bones transformations) // vala-lint=naming-convention
333 | public unowned float[] animNormals; // Animated normals (after bones transformations) // vala-lint=naming-convention
334 | public unowned uchar[] boneIds; // Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) // vala-lint=naming-convention
335 | public unowned float[] boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) // vala-lint=naming-convention
336 |
337 | // OpenGL identifiers
338 | public uint vaoId; // OpenGL Vertex Array Object id // vala-lint=naming-convention
339 | public unowned uint[] vboId; // OpenGL Vertex Buffer Objects id (default vertex data) // vala-lint=naming-convention
340 | }
341 |
342 | [SimpleType]
343 | [CCode (cname = "Shader")]
344 | public struct Shader {
345 | public uint id; // Shader program id
346 | public unowned int[] locs; // Shader locations array (RL_MAX_SHADER_LOCATIONS)
347 | }
348 |
349 | [SimpleType]
350 | [CCode (cname = "MaterialMap")]
351 | public struct MaterialMap {
352 | unowned Texture2D texture; // Material map texture
353 | Color color; // Material map color
354 |
355 | float value; // Material map value
356 | }
357 |
358 | [SimpleType]
359 | [CCode (cname = "Material")]
360 | public struct Material {
361 | unowned Shader shader; // Material shader
362 | unowned MaterialMap[] maps; // Material maps array (MAX_MATERIAL_MAPS)
363 | float @params[4]; // Material generic parameters (if required)
364 | }
365 |
366 | [SimpleType]
367 | [CCode (cname = "Transform")]
368 | public struct Transform {
369 | public Vector3 translation; // Translation
370 | public Quaternion rotation; // Rotation
371 | public Vector3 scale; // Scale
372 | }
373 |
374 | [SimpleType]
375 | [CCode (cname = "BoneInfo")]
376 | public struct BoneInfo {
377 | public unowned string name; // Bone name
378 | public int parent; // Bone parent
379 | }
380 |
381 | [SimpleType]
382 | [CCode (cname = "Model")]
383 | public struct Model {
384 | public Matrix transform; // Local transform matrix
385 |
386 | public int meshCount; // Number of meshes // vala-lint=naming-convention
387 | public int materialCount; // Number of materials // vala-lint=naming-convention
388 | public unowned Mesh[] meshes; // Meshes array
389 | public unowned Material[] materials; // Materials array
390 | public unowned int[] meshMaterial; // Mesh material number // vala-lint=naming-convention
391 |
392 | // Animation data
393 | public int boneCount; // Number of bones // vala-lint=naming-convention
394 | public unowned BoneInfo[] bones; // Bones information (skeleton)
395 | public unowned Transform[] bindPose; // Bones base transformation (pose) // vala-lint=naming-convention
396 | }
397 |
398 | [SimpleType]
399 | [CCode (cname = "ModelAnimation")]
400 | public struct ModelAnimation {
401 | public int boneCount; // Number of bones // vala-lint=naming-convention
402 | public int frameCount; // Number of animation frames // vala-lint=naming-convention
403 | public unowned BoneInfo[] bones; // Bones information (skeleton)
404 | public unowned Transform[,] framePoses; // Poses array by frame // vala-lint=naming-convention
405 | public char name[32]; // Animation name
406 | }
407 |
408 | [SimpleType]
409 | [CCode (cname = "Ray")]
410 | public struct Ray {
411 | public Vector3 position; // Ray position (origin)
412 | public Vector3 direction; // Ray direction
413 | }
414 |
415 | [SimpleType]
416 | [CCode (cname = "RayCollision")]
417 | public struct RayCollision {
418 | public bool hit; // Did the ray hit something?
419 | public float distance; // Distance to nearest hit
420 | public Vector3 point; // Point of nearest hit
421 | public Vector3 normal; // Surface normal of hit
422 | }
423 |
424 | [SimpleType]
425 | [CCode (cname = "BoundingBox")]
426 | public struct BoundingBox {
427 | public Vector3 min; // Minimum vertex box-corner
428 | public Vector3 max; // Maximum vertex box-corner
429 | }
430 |
431 | [SimpleType]
432 | [CCode (cname = "Wave")]
433 | public struct Wave {
434 | public uint frameCount; // Total number of frames (considering channels) // vala-lint=naming-convention
435 | public uint sampleRate; // Frequency (samples per second) // vala-lint=naming-convention
436 | public uint sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) // vala-lint=naming-convention
437 | public uint channels; // Number of channels (1-mono, 2-stereo, ...)
438 | public void *data; // Buffer data pointer
439 | }
440 |
441 | [SimpleType]
442 | [CCode (cname = "rAudioBuffer")]
443 | public struct AudioBuffer { }
444 |
445 | [SimpleType]
446 | [CCode (cname = "rAudioProcessor")]
447 | public struct AudioProcessor { }
448 |
449 | [SimpleType]
450 | [CCode (cname = "AudioStream")]
451 | public struct AudioStream {
452 | public AudioBuffer buffer; // Pointer to internal data used by the audio system
453 | public AudioProcessor processor; // Pointer to internal data processor, useful for audio effects
454 |
455 | public uint sampleRate; // Frequency (samples per second) // vala-lint=naming-convention
456 | public uint sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) // vala-lint=naming-convention
457 | public uint channels; // Number of channels (1-mono, 2-stereo, ...)
458 | }
459 |
460 | [SimpleType]
461 | [CCode (cname = "Sound")]
462 | public struct Sound {
463 | public AudioStream stream; // Audio stream
464 | public uint frameCount; // Total number of frames (considering channels) // vala-lint=naming-convention
465 | }
466 |
467 | [SimpleType]
468 | [CCode (cname = "Music")]
469 | public struct Music {
470 | public AudioStream stream; // Audio stream
471 | public uint frameCount; // Total number of frames (considering channels) // vala-lint=naming-convention
472 | public bool looping; // Music looping enable
473 |
474 | public int ctxType; // Type of music context (audio filetype) // vala-lint=naming-convention
475 | public void* ctxData; // Audio context data, depends on type // vala-lint=naming-convention
476 | }
477 |
478 | [SimpleType]
479 | [CCode (cname = "VrDeviceInfo")]
480 | public struct VrDeviceInfo {
481 | public int hResolution; // Horizontal resolution in pixels // vala-lint=naming-convention
482 | public int vResolution; // Vertical resolution in pixels // vala-lint=naming-convention
483 | public float hScreenSize; // Horizontal size in meters // vala-lint=naming-convention
484 | public float vScreenSize; // Vertical size in meters // vala-lint=naming-convention
485 | public float vScreenCenter; // Screen center in meters // vala-lint=naming-convention
486 | public float eyeToScreenDistance; // Distance between eye and display in meters // vala-lint=naming-convention
487 | public float lensSeparationDistance; // Lens separation distance in meters // vala-lint=naming-convention
488 | public float interpupillaryDistance; // IPD (distance between pupils) in meters // vala-lint=naming-convention
489 | public float lensDistortionValues[4]; // Lens distortion constant parameters // vala-lint=naming-convention
490 | public float chromaAbCorrection[4]; // Chromatic aberration correction parameters // vala-lint=naming-convention
491 | }
492 |
493 | [SimpleType]
494 | [CCode (cname = "VrStereoConfig")]
495 | public struct VrStereoConfig {
496 | public Matrix projection[2]; // VR projection matrices (per eye)
497 | public Matrix viewOffset[2]; // VR view offset matrices (per eye) // vala-lint=naming-convention
498 | public float leftLensCenter[2]; // VR left lens center // vala-lint=naming-convention
499 | public float rightLensCenter[2]; // VR right lens center // vala-lint=naming-convention
500 | public float leftScreenCenter[2]; // VR left screen center // vala-lint=naming-convention
501 | public float rightScreenCenter[2]; // VR right screen center // vala-lint=naming-convention
502 | public float scale[2]; // VR distortion scale
503 | public float scaleIn[2]; // VR distortion scale in // vala-lint=naming-convention
504 | }
505 |
506 | [SimpleType]
507 | [CCode (cname = "FilePathList")]
508 | public struct FilePathList {
509 | public uint capacity; // Filepaths max entries
510 | public uint count; // Filepaths entries count
511 | public unowned string[] paths; // Filepaths entries
512 | }
513 |
514 | [SimpleType]
515 | [CCode (cname = "AutomationEvent")]
516 | public struct AutomationEvent {
517 | public uint frame; // Event frame
518 | public uint type; // Event type (AutomationEventType)
519 | public int @params[4]; // Event parameters (if required)
520 | }
521 |
522 | [SimpleType]
523 | [CCode (cname = "AutomationEventList")]
524 | public struct AutomationEventList {
525 | public uint capacity; // Events max entries (MAX_AUTOMATION_EVENTS)
526 | public uint count; // Events entries count
527 | public unowned AutomationEvent[] events; // Events entries
528 | }
529 |
530 | [Flags]
531 | [CCode (cname = "ConfigFlags", cprefix = "FLAG_", has_type_id = false)]
532 | public enum ConfigFlags {
533 | VSYNC_HINT, // Set to try enabling V-Sync on GPU
534 | FULLSCREEN_MODE, // Set to run program in fullscreen
535 | WINDOW_RESIZABLE, // Set to allow resizable window
536 | WINDOW_UNDECORATED, // Set to disable window decoration (frame and buttons)
537 | WINDOW_HIDDEN, // Set to hide window
538 | WINDOW_MINIMIZED, // Set to minimize window (iconify)
539 | WINDOW_MAXIMIZED, // Set to maximize window (expanded to monitor)
540 | WINDOW_UNFOCUSED, // Set to window non focused
541 | WINDOW_TOPMOST, // Set to window always on top
542 | WINDOW_ALWAYS_RUN, // Set to allow windows running while minimized
543 | WINDOW_TRANSPARENT, // Set to allow transparent framebuffer
544 | WINDOW_HIGHDPI, // Set to support HighDPI
545 | WINDOW_MOUSE_PASSTHROUGH, // Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
546 | BORDERLESS_WINDOWED_MODE, // Set to run program in borderless windowed mode
547 | MSAA_4X_HINT, // Set to try enabling MSAA 4X
548 | INTERLACED_HINT // Set to try enabling interlaced video format (for V3D)
549 | }
550 |
551 | [CCode (cname = "TraceLogLevel", cprefix = "LOG_", has_type_id = false)]
552 | public enum TraceLogLevel {
553 | ALL, // Display all logs
554 | TRACE, // Trace logging, intended for internal use only
555 | DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds
556 | INFO, // Info logging, used for program execution info
557 | WARNING, // Warning logging, used on recoverable failures
558 | ERROR, // Error logging, used on unrecoverable failures
559 | FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE)
560 | NONE // Disable logging
561 | }
562 |
563 | [CCode (cname = "KeyboardKey", cprefix = "KEY_", has_type_id = false)]
564 | public enum KeyboardKey {
565 | NULL, // Key: NULL, used for no key pressed
566 | // Alphanumeric keys
567 | APOSTROPHE, // Key: '
568 | COMMA, // Key: ,
569 | MINUS, // Key: -
570 | PERIOD, // Key: .
571 | SLASH, // Key: /
572 | ZERO, // Key: 0
573 | ONE, // Key: 1
574 | TWO, // Key: 2
575 | THREE, // Key: 3
576 | FOUR, // Key: 4
577 | FIVE, // Key: 5
578 | SIX, // Key: 6
579 | SEVEN, // Key: 7
580 | EIGHT, // Key: 8
581 | NINE, // Key: 9
582 | SEMICOLON, // Key: ;
583 | EQUAL, // Key: =
584 | A, // Key: A | a
585 | B, // Key: B | b
586 | C, // Key: C | c
587 | D, // Key: D | d
588 | E, // Key: E | e
589 | F, // Key: F | f
590 | G, // Key: G | g
591 | H, // Key: H | h
592 | I, // Key: I | i
593 | J, // Key: J | j
594 | K, // Key: K | k
595 | L, // Key: L | l
596 | M, // Key: M | m
597 | N, // Key: N | n
598 | O, // Key: O | o
599 | P, // Key: P | p
600 | Q, // Key: Q | q
601 | R, // Key: R | r
602 | S, // Key: S | s
603 | T, // Key: T | t
604 | U, // Key: U | u
605 | V, // Key: V | v
606 | W, // Key: W | w
607 | X, // Key: X | x
608 | Y, // Key: Y | y
609 | Z, // Key: Z | z
610 | LEFT_BRACKET, // Key: [
611 | BACKSLASH, // Key: '\'
612 | RIGHT_BRACKET, // Key: ]
613 | GRAVE, // Key: `
614 | // Function keys
615 | SPACE, // Key: Space
616 | ESCAPE, // Key: Esc
617 | ENTER, // Key: Enter
618 | TAB, // Key: Tab
619 | BACKSPACE, // Key: Backspace
620 | INSERT, // Key: Ins
621 | DELETE, // Key: Del
622 | RIGHT, // Key: Cursor right
623 | LEFT, // Key: Cursor left
624 | DOWN, // Key: Cursor down
625 | UP, // Key: Cursor up
626 | PAGE_UP, // Key: Page up
627 | PAGE_DOWN, // Key: Page down
628 | HOME, // Key: Home
629 | END, // Key: End
630 | CAPS_LOCK, // Key: Caps lock
631 | SCROLL_LOCK, // Key: Scroll down
632 | NUM_LOCK, // Key: Num lock
633 | PRINT_SCREEN, // Key: Print screen
634 | PAUSE, // Key: Pause
635 | F1, // Key: F1
636 | F2, // Key: F2
637 | F3, // Key: F3
638 | F4, // Key: F4
639 | F5, // Key: F5
640 | F6, // Key: F6
641 | F7, // Key: F7
642 | F8, // Key: F8
643 | F9, // Key: F9
644 | F10, // Key: F10
645 | F11, // Key: F11
646 | F12, // Key: F12
647 | LEFT_SHIFT, // Key: Shift left
648 | LEFT_CONTROL, // Key: Control left
649 | LEFT_ALT, // Key: Alt left
650 | LEFT_SUPER, // Key: Super left
651 | RIGHT_SHIFT, // Key: Shift right
652 | RIGHT_CONTROL, // Key: Control right
653 | RIGHT_ALT, // Key: Alt right
654 | RIGHT_SUPER, // Key: Super right
655 | KB_MENU, // Key: KB menu
656 | // Keypad keys
657 | KP_0, // Key: Keypad 0
658 | KP_1, // Key: Keypad 1
659 | KP_2, // Key: Keypad 2
660 | KP_3, // Key: Keypad 3
661 | KP_4, // Key: Keypad 4
662 | KP_5, // Key: Keypad 5
663 | KP_6, // Key: Keypad 6
664 | KP_7, // Key: Keypad 7
665 | KP_8, // Key: Keypad 8
666 | KP_9, // Key: Keypad 9
667 | KP_DECIMAL, // Key: Keypad .
668 | KP_DIVIDE, // Key: Keypad /
669 | KP_MULTIPLY, // Key: Keypad *
670 | KP_SUBTRACT, // Key: Keypad -
671 | KP_ADD, // Key: Keypad +
672 | KP_ENTER, // Key: Keypad Enter
673 | KP_EQUAL, // Key: Keypad =
674 | // Android key buttons
675 | BACK, // Key: Android back button
676 | MENU, // Key: Android menu button
677 | VOLUME_UP, // Key: Android volume up button
678 | VOLUME_DOWN // Key: Android volume down button
679 | }
680 |
681 | [CCode (cname = "MouseButton", cprefix = "MOUSE_BUTTON_", has_type_id = false)]
682 | public enum MouseButton {
683 | LEFT, // Mouse button left
684 | RIGHT, // Mouse button right
685 | MIDDLE, // Mouse button middle (pressed wheel)
686 | SIDE, // Mouse button side (advanced mouse device)
687 | EXTRA, // Mouse button extra (advanced mouse device)
688 | FORWARD, // Mouse button fordward (advanced mouse device)
689 | BACK, // Mouse button back (advanced mouse device)
690 | }
691 |
692 | [CCode (cname = "MouseCursor", cprefix = "MOUSE_CURSOR_", has_type_id = false)]
693 | public enum MouseCursor {
694 | DEFAULT, // Default pointer shape
695 | ARROW, // Arrow shape
696 | IBEAM, // Text writing cursor shape
697 | CROSSHAIR, // Cross shape
698 | POINTING_HAND, // Pointing hand cursor
699 | RESIZE_EW, // Horizontal resize/move arrow shape
700 | RESIZE_NS, // Vertical resize/move arrow shape
701 | RESIZE_NWSE, // Top-left to bottom-right diagonal resize/move arrow shape
702 | RESIZE_NESW, // The top-right to bottom-left diagonal resize/move arrow shape
703 | RESIZE_ALL, // The omni-directional resize/move cursor shape
704 | NOT_ALLOWED // The operation-not-allowed shape
705 | }
706 |
707 | [CCode (cname = "GamepadButton", cprefix = "GAMEPAD_BUTTON_", has_type_id = false)]
708 | public enum GamepadButton {
709 | UNKNOWN, // Unknown button, just for error checking
710 | LEFT_FACE_UP, // Gamepad left DPAD up button
711 | LEFT_FACE_RIGHT, // Gamepad left DPAD right button
712 | LEFT_FACE_DOWN, // Gamepad left DPAD down button
713 | LEFT_FACE_LEFT, // Gamepad left DPAD left button
714 | RIGHT_FACE_UP, // Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)
715 | RIGHT_FACE_RIGHT, // Gamepad right button right (i.e. PS3: Square, Xbox: X)
716 | RIGHT_FACE_DOWN, // Gamepad right button down (i.e. PS3: Cross, Xbox: A)
717 | RIGHT_FACE_LEFT, // Gamepad right button left (i.e. PS3: Circle, Xbox: B)
718 | LEFT_TRIGGER_1, // Gamepad top/back trigger left (first), it could be a trailing button
719 | LEFT_TRIGGER_2, // Gamepad top/back trigger left (second), it could be a trailing button
720 | RIGHT_TRIGGER_1, // Gamepad top/back trigger right (one), it could be a trailing button
721 | RIGHT_TRIGGER_2, // Gamepad top/back trigger right (second), it could be a trailing button
722 | MIDDLE_LEFT, // Gamepad center buttons, left one (i.e. PS3: Select)
723 | MIDDLE, // Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)
724 | MIDDLE_RIGHT, // Gamepad center buttons, right one (i.e. PS3: Start)
725 | LEFT_THUMB, // Gamepad joystick pressed button left
726 | RIGHT_THUMB // Gamepad joystick pressed button right
727 | }
728 |
729 | [CCode (cname = "GamepadAxis", cprefix = "GAMEPAD_AXIS_", has_type_id = false)]
730 | public enum GamepadAxis {
731 | LEFT_X, // Gamepad left stick X axis
732 | LEFT_Y, // Gamepad left stick Y axis
733 | RIGHT_X, // Gamepad right stick X axis
734 | RIGHT_Y, // Gamepad right stick Y axis
735 | LEFT_TRIGGER, // Gamepad back trigger left, pressure level: [1..-1]
736 | RIGHT_TRIGGER // Gamepad back trigger right, pressure level: [1..-1]
737 | }
738 |
739 | [CCode (cname = "MaterialMapIndex", cprefix = "MATERIAL_MAP_", has_type_id = false)]
740 | public enum MaterialMapIndex {
741 | ALBEDO, // Albedo material (same as: MATERIAL_MAP_DIFFUSE)
742 | METALNESS, // Metalness material (same as: MATERIAL_MAP_SPECULAR)
743 | NORMAL, // Normal material
744 | ROUGHNESS, // Roughness material
745 | OCCLUSION, // Ambient occlusion material
746 | EMISSION, // Emission material
747 | HEIGHT, // Heightmap material
748 | CUBEMAP, // Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
749 | IRRADIANCE, // Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
750 | PREFILTER, // Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
751 | BRDF
752 | }
753 |
754 | [CCode (cname = "ShaderUniformDataType", cprefix = "SHADER_UNIFORM_", has_type_id = false)]
755 | public enum ShaderUniformDataType {
756 | FLOAT, // Shader uniform type: float
757 | VEC2, // Shader uniform type: vec2 (2 float)
758 | VEC3, // Shader uniform type: vec3 (3 float)
759 | VEC4, // Shader uniform type: vec4 (4 float)
760 | INT, // Shader uniform type: int
761 | IVEC2, // Shader uniform type: ivec2 (2 int)
762 | IVEC3, // Shader uniform type: ivec3 (3 int)
763 | IVEC4, // Shader uniform type: ivec4 (4 int)
764 | SAMPLER2D // Shader uniform type: sampler2d
765 | }
766 |
767 | [CCode (cname = "ShaderAttributeDataType", cprefix = "SHADER_ATTRIB_", has_type_id = false)]
768 | public enum ShaderAttributeDataType {
769 | FLOAT, // Shader attribute type: float
770 | VEC2, // Shader attribute type: vec2 (2 float)
771 | VEC3, // Shader attribute type: vec3 (3 float)
772 | VEC4 // Shader attribute type: vec4 (4 float)
773 | }
774 |
775 | [CCode (cname = "PixelFormat", cprefix = "PIXELFORMAT_", has_type_id = false)]
776 | public enum PixelFormat {
777 | UNCOMPRESSED_GRAYSCALE, // 8 bit per pixel (no alpha)
778 | UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels)
779 | UNCOMPRESSED_R5G6B5, // 16 bpp
780 | UNCOMPRESSED_R8G8B8, // 24 bpp
781 | UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha)
782 | UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha)
783 | UNCOMPRESSED_R8G8B8A8, // 32 bpp
784 | UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
785 | UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
786 | UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
787 | UNCOMPRESSED_R16, // 16 bpp (1 channel - half float)
788 | UNCOMPRESSED_R16G16B16, // 16*3 bpp (3 channels - half float)
789 | UNCOMPRESSED_R16G16B16A16, // 16*4 bpp (4 channels - half float)
790 | COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
791 | COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
792 | COMPRESSED_DXT3_RGBA, // 8 bpp
793 | COMPRESSED_DXT5_RGBA, // 8 bpp
794 | COMPRESSED_ETC1_RGB, // 4 bpp
795 | COMPRESSED_ETC2_RGB, // 4 bpp
796 | COMPRESSED_ETC2_EAC_RGBA, // 8 bpp
797 | COMPRESSED_PVRT_RGB, // 4 bpp
798 | COMPRESSED_PVRT_RGBA, // 4 bpp
799 | COMPRESSED_ASTC_4x4_RGBA, // 8 bpp // vala-lint=naming-convention
800 | COMPRESSED_ASTC_8x8_RGBA // 2 bpp // vala-lint=naming-convention
801 | }
802 |
803 | [CCode (cname = "TextureFilter", cprefix = "TEXTURE_FILTER_", has_type_id = false)]
804 | public enum TextureFilter {
805 | POINT, // No filter, just pixel approximation
806 | BILINEAR, // Linear filtering
807 | TRILINEAR, // Trilinear filtering (linear with mipmaps)
808 | ANISOTROPIC_4X, // Anisotropic filtering 4x
809 | ANISOTROPIC_8X, // Anisotropic filtering 8x
810 | ANISOTROPIC_16X, // Anisotropic filtering 16x
811 | }
812 |
813 | [CCode (cname = "TextureWrap", cprefix = "TEXTURE_WRAP_", has_type_id = false)]
814 | public enum TextureWrap {
815 | REPEAT, // Repeats texture in tiled mode
816 | CLAMP, // Clamps texture to edge pixel in tiled mode
817 | MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode
818 | MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode
819 | }
820 |
821 | [CCode (cname = "CubemapLayout", cprefix = "CUBEMAP_LAYOUT_", has_type_id = false)]
822 | public enum CubemapLayout {
823 | AUTO_DETECT, // Automatically detect layout type
824 | LINE_VERTICAL, // Layout is defined by a vertical line with faces
825 | LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces
826 | CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces
827 | CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces
828 | PANORAMA // Layout is defined by a panorama image (equirectangular map)
829 | }
830 |
831 | [CCode (cname = "FontType", cprefix = "FONT_", has_type_id = false)]
832 | public enum FontType {
833 | DEFAULT, // Default font generation, anti-aliased
834 | BITMAP, // Bitmap font generation, no anti-aliasing
835 | SDF // SDF font generation, requires external shader
836 | }
837 |
838 | [CCode (cname = "BlendMode", cprefix = "BLEND_", has_type_id = false)]
839 | public enum BlendMode {
840 | ALPHA, // Blend textures considering alpha (default)
841 | ADDITIVE, // Blend textures adding colors
842 | MULTIPLIED, // Blend textures multiplying colors
843 | ADD_COLORS, // Blend textures adding colors (alternative)
844 | SUBTRACT_COLORS, // Blend textures subtracting colors (alternative)
845 | ALPHA_PREMULTIPLY, // Blend premultiplied textures considering alpha
846 | CUSTOM, // Blend textures using custom src/dst factors (use rlSetBlendMode())
847 | BLEND_CUSTOM_SEPARATE // Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())
848 | }
849 |
850 | [Flags]
851 | [CCode (cname = "Gesture", cprefix = "GESTURE_", has_type_id = false)]
852 | public enum Gesture {
853 | NONE, // No gesture
854 | TAP, // Tap gesture
855 | DOUBLETAP, // Double tap gesture
856 | HOLD, // Hold gesture
857 | DRAG, // Drag gesture
858 | SWIPE_RIGHT, // Swipe right gesture
859 | SWIPE_LEFT, // Swipe left gesture
860 | SWIPE_UP, // Swipe up gesture
861 | SWIPE_DOWN, // Swipe down gesture
862 | PINCH_IN, // Pinch in gesture
863 | PINCH_OUT // Pinch out gesture
864 | }
865 |
866 | [CCode (cname = "CameraMode", cprefix = "CAMERA_", has_type_id = false)]
867 | public enum CameraMode {
868 | CUSTOM, // Custom camera
869 | FREE, // Free camera
870 | ORBITAL, // Orbital camera
871 | FIRST_PERSON, // First person camera
872 | THIRD_PERSON // Third person camera
873 | }
874 |
875 | [CCode (cname = "CameraProjection", cprefix = "CAMERA_", has_type_id = false)]
876 | public enum CameraProjection {
877 | PERSPECTIVE, // Perspective projection
878 | ORTHOGRAPHIC // Orthographic projection
879 | }
880 |
881 | [CCode (cname = "NPatchLayout", cprefix = "NPATCH_", has_type_id = false)]
882 | public enum NPatchLayout {
883 | NINE_PATCH, // Npatch layout: 3x3 tiles
884 | THREE_PATCH_VERTICAL, // Npatch layout: 1x3 tiles
885 | THREE_PATCH_HORIZONTAL // Npatch layout: 3x1 tiles
886 | }
887 |
888 | // Callbacks to hook some internal functions
889 | // WARNING: This callbacks are intended for advance users
890 | [CCode (cname = "TraceLogCallback")]
891 | public delegate void TraceLogCallback (TraceLogLevel log_level, string text, va_list args);
892 |
893 | [CCode (cname = "LoadFileDataCallback")]
894 | public delegate uchar LoadFileDataCallback (string filename, out int bytes_read);
895 |
896 | [CCode (cname = "SaveFileDataCallback")]
897 | public delegate bool SaveFileDataCallback (string filename, void* data, int bytes_to_write);
898 |
899 | [CCode (cname = "LoadFileTextCallback")]
900 | public delegate char LoadFileTextCallback (string filename);
901 |
902 | [CCode (cname = "SaveFileTextCallback")]
903 | public delegate bool SaveFileTextCallback (string filename, string text);
904 |
905 | //------------------------------------------------------------------------------------
906 | // Window and Graphics Device Functions (Module: core)
907 | //------------------------------------------------------------------------------------
908 |
909 | // Window-related functions
910 | [CCode (cname = "InitWindow")]
911 | public static void init_window (int width, int height, string title);
912 |
913 | [CCode (cname = "WindowShouldClose")]
914 | public static bool window_should_close ();
915 |
916 | [CCode (cname = "CloseWindow")]
917 | public static void close_window ();
918 |
919 | [CCode (cname = "IsWindowReady")]
920 | public static bool is_window_ready ();
921 |
922 | [CCode (cname = "IsWindowFullscreen")]
923 | public static bool is_window_fullscreen ();
924 |
925 | [CCode (cname = "IsWindowHidden")]
926 | public static bool is_window_hidden ();
927 |
928 | [CCode (cname = "IsWindowMinimized")]
929 | public static bool is_window_minimized ();
930 |
931 | [CCode (cname = "IsWindowMaximized")]
932 | public static bool is_window_maximized ();
933 |
934 | [CCode (cname = "IsWindowFocused")]
935 | public static bool is_window_focused ();
936 |
937 | [CCode (cname = "IsWindowResized")]
938 | public static bool is_window_resized ();
939 |
940 | [CCode (cname = "IsWindowState")]
941 | public static bool is_window_state (ConfigFlags flag);
942 |
943 | [CCode (cname = "SetWindowState")]
944 | public static void set_window_state (ConfigFlags flags);
945 |
946 | [CCode (cname = "ClearWindowState")]
947 | public static void clear_window_state (ConfigFlags flags);
948 |
949 | [CCode (cname = "ToggleFullscreen")]
950 | public static void toggle_fullscreen ();
951 |
952 | [CCode (cname = "ToggleBorderlessWindowed")]
953 | public static void toggle_borderless ();
954 |
955 | [CCode (cname = "MaximizeWindow")]
956 | public static void maximise_window ();
957 |
958 | [CCode (cname = "MinimizeWindow")]
959 | public static void minimize_window ();
960 |
961 | [CCode (cname = "RestoreWindow")]
962 | public static void restore_window ();
963 |
964 | [CCode (cname = "SetWindowIcon")]
965 | public static void set_window_icon (Image image);
966 |
967 | [CCode (cname = "SetWindowIcons")]
968 | public static void set_window_icons (Image[] image);
969 |
970 | [CCode (cname = "SetWindowTitle")]
971 | public static void set_window_title (string title);
972 |
973 | [CCode (cname = "SetWindowPosition")]
974 | public static void set_window_position (int x, int y);
975 |
976 | [CCode (cname = "SetWindowMonitor")]
977 | public static void set_window_monitor (int monitor);
978 |
979 | [CCode (cname = "SetWindowMinSize")]
980 | public static void set_window_minimum_size (int width, int height);
981 |
982 | [CCode (cname = "SetWindowMaxSize")]
983 | public static void set_window_maximum_size (int width, int height);
984 |
985 | [CCode (cname = "SetWindowSize")]
986 | public static void set_window_size (int width, int height);
987 |
988 | [CCode (cname = "SetWindowOpacity")]
989 | public static void set_window_opacity (float opacity);
990 |
991 | [CCode (cname = "SetWindowFocused")]
992 | public static void set_window_focused ();
993 |
994 | [CCode (cname = "GetWindowHandle")]
995 | public static void* get_window_handle ();
996 |
997 | [CCode (cname = "GetScreenWidth")]
998 | public static int get_screen_width ();
999 |
1000 | [CCode (cname = "GetScreenHeight")]
1001 | public static int get_screen_height ();
1002 |
1003 | [CCode (cname = "GetRenderWidth")]
1004 | public static int get_render_width ();
1005 |
1006 | [CCode (cname = "GetRenderHeight")]
1007 | public static int get_render_height ();
1008 |
1009 | [CCode (cname = "GetCurrentMonitor")]
1010 | public static int get_current_monitor ();
1011 |
1012 | [CCode (cname = "GetMonitorPosition")]
1013 | public static Vector2 get_monitor_position (int monitor);
1014 |
1015 | [CCode (cname = "GetWindowPosition")]
1016 | public static Vector2 get_window_position ();
1017 |
1018 | [CCode (cname = "GetWindowScaleDPI")]
1019 | public static Vector2 get_window_scale_dpi ();
1020 |
1021 | [CCode (cname = "GetMonitorCount")]
1022 | public static int get_monitor_count ();
1023 |
1024 | [CCode (cname = "GetMonitorWidth")]
1025 | public static int get_monitor_width (int monitor);
1026 |
1027 | [CCode (cname = "GetMonitorHeight")]
1028 | public static int get_hmonitor_eight (int monitor);
1029 |
1030 | [CCode (cname = "GetMonitorPhysicalWidth")]
1031 | public static int get_monitor_physical_width (int monitor);
1032 |
1033 | [CCode (cname = "GetMonitorPhysicalHeight")]
1034 | public static int get_monitor_physical_height (int monitor);
1035 |
1036 | [CCode (cname = "GetMonitorRefreshRate")]
1037 | public static int get_monitor_refresh_rate (int monitor);
1038 |
1039 | [CCode (cname = "GetMonitorName")]
1040 | public static string get_monitor_name (int monitor);
1041 |
1042 | [CCode (cname = "SetClipboardText")]
1043 | public static void set_clipboard_text (string text);
1044 |
1045 | [CCode (cname = "GetClipboardText")]
1046 | public static string get_clipboard_text ();
1047 |
1048 | [CCode (cname = "EnableEventWaiting")]
1049 | public static void enable_event_waiting ();
1050 |
1051 | [CCode (cname = "DisableEventWaiting")]
1052 | public static void disable_event_waiting ();
1053 |
1054 | // Custom frame control functions
1055 | // NOTE: Those functions are intended for advance users that want full control over the frame processing
1056 | [CCode (cname = "SwapScreenBuffer")]
1057 | public static void swap_screen_buffer ();
1058 |
1059 | [CCode (cname = "PollInputEvents")]
1060 | public static void poll_input_events ();
1061 |
1062 | [CCode (cname = "WaitTime")]
1063 | public static void wait_time (double seconds);
1064 |
1065 | // Cursor-related functions
1066 | [CCode (cname = "ShowCursor")]
1067 | public static void show_cursor ();
1068 |
1069 | [CCode (cname = "HideCursor")]
1070 | public static void hide_cursor ();
1071 |
1072 | [CCode (cname = "IsCursorHidden")]
1073 | public static bool is_cursor_hidden ();
1074 |
1075 | [CCode (cname = "EnableCursor")]
1076 | public static void enable_cursor ();
1077 |
1078 | [CCode (cname = "DisableCursor")]
1079 | public static void disable_cursor ();
1080 |
1081 | [CCode (cname = "IsCursorOnScreen")]
1082 | public static bool is_cursor_on_screen ();
1083 |
1084 | // Drawing-related functions
1085 | [CCode (cname = "ClearBackground")]
1086 | public static void clear_background (Color color);
1087 |
1088 | [CCode (cname = "BeginDrawing")]
1089 | public static void begin_drawing ();
1090 |
1091 | [CCode (cname = "EndDrawing")]
1092 | public static void end_drawing ();
1093 |
1094 | [CCode (cname = "BeginMode2D")]
1095 | public static void begin_mode_2D (Camera2D camera); // vala-lint=naming-convention
1096 |
1097 | [CCode (cname = "EndMode2D")]
1098 | public static void end_mode_2D (); // vala-lint=naming-convention
1099 |
1100 | [CCode (cname = "BeginMode3D")]
1101 | public static void begin_mode_3D (Camera3D camera); // vala-lint=naming-convention
1102 |
1103 | [CCode (cname = "EndMode3D")]
1104 | public static void end_mode_3D (); // vala-lint=naming-convention
1105 |
1106 | [CCode (cname = "BeginTextureMode")]
1107 | public static void begin_texture_mode (RenderTexture2D target);
1108 |
1109 | [CCode (cname = "EndTextureMode")]
1110 | public static void end_texture_mode ();
1111 |
1112 | [CCode (cname = "BeginShaderMode")]
1113 | public static void begin_shader_mode (Shader shader);
1114 |
1115 | [CCode (cname = "EndShaderMode")]
1116 | public static void end_shader_mode ();
1117 |
1118 | [CCode (cname = "BeginBlendMode")]
1119 | public static void begin_blend_mode (BlendMode mode);
1120 |
1121 | [CCode (cname = "EndBlendMode")]
1122 | public static void end_blend_mode ();
1123 |
1124 | [CCode (cname = "BeginScissorMode")]
1125 | public static void begin_scissor_mode (int x, int y, int width, int height);
1126 |
1127 | [CCode (cname = "EndScissorMode")]
1128 | public static void end_scissor_mode ();
1129 |
1130 | [CCode (cname = "BeginVrStereoMode")]
1131 | public static void begin_vr_stereo_mode (VrStereoConfig config);
1132 |
1133 | [CCode (cname = "EndVrStereoMode")]
1134 | public static void end_vr_stereo_mode ();
1135 |
1136 | // VR stereo config functions for VR simulator
1137 | [CCode (cname = "LoadVrStereoConfig")]
1138 | public static VrStereoConfig load_vr_stereo_config (VrDeviceInfo device);
1139 |
1140 | [CCode (cname = "UnloadVrStereoConfig")]
1141 | public static void unload_vr_stereo_config (VrStereoConfig config);
1142 |
1143 | // Shader management functions
1144 | // NOTE: Shader functionality is not available on OpenGL 1.1
1145 | [CCode (cname = "LoadShader")]
1146 | public static Shader load_shader (string? vertex_filename, string? fragment_filename);
1147 |
1148 | [CCode (cname = "LoadShaderFromMemory")]
1149 | public static Shader load_shader_from_memory (string? vertex_shader, string? fragment_shader);
1150 |
1151 | [CCode (cname = "IsShaderReady")]
1152 | public static bool is_shader_ready (Shader shader);
1153 |
1154 | [CCode (cname = "GetShaderLocation")]
1155 | public int get_shader_location (Shader shader, string uniform_name);
1156 |
1157 | [CCode (cname = "GetShaderLocationAttrib")]
1158 | public int get_shader_location_attribute (Shader shader, string attribute_name);
1159 |
1160 | [CCode (cname = "SetShaderValue")]
1161 | public void set_shader_value (Shader shader, int location, void* value, ShaderUniformDataType type);
1162 |
1163 | [CCode (cname = "SetShaderValueV")]
1164 | public void set_shader_value_vector (Shader shader, int location, void* value, ShaderUniformDataType type, int count);
1165 |
1166 | [CCode (cname = "SetShaderValueMatrix")]
1167 | public void set_shader_value_matrix (Shader shader, int location, Matrix matrix);
1168 |
1169 | [CCode (cname = "SetShaderValueTexture")]
1170 | public void set_shader_value_texture (Shader shader, int location, Texture2D texture);
1171 |
1172 | [CCode (cname = "UnloadShader")]
1173 | public void unload_shader (Shader shader);
1174 |
1175 | // Screen-space-related functions
1176 | [CCode (cname = "GetMouseRay")]
1177 | public static Ray get_mouse_ray (Vector2 mouse_position, Camera camera);
1178 |
1179 | [CCode (cname = "GetCameraMatrix")]
1180 | public static Matrix get_camera_matrix (Camera camera);
1181 |
1182 | [CCode (cname = "GetCameraMatrix2D")]
1183 | public static Matrix get_camera_matrix_2D (Camera2D camera); // vala-lint=naming-convention
1184 |
1185 | [CCode (cname = "GetWorldToScreen")]
1186 | public static Vector2 get_world_to_screen (Vector3 position, Camera camera);
1187 |
1188 | [CCode (cname = "GetScreenToWorld2D")]
1189 | public static Vector2 get_screen_to_world_2D (Vector2 position, Camera2D camera); // vala-lint=naming-convention
1190 |
1191 | [CCode (cname = "GetWorldToScreenEx")]
1192 | public static Vector2 get_get_world_to_screen_ext (Vector3 position, Camera camera, int width, int height);
1193 |
1194 | [CCode (cname = "GetWorldToScreen2D")]
1195 | public static Vector2 get_world_to_screen_2D (Vector2 position, Camera2D camera); // vala-lint=naming-convention
1196 |
1197 | // Timing-related functions
1198 | [CCode (cname = "SetTargetFPS")]
1199 | public static void set_target_fps (int fps);
1200 |
1201 | [CCode (cname = "GetFPS")]
1202 | public static int get_fps ();
1203 |
1204 | [CCode (cname = "GetFrameTime")]
1205 | public static float get_frame_time ();
1206 |
1207 | [CCode (cname = "GetTime")]
1208 | public static double get_time ();
1209 |
1210 | // Misc. functions
1211 | [CCode (cname = "GetRandomValue")]
1212 | public static int get_random_value (int minimum, int maximum);
1213 |
1214 | [CCode (cname = "SetRandomSeed")]
1215 | public static void set_random_seed (uint seed);
1216 |
1217 | [CCode (cname = "TakeScreenshot")]
1218 | public static void take_screenshot (string filename);
1219 |
1220 | [CCode (cname = "SetConfigFlags")]
1221 | public static void set_config_flags (ConfigFlags flags);
1222 |
1223 |
1224 | [CCode (cname = "TraceLog")]
1225 | public static void trace_log (TraceLogLevel level, string text, ...);
1226 |
1227 | [CCode (cname = "SetTraceLogLevel")]
1228 | public static void set_trace_log_level (TraceLogLevel level);
1229 |
1230 | [CCode (cname = "MemAlloc")]
1231 | public static void* memory_allocate (uint size);
1232 |
1233 | [CCode (cname = "MemRealloc")]
1234 | public static void* memory_realocate (void* pointer, uint size);
1235 |
1236 | [CCode (cname = "MemFree")]
1237 | public static void memory_free (void* pointer);
1238 |
1239 |
1240 | [CCode (cname = "OpenURL")]
1241 | public static void open_url (string url);
1242 |
1243 | // Set custom callbacks
1244 | // WARNING: Callbacks setup is intended for advance users
1245 | [CCode (cname = "SetTraceLogCallback")]
1246 | public static void set_trace_log_callback (TraceLogCallback callback);
1247 |
1248 | [CCode (cname = "SetLoadFileDataCallback")]
1249 | public static void set_load_file_data_callback (LoadFileDataCallback callback);
1250 |
1251 | [CCode (cname = "SetSaveFileDataCallback")]
1252 | public static void set_save_file_data_callback (SaveFileDataCallback callback);
1253 |
1254 | [CCode (cname = "SetLoadFileTextCallback")]
1255 | public static void set_load_file_text_callback (LoadFileTextCallback callback);
1256 |
1257 | [CCode (cname = "SetSaveFileTextCallback")]
1258 | public static void set_save_file_text_callback (SaveFileTextCallback callback);
1259 |
1260 | // Files management functions
1261 | [CCode (cname = "LoadFileData")]
1262 | public static uchar[] load_file_data (string filename, out uint bytes_read);
1263 |
1264 | [CCode (cname = "UnloadFileData")]
1265 | public static void unload_file_data (uchar[] data);
1266 |
1267 | [CCode (cname = "SaveFileData")]
1268 | public static bool save_file_data (string filename, void* data, out uint bytes_to_write);
1269 |
1270 | [CCode (cname = "ExportDataAsCode")]
1271 | public static bool export_data_as_code (uchar[] data, string filename);
1272 |
1273 | [CCode (cname = "LoadFileText")]
1274 | public static string load_file_text (string filename);
1275 |
1276 | [CCode (cname = "UnloadFileText")]
1277 | public static void unload_file_text (string text);
1278 |
1279 | [CCode (cname = "SaveFileText")]
1280 | public static bool save_file_text (string filename, string text);
1281 |
1282 | [CCode (cname = "FileExists")]
1283 | public static bool file_exists (string filename);
1284 |
1285 | [CCode (cname = "DirectoryExists")]
1286 | public static bool directory_exists (string directory);
1287 |
1288 | [CCode (cname = "IsFileExtension")]
1289 | public static bool is_file_extension (string filename, string extension);
1290 |
1291 | [CCode (cname = "GetFileLength")]
1292 | public static int get_file_length (string filename);
1293 |
1294 | [CCode (cname = "GetFileExtension")]
1295 | public static string get_file_extension (string filename);
1296 |
1297 | [CCode (cname = "Getfilename")]
1298 | public static string get_filename (string file);
1299 |
1300 | [CCode (cname = "GetfilenameWithoutExt")]
1301 | public static string get_filename_without_extension (string file);
1302 |
1303 | [CCode (cname = "GetDirectoryPath")]
1304 | public static string get_directory_path (string file);
1305 |
1306 | [CCode (cname = "GetPrevDirectoryPath")]
1307 | public static string get_previous_directory_path (string directory);
1308 |
1309 | [CCode (cname = "GetWorkingDirectory")]
1310 | public static string get_work_directory ();
1311 |
1312 | [CCode (cname = "GetApplicationDirectory")]
1313 | public static string get_application_directory ();
1314 |
1315 | [CCode (cname = "ChangeDirectory")]
1316 | public static bool change_directory (string dir);
1317 |
1318 | [CCode (cname = "IsPathFile")]
1319 | public static bool is_path_file (string path);
1320 |
1321 | [CCode (cname = "LoadDirectoryFiles")]
1322 | public static FilePathList load_directory_files (string directory);
1323 |
1324 | [CCode (cname = "LoadDirectoryFilesEx")]
1325 | public static FilePathList load_directory_files_ext (string basePath, string filter, bool scan_sub_directories);
1326 |
1327 | [CCode (cname = "UnloadDirectoryFiles")]
1328 | public static void unload_directory_files (FilePathList files);
1329 |
1330 | [CCode (cname = "IsFileDropped")]
1331 | public static bool is_file_dropped ();
1332 |
1333 | [CCode (cname = "FilePathList")]
1334 | public static FilePathList load_dropped_files ();
1335 |
1336 | [CCode (cname = "UnloadDroppedFiles")]
1337 | public static void unload_dropped_files (FilePathList files);
1338 |
1339 | [CCode (cname = "GetFileModTime")]
1340 | public static long get_fil_modified_time (string filename);
1341 |
1342 | // Compression/Encoding functionality
1343 | [CCode (cname = "CompressData")]
1344 | public static uchar[] compress_data (uchar[] data, out int size);
1345 |
1346 | [CCode (cname = "DecompressData")]
1347 | public static uchar[] decompress_data (uchar[] compressed_data, out int size);
1348 |
1349 | [CCode (cname = "EncodeDataBase64")]
1350 | public static char[] encode_data_base64 (uchar[] data, out int size);
1351 |
1352 | [CCode (cname = "DecodeDataBase64")]
1353 | public static uchar[] decode_data_base64 (uchar[] data, out int size);
1354 |
1355 | // Automation events functionality
1356 | [CCode (cname = "LoadAutomationEventList")]
1357 | public static AutomationEventList load_automation_event_list (string filename); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
1358 |
1359 | [CCode (cname = "UnloadAutomationEventList")]
1360 | public static void unload_automation_event_list (AutomationEventList[] list); // Unload automation events list from file
1361 |
1362 | [CCode (cname = "ExportAutomationEventList")]
1363 | public static bool export_automation_event_list (AutomationEventList list, string filename); // Export automation events list as text file
1364 |
1365 | [CCode (cname = "SetAutomationEventList")]
1366 | public static void set_automation_event_list (AutomationEventList[] list); // Set automation event list to record to
1367 |
1368 | [CCode (cname = "SetAutomationEventBaseFrame")]
1369 | public static void set_automation_event_base_frame (int frame); // Set automation event internal base frame to start recording
1370 |
1371 | [CCode (cname = "StartAutomationEventRecording")]
1372 | public static void start_automation_event_recording (); // Start recording automation events (AutomationEventList must be set)
1373 |
1374 | [CCode (cname = "StopAutomationEventRecording")]
1375 | public static void stop_automation_event_recording (); // Stop recording automation events
1376 |
1377 | [CCode (cname = "PlayAutomationEvent")]
1378 | public static void play_automation_event (AutomationEvent event); // Play a recorded automation event
1379 |
1380 | //------------------------------------------------------------------------------------
1381 | // Input Handling Functions (Module: core)
1382 | //------------------------------------------------------------------------------------
1383 |
1384 | // Input-related functions: keyboard
1385 | [CCode (cname = "IsKeyPressed")]
1386 | public static bool is_key_pressed (KeyboardKey key);
1387 |
1388 | [CCode (cname = "IsKeyDown")]
1389 | public static bool is_key_down (KeyboardKey key);
1390 |
1391 | [CCode (cname = "IsKeyReleased")]
1392 | public static bool is_key_released (KeyboardKey key);
1393 |
1394 | [CCode (cname = "IsKeyPressedRepeat")]
1395 | public static bool is_key_pressed_repeat (Raylib.KeyboardKey key);
1396 |
1397 | [CCode (cname = "IsKeyUp")]
1398 | public static bool is_key_up (KeyboardKey key);
1399 |
1400 | [CCode (cname = "SetExitKey")]
1401 | public static void set_exit_key (KeyboardKey key);
1402 |
1403 | [CCode (cname = "GetKeyPressed")]
1404 | public static KeyboardKey get_key_pressed ();
1405 |
1406 | [CCode (cname = "GetCharPressed")]
1407 | public static int get_char_pressed ();
1408 |
1409 | // Input-related functions: gamepads
1410 | [CCode (cname = "IsGamepadAvailable")]
1411 | public static bool is_gamepad_available (int gamepad);
1412 |
1413 | [CCode (cname = "GetGamepadName")]
1414 | public static string get_gamepad_name (int gamepad);
1415 |
1416 | [CCode (cname = "IsGamepadButtonPressed")]
1417 | public static bool is_gamepad_button_pressed (int gamepad, GamepadButton button);
1418 |
1419 | [CCode (cname = "IsGamepadButtonDown")]
1420 | public static bool is_gamepad_button_down (int gamepad, GamepadButton button);
1421 |
1422 | [CCode (cname = "IsGamepadButtonReleased")]
1423 | public static bool is_gamepad_button_released (int gamepad, GamepadButton button);
1424 |
1425 | [CCode (cname = "IsGamepadButtonUp")]
1426 | public static bool is_gamepad_button_up (int gamepad, GamepadButton button);
1427 |
1428 | [CCode (cname = "GetGamepadButtonPressed")]
1429 | public static GamepadButton get_gamepad_button_pressed ();
1430 |
1431 | [CCode (cname = "GetGamepadAxisCount")]
1432 | public static int get_gamepad_axis_count (int gamepad);
1433 |
1434 | [CCode (cname = "GetGamepadAxisMovement")]
1435 | public static float get_gamepad_axis_movement (int gamepad, GamepadAxis axis);
1436 |
1437 | [CCode (cname = "SetGamepadMappings")]
1438 | public static int set_gamepad_mappings (string mappings);
1439 |
1440 | // Input-related functions: mouse
1441 | [CCode (cname = "IsMouseButtonPressed")]
1442 | public static bool is_mouse_button_pressed (MouseButton button);
1443 |
1444 | [CCode (cname = "IsMouseButtonDown")]
1445 | public static bool is_mouse_button_down (MouseButton button);
1446 |
1447 | [CCode (cname = "IsMouseButtonReleased")]
1448 | public static bool is_mouse_button_released (MouseButton button);
1449 |
1450 | [CCode (cname = "IsMouseButtonUp")]
1451 | public static bool is_mouse_button_up (MouseButton button);
1452 |
1453 | [CCode (cname = "GetMouseX")]
1454 | public static int get_mouse_x ();
1455 |
1456 | [CCode (cname = "GetMouseY")]
1457 | public static int get_mouse_y ();
1458 |
1459 | [CCode (cname = "GetMousePosition")]
1460 | public static Vector2 get_mouse_position ();
1461 |
1462 | [CCode (cname = "GetMouseDelta")]
1463 | public static Vector2 get_mouse_delta ();
1464 |
1465 | [CCode (cname = "SetMousePosition")]
1466 | public static void set_mouse_position (int x, int y);
1467 |
1468 | [CCode (cname = "SetMouseOffset")]
1469 | public static void set_mouse_offset (int offset_x, int offset_y);
1470 |
1471 | [CCode (cname = "SetMouseScale")]
1472 | public static void set_mouse_scale (float scale_x, float scale_y);
1473 |
1474 | [CCode (cname = "GetMouseWheelMove")]
1475 | public static float get_mouse_wheel_move ();
1476 |
1477 | [CCode (cname = "GetMouseWheelMoveV")]
1478 | public static Vector2 get_mouse_wheel_move_vector ();
1479 |
1480 | [CCode (cname = "SetMouseCursor")]
1481 | public static void set_mouse_cursor (MouseCursor cursor);
1482 |
1483 | // Input-related functions: touch
1484 | [CCode (cname = "GetTouchX")]
1485 | public static int get_touch_x ();
1486 |
1487 | [CCode (cname = "GetTouchY")]
1488 | public static int get_touch_y ();
1489 |
1490 | [CCode (cname = "GetTouchPosition")]
1491 | public static Vector2 get_touch_position (int index);
1492 |
1493 | [CCode (cname = "GetTouchPointId")]
1494 | public static int get_touch_point_id (int index);
1495 |
1496 | [CCode (cname = "GetTouchPointCount")]
1497 | public static int get_touch_point_count ();
1498 |
1499 | //------------------------------------------------------------------------------------
1500 | // Gestures and Touch Handling Functions (Module: rgestures)
1501 | //------------------------------------------------------------------------------------
1502 | [CCode (cname = "SetGestureEnabled")]
1503 | public static void set_gesture_enabled (Gesture flags);
1504 |
1505 | [CCode (cname = "IsGestureDetected")]
1506 | public static bool is_gesture_detected (Gesture gesture);
1507 |
1508 | [CCode (cname = "GetGestureDetected")]
1509 | public static Gesture get_gesture_detected ();
1510 |
1511 | [CCode (cname = "GetGestureHoldDuration")]
1512 | public static float get_gesture_hold_duration ();
1513 |
1514 | [CCode (cname = "GetGestureDragVector")]
1515 | public static Vector2 get_gesture_drag_duration ();
1516 |
1517 | [CCode (cname = "GetGestureDragAngle")]
1518 | public static float get_gesture_drag_angle ();
1519 |
1520 | [CCode (cname = "GetGesturePinchVector")]
1521 | public static Vector2 get_gesture_pinch_vector ();
1522 |
1523 | [CCode (cname = "GetGesturePinchAngle")]
1524 | public static float get_gesture_pinch_angle ();
1525 |
1526 | //------------------------------------------------------------------------------------
1527 | // Camera System Functions (Module: rcamera)
1528 | //------------------------------------------------------------------------------------
1529 | [CCode (cname = "UpdateCamera")]
1530 | public static void update_camera (Camera? camera, CameraMode mode);
1531 |
1532 | [CCode (cname = "UpdateCameraPro")]
1533 | public static void update_camera_pro (Camera? camera, Vector3 movement, Vector3 rotation, float zoom);
1534 |
1535 |
1536 | //------------------------------------------------------------------------------------
1537 | // Basic Shapes Drawing Functions (Module: shapes)
1538 | //------------------------------------------------------------------------------------
1539 | [CCode (cname = "SetShapesTexture")]
1540 | public static void set_shapes_texture (Texture2D texture, Rectangle source);
1541 |
1542 | [CCode (cname = "DrawPixel")]
1543 | public static void draw_pixel (int x, int y, Color color);
1544 |
1545 | [CCode (cname = "DrawPixelV")]
1546 | public static void draw_pixel_vector (Vector2 position, Color color);
1547 |
1548 | [CCode (cname = "DrawLine")]
1549 | public static void draw_line (int start_x, int start_y, int end_x, int end_y, Color color);
1550 |
1551 | [CCode (cname = "DrawLineV")]
1552 | public static void draw_line_vector (Vector2 start, Vector2 end, Color color);
1553 |
1554 | [CCode (cname = "DrawLineEx")]
1555 | public static void draw_line_ext (Vector2 start, Vector2 end, float thickness, Color color);
1556 |
1557 | [CCode (cname = "DrawLineStrip")]
1558 | public static void draw_line_strip (Vector2[] points, Color color);
1559 |
1560 | [CCode (cname = "DrawCircle")]
1561 | public static void draw_circle (int center_x, int center_y, float radius, Color color);
1562 |
1563 | [CCode (cname = "DrawCircleSector")]
1564 | public static void draw_circle_sector (Vector2 center, float radius, float start, float end, int segments, Color color);
1565 |
1566 | [CCode (cname = "DrawCircleSectorLines")]
1567 | public static void draw_circle_sector_lines (Vector2 center, float radius, float start, float end, int segments, Color color);
1568 |
1569 | [CCode (cname = "DrawCircleGradient")]
1570 | public static void draw_circle_gradient (int center_x, int center_y, float radius, Color color1, Color color2);
1571 |
1572 | [CCode (cname = "DrawCircleV")]
1573 | public static void draw_circle_vector (Vector2 center, float radius, Color color);
1574 |
1575 | [CCode (cname = "DrawCircleLines")]
1576 | public static void draw_circle_lines (int center_x, int center_y, float radius, Color color);
1577 |
1578 | [CCode (cname = "DrawCircleLinesV")]
1579 | public static void draw_circle_lines_vector (Vector2 centre, float radius, Color color);
1580 |
1581 | [CCode (cname = "DrawEllipse")]
1582 | public static void draw_ellipse (int center_x, int center_y, float radius_horizontal, float radius_vertical, Color color);
1583 |
1584 | [CCode (cname = "DrawEllipseLines")]
1585 | public static void draw_ellipse_lines (int center_x, int center_y, float radius_horizontal, float radius_vertical, Color color);
1586 |
1587 | [CCode (cname = "DrawRing")]
1588 | public static void draw_ring (Vector2 center, float inner_radius, float outer_radius, float start, float end, int segments, Color color);
1589 |
1590 | [CCode (cname = "DrawRingLines")]
1591 | public static void draw_ring_lines (Vector2 center, float inner_radius, float outer_radius, float start, float end, int segments, Color color);
1592 |
1593 | [CCode (cname = "DrawRectangle")]
1594 | public static void draw_rectangle (int x, int y, int width, int height, Color color);
1595 |
1596 | [CCode (cname = "DrawRectangleV")]
1597 | public static void draw_rectangle_vector (Vector2 position, Vector2 size, Color color);
1598 |
1599 | [CCode (cname = "DrawRectangleRec")]
1600 | public static void draw_rectangle_rect (Rectangle rectangle, Color color);
1601 |
1602 | [CCode (cname = "DrawRectanglePro")]
1603 | public static void draw_rectangle_pro (Rectangle rectangle, Vector2 origin, float rotation, Color color);
1604 |
1605 | [CCode (cname = "DrawRectangleGradientV")]
1606 | public static void draw_rectangle_gradient_vector (int x, int y, int width, int height, Color color1, Color color2);
1607 |
1608 | [CCode (cname = "DrawRectangleGradientH")]
1609 | public static void draw_rectangle_gradient_horizontal (int x, int y, int width, int height, Color color1, Color color2);
1610 |
1611 | [CCode (cname = "DrawRectangleGradientEx")]
1612 | public static void draw_rectangle_gradient_ext (Rectangle rectangle, Color color1, Color color2, Color color3, Color color4);
1613 |
1614 | [CCode (cname = "DrawRectangleLines")]
1615 | public static void draw_rectangle_lines (int x, int y, int width, int height, Color color);
1616 |
1617 | [CCode (cname = "DrawRectangleLinesEx")]
1618 | public static void draw_rectangle_lines_ext (Rectangle rectangle, float thickness, Color color);
1619 |
1620 | [CCode (cname = "DrawRectangleRounded")]
1621 | public static void draw_rectangle_rounded (Rectangle rectangle, float roundness, int segments, Color color);
1622 |
1623 | [CCode (cname = "DrawRectangleRoundedLines")]
1624 | public static void draw_rectangle_rounded_lines (Rectangle rectangle, float roundness, int segments, float thickness, Color color);
1625 |
1626 | [CCode (cname = "DrawTriangle")]
1627 | public static void draw_triangle (Vector2 vector1, Vector2 vector2, Vector2 vector3, Color color);
1628 |
1629 | [CCode (cname = "DrawTriangleLines")]
1630 | public static void draw_triangle_lines (Vector2 vector1, Vector2 vector2, Vector2 vector3, Color color);
1631 |
1632 | [CCode (cname = "DrawTriangleFan")]
1633 | public static void draw_triangle_fan (Vector2[] points, Color color);
1634 |
1635 | [CCode (cname = "DrawTriangleStrip")]
1636 | public static void draw_triangle_strip (Vector2[] points, Color color);
1637 |
1638 | [CCode (cname = "DrawPoly")]
1639 | public static void draw_poly (Vector2 center, int sides, float radius, float rotation, Color color);
1640 |
1641 | [CCode (cname = "DrawPolyLines")]
1642 | public static void draw_poly_lines (Vector2 center, int sides, float radius, float rotation, Color color);
1643 |
1644 | [CCode (cname = "DrawPolyLinesEx")]
1645 | public static void draw_poly_lines_ext (Vector2 center, int sides, float radius, float rotation, float thickness, Color color);
1646 |
1647 | // Splines drawing functions
1648 | [CCode (cname = "DrawSplineLinear")]
1649 | public static void draw_spline_linear (Vector2[] points, float thick, Color color);
1650 |
1651 | [CCode (cname = "DrawSplineBasic")]
1652 | public static void draw_spline_basis (Vector2[] points, float thick, Color color);
1653 |
1654 | [CCode (cname = "DrawSplineCatmullRom")]
1655 | public static void draw_spline_catmull_rom (Vector2[] points, float thick, Color color);
1656 |
1657 | [CCode (cname = "DrawSplineBezierQuadratic")]
1658 | public static void draw_spline_bezier_quadratic (Vector2[] points, float thick, Color color);
1659 |
1660 | [CCode (cname = "DrawSplineBezierCubic")]
1661 | public static void draw_spline_bezier_cubic (Vector2[] points, float thick, Color color);
1662 |
1663 | [CCode (cname = "DrawSplineSegmentLinear")]
1664 | public static void draw_spline_segment_linear (Vector2 p1, Vector2 p2, float thick, Color color);
1665 |
1666 | [CCode (cname = "DrawSplineSegmentBasis")]
1667 | public static void draw_spline_segment_basis (Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color);
1668 |
1669 | [CCode (cname = "DrawSplineSegmentCatmullRom")]
1670 | public static void draw_spline_segment_catmull_rom (Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color);
1671 |
1672 | [CCode (cname = "DrawSplineSegmentBezierQuadratic")]
1673 | public static void draw_spline_segment_bezier_quadratic (Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color);
1674 |
1675 | [CCode (cname = "DrawSplineSegmentBezierCubic")]
1676 | public static void draw_spline_segment_bezier_cubic (Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color);
1677 |
1678 | // Spline segment point evaluation functions, for a given t [0.0f .. 1.0f]
1679 | [CCode (cname = "GetSplinePointLinear")]
1680 | public static Vector2 get_spline_point_linear (Vector2 start_position, Vector2 end_position, float weight);
1681 |
1682 | [CCode (cname = "GetSplinePointBasis")]
1683 | public static Vector2 get_spline_point_basis (Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float weight);
1684 |
1685 | [CCode (cname = "GetSplinePointCatmullRom")]
1686 | public static Vector2 get_spline_point_catmull_rom (Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float weight);
1687 |
1688 | [CCode (cname = "GetSplinePointBezierQuad")]
1689 | public static Vector2 get_spline_point_bezier_quad (Vector2 p1, Vector2 c2, Vector2 p3, float weight);
1690 |
1691 | [CCode (cname = "GetSplinePointBezierCubic")]
1692 | public static Vector2 get_spline_point_bezier_cubic (Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float weight);
1693 |
1694 | // Basic shapes collision detection functions
1695 | [CCode (cname = "CheckCollisionRecs")]
1696 | public static bool check_collision_rectangles (Rectangle rectangle1, Rectangle rectangle2);
1697 |
1698 | [CCode (cname = "CheckCollisionCircles")]
1699 | public static bool check_collision_circles (Vector2 center1, float radius1, Vector2 center2, float radius2);
1700 |
1701 | [CCode (cname = "CheckCollisionCircleRec")]
1702 | public static bool check_collision_circle_rectangle (Vector2 center, float radius, Rectangle rectangle);
1703 |
1704 | [CCode (cname = "CheckCollisionPointRec")]
1705 | public static bool check_collision_point_rectangle (Vector2 point, Rectangle rectangle);
1706 |
1707 | [CCode (cname = "CheckCollisionPointCircle")]
1708 | public static bool check_collision_point_circle (Vector2 point, Vector2 center, float radius);
1709 |
1710 | [CCode (cname = "CheckCollisionPointTriangle")]
1711 | public static bool check_collision_point_triangle (Vector2 point, Vector2 point1, Vector2 point2, Vector2 point3);
1712 |
1713 | [CCode (cname = "CheckCollisionPointPoly")]
1714 | public static bool check_collision_point_poly (Vector2 point, Vector2[] points);
1715 |
1716 | [CCode (cname = "CheckCollisionLines")]
1717 | public static bool check_collision_lines (Vector2 start1, Vector2 end1, Vector2 start2, Vector2 end2, Vector2[] collision_point);
1718 |
1719 | [CCode (cname = "CheckCollisionPointLine")]
1720 | public static bool check_collision_point_line (Vector2 point, Vector2 start, Vector2 end, int threshold);
1721 |
1722 | [CCode (cname = "GetCollisionRec")]
1723 | public static Rectangle get_collision_rectangle (Rectangle rectangle1, Rectangle rectangle2);
1724 |
1725 | //------------------------------------------------------------------------------------
1726 | // Texture Loading and Drawing Functions (Module: textures)
1727 | //------------------------------------------------------------------------------------
1728 |
1729 | // Image loading functions
1730 | // NOTE: This functions do not require GPU access
1731 | [CCode (cname = "LoadImage")]
1732 | public static Image load_image (string filename);
1733 |
1734 | [CCode (cname = "LoadImageRaw")]
1735 | public static Image load_image_raw (string filename, int width, int height, int format, int header_size);
1736 |
1737 | [CCode (cname = "LoadImageSvg")]
1738 | public static Image load_image_svg (string filename, int width, int height);
1739 |
1740 | [CCode (cname = "LoadImageAnim")]
1741 | public static Image load_image_animation (string filename, out int frames);
1742 |
1743 | [CCode (cname = "LoadImageFromMemory")]
1744 | public static Image load_image_from_memory (string filename, uchar[] file_data);
1745 |
1746 | [CCode (cname = "LoadImageFromTexture")]
1747 | public static Image load_image_from_texture (Texture2D texture);
1748 |
1749 | [CCode (cname = "LoadImageFromScreen")]
1750 | public static Image load_image_from_screen ();
1751 |
1752 | [CCode (cname = "IsImageReady")]
1753 | public static bool is_image_ready (Image image);
1754 |
1755 | [CCode (cname = "UnloadImage")]
1756 | public static void unload_image (Image image);
1757 |
1758 | [CCode (cname = "ExportImage")]
1759 | public static bool export_image (Image image, string filename);
1760 |
1761 | [CCode (cname = "ExportImageToMemory")]
1762 | public static unowned uchar[] export_image_to_memory (Image image, string file_type, out int file_size);
1763 |
1764 | [CCode (cname = "ExportImageAsCode")]
1765 | public static bool export_image_as_code (Image image, string filename);
1766 |
1767 | // Image generation functions
1768 | [CCode (cname = "GenImageColor")]
1769 | public static Image generate_image_color (int width, int height, Color color);
1770 |
1771 | [CCode (cname = "GenImageGradientLinear")]
1772 | public static Image generate_image_gradient_linear (int width, int height, int direction, Color start, Color end);
1773 |
1774 | [CCode (cname = "GenImageGradientRadial")]
1775 | public static Image generate_image_gradient_radial (int width, int height, float density, Color inner, Color outer);
1776 |
1777 | [CCode (cname = "GenImageGradientSquare")]
1778 | public static Image generate_image_gradient_square (int width, int height, float density, Color inner, Color outer);
1779 |
1780 | [CCode (cname = "GenImageChecked")]
1781 | public static Image generate_image_checked (int width, int height, int checks_x, int checks_y, Color primary, Color secondary);
1782 |
1783 | [CCode (cname = "GenImageWhiteNoise")]
1784 | public static Image generate_image_white_noise (int width, int height, float factor);
1785 |
1786 | [CCode (cname = "GenImagePerlinNoise")]
1787 | public static Image generate_image_perlin_noise (int width, int height, int offset_x, int offset_y, float scale);
1788 |
1789 | [CCode (cname = "GenImageCellular")]
1790 | public static Image generate_image_cellular (int width, int height, int tile_size);
1791 |
1792 | [CCode (cname = "GenImageText")]
1793 | public static Image generate_image_text (int width, int height, string text);
1794 |
1795 | // Image manipulation functions
1796 | [CCode (cname = "ImageCopy")]
1797 | public static Image image_copy (Image image);
1798 |
1799 | [CCode (cname = "ImageFromImage")]
1800 | public static Image image_from_image (Image image, Rectangle rectangle);
1801 |
1802 | [CCode (cname = "ImageText")]
1803 | public static Image image_text (string text, int font_size, Color color);
1804 |
1805 | [CCode (cname = "ImageTextEx")]
1806 | public static Image image_text_ext (Font font, string text, float font_size, float spacing, Color tint);
1807 |
1808 | [CCode (cname = "ImageFormat")]
1809 | public static void image_format (Image? image, PixelFormat new_format);
1810 |
1811 | [CCode (cname = "ImageToPOT")]
1812 | public static void image_to_power_of_two (Image? image, Color fill);
1813 |
1814 | [CCode (cname = "ImageCrop")]
1815 | public static void image_crop (Image? image, Rectangle crop);
1816 |
1817 | [CCode (cname = "ImageAlphaCrop")]
1818 | public static void image_alpha_crop (Image? image, float threshold);
1819 |
1820 | [CCode (cname = "ImageAlphaClear")]
1821 | public static void image_clear_alpha (Image? image, Color color, float threshold);
1822 |
1823 | [CCode (cname = "ImageAlphaMask")]
1824 | public static void image_alpha_mask (Image? image, Image alpha_mask);
1825 |
1826 | [CCode (cname = "ImageAlphaPremultiply")]
1827 | public static void image_alpha_premultiply (Image? image);
1828 |
1829 | [CCode (cname = "ImageBlurGaussian")]
1830 | public static void image_blur_gaussian (Image? image, int blur_size);
1831 |
1832 | [CCode (cname = "ImageResize")]
1833 | public static void image_resize (Image? image, int width, int height);
1834 |
1835 | [CCode (cname = "ImageResizeNN")]
1836 | public static void image_resize_nearest_neighbour (Image? image, int width, int height);
1837 |
1838 | [CCode (cname = "ImageResizeCanvas")]
1839 | public static void image_resize_canvas (Image? image, int width, int height, int offset_x, int offset_y, Color fill);
1840 |
1841 | [CCode (cname = "ImageMipmaps")]
1842 | public static void image_mipmaps (Image? image);
1843 |
1844 | [CCode (cname = "ImageDither")]
1845 | public static void image_dither (Image? image, int red_bpp, int green_bpp, int blue_bpp, int alpha_bpp);
1846 |
1847 | [CCode (cname = "ImageFlipVertical")]
1848 | public static void image_flip_vertical (Image? image);
1849 |
1850 | [CCode (cname = "ImageFlipHorizontal")]
1851 | public static void image_flip_horizontal (Image? image);
1852 |
1853 | [CCode (cname = "ImageRotate")]
1854 | public static void image_rotate (Image? image, int degrees);
1855 |
1856 | [CCode (cname = "ImageRotateCW")]
1857 | public static void image_rotate_clockwise (Image? image);
1858 |
1859 | [CCode (cname = "ImageRotateCCW")]
1860 | public static void image_rotate_counter_clockwise (Image? image);
1861 |
1862 | [CCode (cname = "ImageColorTint")]
1863 | public static void image_color_tint (Image? image, Color color);
1864 |
1865 | [CCode (cname = "ImageColorInvert")]
1866 | public static void image_color_invert (Image? image);
1867 |
1868 | [CCode (cname = "ImageColorGrayscale")]
1869 | public static void image_color_grayscale (Image? image);
1870 |
1871 | [CCode (cname = "ImageColorContrast")]
1872 | public static void image_color_contrast (Image? image, float contrast);
1873 |
1874 | [CCode (cname = "ImageColorBrightness")]
1875 | public static void image_color_brightness (Image? image, int brightness);
1876 |
1877 | [CCode (cname = "ImageColorReplace")]
1878 | public static void image_color_replace (Image? image, Color color, Color replace);
1879 |
1880 | [CCode (cname = "LoadImageColors")]
1881 | public static Color[] load_image_colors (Image image);
1882 |
1883 | [CCode (cname = "LoadImagePalette")]
1884 | public static Color[] load_image_palette (Image image, int max_palette_size, out int color_count);
1885 |
1886 | [CCode (cname = "UnloadImageColors")]
1887 | public static void unload_image_colors (Color[] colors);
1888 |
1889 | [CCode (cname = "UnloadImagePalette")]
1890 | public static void unload_image_palette (Color[] colors);
1891 |
1892 | [CCode (cname = "GetImageAlphaBorder")]
1893 | public static Rectangle get_image_alpha_border (Image image, float threshold);
1894 |
1895 | [CCode (cname = "GetImageColor")]
1896 | public static Color get_image_color (Image image, int x, int y);
1897 |
1898 | // Image drawing functions
1899 | // NOTE: Image software-rendering functions (CPU)
1900 |
1901 | [CCode (cname = "ImageClearBackground")]
1902 | public static void image_clear_background (Image? image, Color color);
1903 |
1904 | [CCode (cname = "ImageDrawPixel")]
1905 | public static void image_draw_pixel (Image? image, int x, int y, Color color);
1906 |
1907 | [CCode (cname = "ImageDrawPixelV")]
1908 | public static void image_draw_pixel_vector (Image? image, Vector2 position, Color color);
1909 |
1910 | [CCode (cname = "ImageDrawLine")]
1911 | public static void image_draw_line (Image? image, int start_x, int start_y, int end_x, int end_y, Color color);
1912 |
1913 | [CCode (cname = "ImageDrawLineV")]
1914 | public static void image_draw_line_vector (Image? image, Vector2 start, Vector2 end, Color color);
1915 |
1916 | [CCode (cname = "ImageDrawCircle")]
1917 | public static void image_draw_circle (Image? image, int x, int y, int radius, Color color);
1918 |
1919 | [CCode (cname = "ImageDrawCircleV")]
1920 | public static void image_draw_circle_vector (Image? image, Vector2 center, int radius, Color color);
1921 |
1922 | [CCode (cname = "ImageDrawCircleLines")]
1923 | public static void image_draw_circle_lines (Image? image, int center_x, int center_y, int radius, Color color);
1924 |
1925 | [CCode (cname = "ImageDrawCircleLinesV")]
1926 | public static void image_draw_circle_lines_vector (Image? image, Vector2 center, int radius, Color color);
1927 |
1928 | [CCode (cname = "ImageDrawRectangle")]
1929 | public static void image_draw_rectangle (Image? image, int x, int y, int width, int height, Color color);
1930 |
1931 | [CCode (cname = "ImageDrawRectangleV")]
1932 | public static void image_draw_rectanglev (Image? image, Vector2 position, Vector2 size, Color color);
1933 |
1934 | [CCode (cname = "ImageDrawRectangleRec")]
1935 | public static void image_draw_rectangle_rectangle (Image? image, Rectangle rectangle, Color color);
1936 |
1937 | [CCode (cname = "ImageDrawRectangleLines")]
1938 | public static void image_draw_rectangle_lines (Image? image, Rectangle rectangle, int thickness, Color color);
1939 |
1940 | [CCode (cname = "ImageDraw")]
1941 | public static void image_draw (Image? image, Image source, Rectangle source_rectangle, Rectangle destination_rectangle, Color tint);
1942 |
1943 | [CCode (cname = "ImageDrawText")]
1944 | public static void image_draw_text (Image? image, string text, int x, int y, int font_size, Color color);
1945 |
1946 | [CCode (cname = "ImageDrawTextEx")]
1947 | public static void image_draw_text_ext (Image? image, Font font, string text, Vector2 position, float font_size, float spacing, Color tint);
1948 |
1949 | // Texture loading functions
1950 | // NOTE: These functions require GPU access
1951 | [CCode (cname = "LoadTexture")]
1952 | public static Texture2D load_texture (string filename);
1953 |
1954 | [CCode (cname = "LoadTextureFromImage")]
1955 | public static Texture2D load_texture_from_image (Image image);
1956 |
1957 | [CCode (cname = "LoadTextureCubemap")]
1958 | public static TextureCubemap load_texture_cubemap (Image image, CubemapLayout layout);
1959 |
1960 | [CCode (cname = "LoadRenderTexture")]
1961 | public static RenderTexture2D load_render_texture (int width, int height);
1962 |
1963 | [CCode (cname = "IsTextureReady")]
1964 | public static bool is_texture_ready (Texture2D texture);
1965 |
1966 | [CCode (cname = "UnloadTexture")]
1967 | public static void unload_texture (Texture2D texture);
1968 |
1969 | [CCode (cname = "IsRenderTextureReady")]
1970 | public static bool is_render_texture_ready (RenderTexture2D target);
1971 |
1972 | [CCode (cname = "UnloadRenderTexture")]
1973 | public static void unload_render_texture (RenderTexture2D target);
1974 |
1975 | [CCode (cname = "UpdateTexture")]
1976 | public static void update_texture (Texture2D texture, void* pixels);
1977 |
1978 | [CCode (cname = "UpdateTextureRec")]
1979 | public static void update_texture_rectangle (Texture2D texture, Rectangle rectangle, void* pixels);
1980 |
1981 |
1982 | // Texture configuration functions
1983 | [CCode (cname = "GenTextureMipmaps")]
1984 | public static void generate_texture_mipmaps (Texture2D? texture);
1985 |
1986 | [CCode (cname = "SetTextureFilter")]
1987 | public static void set_texture_filter (Texture2D texture, TextureFilter filter);
1988 |
1989 | [CCode (cname = "SetTextureWrap")]
1990 | public static void set_texture_wrap (Texture2D texture, TextureWrap wrap);
1991 |
1992 |
1993 | // Texture drawing functions
1994 | [CCode (cname = "DrawTexture")]
1995 | public static void draw_texture (Texture2D texture, int x, int y, Color tint);
1996 |
1997 | [CCode (cname = "DrawTextureV")]
1998 | public static void draw_texture_vector (Texture2D texture, Vector2 position, Color tint);
1999 |
2000 | [CCode (cname = "DrawTextureEx")]
2001 | public static void draw_texture_ext (Texture2D texture, Vector2 position, float rotation, float scale, Color tint);
2002 |
2003 | [CCode (cname = "DrawTextureRec")]
2004 | public static void draw_texture_rectangle (Texture2D texture, Rectangle source, Vector2 position, Color tint);
2005 |
2006 | [CCode (cname = "DrawTexturePro")]
2007 | public static void draw_texture_pro (Texture2D texture, Rectangle source, Rectangle destination, Vector2 origin, float rotation, Color tint);
2008 |
2009 | [CCode (cname = "DrawTextureNPatch")]
2010 | public static void draw_texture_npatch (Texture2D texture, NPatchInfo info, Rectangle destination, Vector2 origin, float rotation, Color tint);
2011 |
2012 |
2013 | // Color/pixel related functions
2014 | [CCode (cname = "Fade")]
2015 | public static Color fade (Color color, float alpha);
2016 |
2017 | [CCode (cname = "ColorToInt")]
2018 | public static int color_to_int (Color color);
2019 |
2020 | [CCode (cname = "ColorNormalize")]
2021 | public static Vector4 color_normalize (Color color);
2022 |
2023 | [CCode (cname = "ColorFromNormalized")]
2024 | public static Color color_from_normalized (Vector4 normalized);
2025 |
2026 | [CCode (cname = "ColorToHSV")]
2027 | public static Vector3 color_to_hsv (Color color);
2028 |
2029 | [CCode (cname = "ColorFromHSV")]
2030 | public static Color color_from_hsv (float hue, float saturation, float value);
2031 |
2032 | [CCode (cname = "ColorTint")]
2033 | public static Color color_tint (Color color, Color tint);
2034 |
2035 | [CCode (cname = "ColorBrightness")]
2036 | public static Color color_brightness (Color color, float factor);
2037 |
2038 | [CCode (cname = "ColorContrast")]
2039 | public static Color color_contrast (Color color, float contrast);
2040 |
2041 | [CCode (cname = "ColorAlpha")]
2042 | public static Color color_alpha (Color color, float alpha);
2043 |
2044 | [CCode (cname = "ColorAlphaBlend")]
2045 | public static Color color_alpha_blend (Color destination, Color source, Color tint);
2046 |
2047 | [CCode (cname = "GetColor")]
2048 | public static Color get_color (uint hex);
2049 |
2050 | [CCode (cname = "GetPixelColor")]
2051 | public static Color get_pixel_color (void* source_pointer, int format);
2052 |
2053 | [CCode (cname = "SetPixelColor")]
2054 | public static void set_pixel_color (void* destination_pointer, Color color, int format);
2055 |
2056 | [CCode (cname = "GetPixelDataSize")]
2057 | public static int get_pixel_data_size (int width, int height, int format);
2058 |
2059 | //------------------------------------------------------------------------------------
2060 | // Font Loading and Text Drawing Functions (Module: text)
2061 | //------------------------------------------------------------------------------------
2062 |
2063 | // Font loading/unloading functions
2064 | [CCode (cname = "GetFontDefault")]
2065 | public static Font get_font_default ();
2066 |
2067 | [CCode (cname = "LoadFont")]
2068 | public static Font load_font (string filename);
2069 |
2070 | [CCode (cname = "LoadFontEx")]
2071 | public static Font load_font_ext (string filename, int font_size, int[] code_points);
2072 |
2073 | [CCode (cname = "LoadFontFromImage")]
2074 | public static Font load_font_from_image (Image image, Color key, int first_char);
2075 |
2076 | [CCode (cname = "LoadFontFromMemory")]
2077 | public static Font load_font_from_memory (string file_type, uchar file_data, int font_size, int[] code_points);
2078 |
2079 | [CCode (cname = "IsFontReady")]
2080 | public static bool is_font_ready (Font font);
2081 |
2082 | [CCode (cname = "LoadFontData")]
2083 | public static GlyphInfo? load_font_data (uchar[] file_data, int font_size, int[] code_points, FontType type);
2084 |
2085 | [CCode (cname = "GenImageFontAtlas")]
2086 | public static Image generate_image_font_atlas (GlyphInfo* characters, unowned Rectangle[] glyph_rectangles, int font_size, int padding, int pack_method);
2087 |
2088 | [CCode (cname = "UnloadFontData")]
2089 | public static void unload_font_data (GlyphInfo[] glyphs);
2090 |
2091 | [CCode (cname = "UnloadFont")]
2092 | public static void unload_font (Font font);
2093 |
2094 | [CCode (cname = "ExportFontAsCode")]
2095 | public static bool export_font_as_code (Font font, string filename);
2096 |
2097 | // Text drawing functions
2098 | [CCode (cname = "DrawFPS")]
2099 | public static void draw_fps (int x, int y);
2100 |
2101 | [CCode (cname = "DrawText")]
2102 | public static void draw_text (string text, int x, int y, int font_size, Color color);
2103 |
2104 | [CCode (cname = "DrawTextEx")]
2105 | public static void draw_text_ext (Font font, string text, Vector2 position, float font_size, float spacing, Color tint);
2106 |
2107 | [CCode (cname = "DrawTextPro")]
2108 | public static void draw_text_pro (Font font, string text, Vector2 position, Vector2 origin, float rotation, float font_size, float spacing, Color tint);
2109 |
2110 | [CCode (cname = "DrawTextCodepoint")]
2111 | public static void draw_text_codepoint (Font font, int codepoint, Vector2 position, float font_size, Color tint);
2112 |
2113 | [CCode (cname = "DrawTextCodepoints")]
2114 | public static void draw_text_codepoints (Font font, int[] codepoints, Vector2 position, float font_size, float spacing, Color tint);
2115 |
2116 | // Text font info functions
2117 | [CCode (cname = "SetTextLineSpacing")]
2118 | public static void set_text_line_spacing (int spacing);
2119 |
2120 | [CCode (cname = "MeasureText")]
2121 | public static int measure_text (string text, int font_size);
2122 |
2123 | [CCode (cname = "MeasureTextEx")]
2124 | public static Vector2 measure_text_ext (Font font, string text, float font_size, float spacing);
2125 |
2126 | [CCode (cname = "GetGlyphIndex")]
2127 | public static int get_glyph_index (Font font, int codepoint);
2128 |
2129 | [CCode (cname = "GetGlyphInfo")]
2130 | public static GlyphInfo get_glyph_info (Font font, int codepoint);
2131 |
2132 | [CCode (cname = "GetGlyphAtlasRec")]
2133 | public static Rectangle get_glyph_atlas_rectangle (Font font, int codepoint);
2134 |
2135 | // Text codepoints management functions (unicode characters)
2136 | [CCode (cname = "LoadUTF8")]
2137 | public static string load_utf8 (int[] codepoints);
2138 |
2139 | [CCode (cname = "UnloadUTF8")]
2140 | public static void unload_utf8 (string text);
2141 |
2142 | [CCode (cname = "LoadCodepoints")]
2143 | public static int[] load_codepoints (string text);
2144 |
2145 | [CCode (cname = "UnloadCodepoints")]
2146 | public static void unload_codepoints (int[] codepoints, out int length);
2147 |
2148 | [CCode (cname = "GetCodepointCount")]
2149 | public static int get_codepoint_count (string text);
2150 |
2151 | [CCode (cname = "GetCodepoint")]
2152 | public static int get_codepoint (string text, out int size);
2153 |
2154 | [CCode (cname = "GetCodepointNext")]
2155 | public static int get_codepoint_next (string text, out int size);
2156 |
2157 | [CCode (cname = "GetCodepointPrevious")]
2158 | public static int get_codepoint_previous (string text, out int size);
2159 |
2160 | [CCode (cname = "CodepointToUTF8")]
2161 | public static string codepoint_to_utf8 (int codepoint, out int size);
2162 |
2163 | // Text strings management functions (no UTF-8 strings, only byte chars)
2164 | // NOTE: Some strings allocate memory internally for returned strings, just be careful!
2165 | [CCode (cname = "TextCopy")]
2166 | public static int text_copy (out string destination, string source);
2167 |
2168 | [CCode (cname = "TextIsEqual")]
2169 | public static bool text_is_equal (string text1, string text2);
2170 |
2171 | [CCode (cname = "TextLength")]
2172 | public static uint text_length (string text);
2173 |
2174 | [CCode (cname = "TextFormat")]
2175 | public static string text_format (string text, ...);
2176 |
2177 | [CCode (cname = "TextSubtext")]
2178 | public static string text_subtext (string text, int position, int length);
2179 |
2180 | [CCode (cname = "TextReplace")]
2181 | public static string text_replace (out string text, string replace, string by);
2182 |
2183 | [CCode (cname = "TextInsert")]
2184 | public static string text_insert (string text, string insert, int position);
2185 |
2186 | [CCode (cname = "TextJoin")]
2187 | public static string text_join (string[] text_list, string delimiter);
2188 |
2189 | [CCode (cname = "TextSplit")]
2190 | public static string[] text_split (string text, char delimiter, out int count);
2191 |
2192 | [CCode (cname = "TextAppend")]
2193 | public static void text_append (out string text, string append, out int position);
2194 |
2195 | [CCode (cname = "TextFindIndex")]
2196 | public static int text_find_index (string text, string find);
2197 |
2198 | [CCode (cname = "TextToUpper")]
2199 | public static string text_to_upper (string text);
2200 |
2201 | [CCode (cname = "TextToLower")]
2202 | public static string text_to_lower (string text);
2203 |
2204 | [CCode (cname = "TextToPascal")]
2205 | public static string text_to_pascal (string text);
2206 |
2207 | [CCode (cname = "TextToInteger")]
2208 | public static int text_to_integer (string text);
2209 |
2210 | //------------------------------------------------------------------------------------
2211 | // Basic 3d Shapes Drawing Functions (Module: models)
2212 | //------------------------------------------------------------------------------------
2213 |
2214 | // Basic geometric 3D shapes drawing functions
2215 | [CCode (cname = "DrawLine3D")]
2216 | public static void draw_line_3D (Vector3 start, Vector3 end, Color color); // vala-lint=naming-convention
2217 |
2218 | [CCode (cname = "DrawPoint3D")]
2219 | public static void draw_point_3D (Vector3 position, Color color); // vala-lint=naming-convention
2220 |
2221 | [CCode (cname = "DrawCircle3D")]
2222 | public static void draw_circle_3D (Vector3 center, float radius, Vector3 rotation_axis, float rotation_angle, Color color); // vala-lint=naming-convention
2223 |
2224 | [CCode (cname = "DrawTriangle3D")]
2225 | public static void draw_triangle_3D (Vector3 vector1, Vector3 vector2, Vector3 vector3, Color color); // vala-lint=naming-convention
2226 |
2227 | [CCode (cname = "DrawTriangleStrip3D")]
2228 | public static void draw_triangle_strip_3D (Vector3[] points, Color color); // vala-lint=naming-convention
2229 |
2230 | [CCode (cname = "DrawCube")]
2231 | public static void draw_cube (Vector3 position, float width, float height, float length, Color color);
2232 |
2233 | [CCode (cname = "DrawCubeV")]
2234 | public static void draw_cube_vector (Vector3 position, Vector3 size, Color color);
2235 |
2236 | [CCode (cname = "DrawCubeWires")]
2237 | public static void draw_cube_wires (Vector3 position, float width, float height, float length, Color color);
2238 |
2239 | [CCode (cname = "DrawCubeWiresV")]
2240 | public static void draw_cube_wires_vector (Vector3 position, Vector3 size, Color color);
2241 |
2242 | [CCode (cname = "DrawSphere")]
2243 | public static void draw_sphere (Vector3 center_position, float radius, Color color);
2244 |
2245 | [CCode (cname = "DrawSphereEx")]
2246 | public static void draw_sphere_ext (Vector3 center_position, float radius, int rings, int slices, Color color);
2247 |
2248 | [CCode (cname = "DrawSphereWires")]
2249 | public static void draw_sphere_wires (Vector3 center_position, float radius, int rings, int slices, Color color);
2250 |
2251 | [CCode (cname = "DrawCylinder")]
2252 | public static void draw_cylinder (Vector3 position, float radius_top, float radius_bottom, float height, int slices, Color color);
2253 |
2254 | [CCode (cname = "DrawCylinderEx")]
2255 | public static void draw_cylinder_ext (Vector3 start, Vector3 end, float start_radius, float end_radius, int sides, Color color);
2256 |
2257 | [CCode (cname = "DrawCylinderWires")]
2258 | public static void draw_cylinder_wires (Vector3 position, float radius_top, float radius_bottom, float height, int slices, Color color);
2259 |
2260 | [CCode (cname = "DrawCylinderWiresEx")]
2261 | public static void draw_cylinder_wires_ext (Vector3 start, Vector3 end, float start_adius, float end_radius, int sides, Color color);
2262 |
2263 | [CCode (cname = "DrawCapsule")]
2264 | public static void draw_capsule (Vector3 start, Vector3 end, float radius, int slices, int rings, Color color);
2265 |
2266 | [CCode (cname = "DrawCapsuleWires")]
2267 | public static void draw_capsule_wires (Vector3 start, Vector3 end, float radius, int slices, int rings, Color color);
2268 |
2269 | [CCode (cname = "DrawPlane")]
2270 | public static void draw_plane (Vector3 center, Vector2 size, Color color);
2271 |
2272 | [CCode (cname = "DrawRay")]
2273 | public static void draw_ray (Ray ray, Color color);
2274 |
2275 | [CCode (cname = "DrawGrid")]
2276 | public static void draw_grid (int slices, float spacing);
2277 |
2278 | //------------------------------------------------------------------------------------
2279 | // Model 3d Loading and Drawing Functions (Module: models)
2280 | //------------------------------------------------------------------------------------
2281 |
2282 | // Model management functions
2283 | [CCode (cname = "LoadModel")]
2284 | public static Model load_model (string filename);
2285 |
2286 | [CCode (cname = "LoadModelFromMesh")]
2287 | public static Model load_model_from_mesh (Mesh mesh);
2288 |
2289 | [CCode (cname = "UnloadModel")]
2290 | public static void unload_model (Model model);
2291 |
2292 | [CCode (cname = "UnloadModelKeepMeshes")]
2293 | public static void unload_model_keep_meshes (Model model);
2294 |
2295 | [CCode (cname = "GetModelBoundingBox")]
2296 | public static BoundingBox get_model_bounding_box (Model model);
2297 |
2298 | // Model drawing functions
2299 | [CCode (cname = "DrawModel")]
2300 | public static void draw_model (Model model, Vector3 position, float scale, Color tint);
2301 |
2302 | [CCode (cname = "DrawModelEx")]
2303 | public static void draw_model_ext (Model model, Vector3 position, Vector3 rotation_axis, float rotation_angle, Vector3 scale, Color tint);
2304 |
2305 | [CCode (cname = "DrawModelWires")]
2306 | public static void draw_model_wires (Model model, Vector3 position, float scale, Color tint);
2307 |
2308 | [CCode (cname = "DrawModelWiresEx")]
2309 | public static void draw_model_wires_ext (Model model, Vector3 position, Vector3 rotation_axis, float rotation_angle, Vector3 scale, Color tint);
2310 |
2311 | [CCode (cname = "DrawBoundingBox")]
2312 | public static void draw_bounding_box (BoundingBox box, Color color);
2313 |
2314 | [CCode (cname = "DrawBillboard")]
2315 | public static void draw_billboard (Camera camera, Texture2D texture, Vector3 position, float size, Color tint);
2316 |
2317 | [CCode (cname = "DrawBillboardRec")]
2318 | public static void draw_billboard_rectangle (Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint);
2319 |
2320 | [CCode (cname = "DrawBillboardPro")]
2321 | public static void draw_billboard_pro (Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint);
2322 |
2323 | // Mesh management functions
2324 | [CCode (cname = "UploadMesh")]
2325 | public static void upload_mesh (Mesh? mesh, bool is_dynamic);
2326 |
2327 | [CCode (cname = "UpdateMeshBuffer")]
2328 | public static void update_mesh_buffer (Mesh mesh, int index, void* data, int data_size, int offset);
2329 |
2330 | [CCode (cname = "UnloadMesh")]
2331 | public static void unload_mesh (Mesh mesh);
2332 |
2333 | [CCode (cname = "DrawMesh")]
2334 | public static void draw_mesh (Mesh mesh, Material material, Matrix transform);
2335 |
2336 | [CCode (cname = "DrawMeshInstanced")]
2337 | public static void draw_mesh_instanced (Mesh mesh, Material material, Matrix[] transforms);
2338 |
2339 | [CCode (cname = "ExportMesh")]
2340 | public static bool export_mesh (Mesh mesh, string filename);
2341 |
2342 | [CCode (cname = "GetMeshBoundingBox")]
2343 | public static BoundingBox get_mesh_bounding_box (Mesh mesh);
2344 |
2345 | [CCode (cname = "generate_mesh_Tangents")]
2346 | public static void generate_mesh_tangents (Mesh? mesh);
2347 |
2348 | // Mesh generation functions
2349 | [CCode (cname = "GenMeshPoly")]
2350 | public static Mesh generate_mesh_poly (int sides, float radius);
2351 |
2352 | [CCode (cname = "GenMeshPlane")]
2353 | public static Mesh generate_mesh_plane (float width, float length, int x, int y);
2354 |
2355 | [CCode (cname = "GenMeshCube")]
2356 | public static Mesh generate_mesh_cube (float width, float height, float length);
2357 |
2358 | [CCode (cname = "GenMeshSphere")]
2359 | public static Mesh generate_mesh_sphere (float radius, int rings, int slices);
2360 |
2361 | [CCode (cname = "GenMeshHemiSphere")]
2362 | public static Mesh generate_mesh_hemisphere (float radius, int rings, int slices);
2363 |
2364 | [CCode (cname = "GenMeshCylinder")]
2365 | public static Mesh generate_mesh_cylinder (float radius, float height, int slices);
2366 |
2367 | [CCode (cname = "GenMeshCone")]
2368 | public static Mesh generate_mesh_cone (float radius, float height, int slices);
2369 |
2370 | [CCode (cname = "GenMeshTorus")]
2371 | public static Mesh generate_mesh_torus (float radius, float size, int segment_radius, int sides);
2372 |
2373 | [CCode (cname = "GenMeshKnot")]
2374 | public static Mesh generate_mesh_knot (float radius, float size, int segment_radius, int sides);
2375 |
2376 | [CCode (cname = "GenMeshHeightmap")]
2377 | public static Mesh generate_mesh_heightmap (Image heightmap, Vector3 size);
2378 |
2379 | [CCode (cname = "GenMeshCubicmap")]
2380 | public static Mesh generate_mesh_cubicmap (Image cubicmap, Vector3 cube_size);
2381 |
2382 | // Material loading/unloading functions
2383 | [CCode (cname = "LoadMaterials")]
2384 | public static Material[] load_materials (string filename, out int material_count);
2385 |
2386 | [CCode (cname = "LoadMaterialDefault")]
2387 | public static Material load_material_default ();
2388 |
2389 | [CCode (cname = "IsMaterialReady")]
2390 | public static bool is_material_ready (Material material);
2391 |
2392 | [CCode (cname = "UnloadMaterial")]
2393 | public static void unload_material (Material material);
2394 |
2395 | [CCode (cname = "SetMaterialTexture")]
2396 | public static void set_material_texture (Material? material, MaterialMap map_type, Texture2D texture);
2397 |
2398 | [CCode (cname = "SetModelMeshMaterial")]
2399 | public static void set_model_mesh_material (Model? model, int mesh_id, int material_id);
2400 |
2401 | // Model animations loading/unloading functions
2402 | [CCode (cname = "LoadModelAnimations")]
2403 | public static ModelAnimation? load_model_animations (string filename, out int animation_count);
2404 |
2405 | [CCode (cname = "UpdateModelAnimation")]
2406 | public static void update_model_animations (Model model, ModelAnimation animation, int frame);
2407 |
2408 | [CCode (cname = "UnloadModelAnimation")]
2409 | public static void unload_model_animation (ModelAnimation animation);
2410 |
2411 | [CCode (cname = "UnloadModelAnimations")]
2412 | public static void unload_model_animations (ModelAnimation[] animations);
2413 |
2414 | [CCode (cname = "IsModelAnimationValid")]
2415 | public static bool is_model_animation_valid (Model model, ModelAnimation animation);
2416 |
2417 | // Collision detection functions
2418 | [CCode (cname = "CheckCollisionSpheres")]
2419 | public static bool check_collision_spheres (Vector3 center1, float radius1, Vector3 center2, float radius2);
2420 |
2421 | [CCode (cname = "CheckCollisionBoxes")]
2422 | public static bool check_collision_boxes (BoundingBox box1, BoundingBox box2);
2423 |
2424 | [CCode (cname = "CheckCollisionBoxSphere")]
2425 | public static bool check_collision_box_sphere (BoundingBox box, Vector3 center, float radius);
2426 |
2427 | [CCode (cname = "GetRayCollisionSphere")]
2428 | public static RayCollision get_ray_collision_sphere (Ray ray, Vector3 center, float radius);
2429 |
2430 | [CCode (cname = "GetRayCollisionBox")]
2431 | public static RayCollision get_ray_collision_box (Ray ray, BoundingBox box);
2432 |
2433 | [CCode (cname = "GetRayCollisionMesh")]
2434 | public static RayCollision get_ray_collision_mesh (Ray ray, Mesh mesh, Matrix transform);
2435 |
2436 | [CCode (cname = "GetRayCollisionTriangle")]
2437 | public static RayCollision get_ray_collision_triangle (Ray ray, Vector3 point1, Vector3 point2, Vector3 point3);
2438 |
2439 | [CCode (cname = "GetRayCollisionQuad")]
2440 | public static RayCollision get_ray_collision_quad (Ray ray, Vector3 point1, Vector3 point2, Vector3 point3, Vector3 point4);
2441 |
2442 | //------------------------------------------------------------------------------------
2443 | // Audio Loading and Playing Functions (Module: audio)
2444 | //------------------------------------------------------------------------------------
2445 | [CCode (cname = "AudioCallback")]
2446 | public delegate void AudioCallback (void* buffer_data, uint frames);
2447 |
2448 | // Audio device management functions
2449 | [CCode (cname = "InitAudioDevice")]
2450 | public static void init_audio_device ();
2451 |
2452 | [CCode (cname = "CloseAudioDevice")]
2453 | public static void close_audio_device ();
2454 |
2455 | [CCode (cname = "IsAudioDeviceReady")]
2456 | public static bool is_audio_device_ready ();
2457 |
2458 | [CCode (cname = "SetMasterVolume")]
2459 | public static void set_master_volume (float volume);
2460 |
2461 | [CCode (cname = "GetMasterVolume")]
2462 | public static float get_master_voume ();
2463 |
2464 | // Wave/Sound loading/unloading functions
2465 | [CCode (cname = "LoadWave")]
2466 | public static Wave load_wave (string filename);
2467 |
2468 | [CCode (cname = "LoadWaveFromMemory")]
2469 | public static Wave load_wave_from_memory (string file_type, uchar[] file_data);
2470 |
2471 | [CCode (cname = "IsWaveReady")]
2472 | public static bool is_wave_ready (Wave wave);
2473 |
2474 | [CCode (cname = "LoadSound")]
2475 | public static Sound load_sound (string filename);
2476 |
2477 | [CCode (cname = "LoadSoundFromWave")]
2478 | public static Sound load_sound_from_wave (Wave wave);
2479 |
2480 | [CCode (cname = "LoadSoundAlias")]
2481 | public static Sound load_sound_alias (Sound alias);
2482 |
2483 | [CCode (cname = "IsSoundReady")]
2484 | public static bool is_sound_ready (Sound sound);
2485 |
2486 | [CCode (cname = "UpdateSound")]
2487 | public static void update_sound (Sound sound, void* data, int sample_ount);
2488 |
2489 | [CCode (cname = "UnloadWave")]
2490 | public static void unload_wave (Wave wave);
2491 |
2492 | [CCode (cname = "UnloadSound")]
2493 | public static void unload_sound (Sound sound);
2494 |
2495 | [CCode (cname = "UnloadSoundAlias")]
2496 | public static void unload_sound_alias (Sound alias);
2497 |
2498 | [CCode (cname = "ExportWave")]
2499 | public static bool export_wave (Wave wave, string filename);
2500 |
2501 | [CCode (cname = "ExportWaveAsCode")]
2502 | public static bool export_wave_as_code (Wave wave, string filename);
2503 |
2504 | // Wave/Sound management functions
2505 | [CCode (cname = "PlaySound")]
2506 | public static void play_sound (Sound sound);
2507 |
2508 | [CCode (cname = "StopSound")]
2509 | public static void stop_sound (Sound sound);
2510 |
2511 | [CCode (cname = "PauseSound")]
2512 | public static void pause_sound (Sound sound);
2513 |
2514 | [CCode (cname = "ResumeSound")]
2515 | public static void resume_sound (Sound sound);
2516 |
2517 | [CCode (cname = "IsSoundPlaying")]
2518 | public static bool is_sound_playing (Sound sound);
2519 |
2520 | [CCode (cname = "SetSoundVolume")]
2521 | public static void set_sound_volume (Sound sound, float volume);
2522 |
2523 | [CCode (cname = "SetSoundPitch")]
2524 | public static void set_sound_pitch (Sound sound, float pitch);
2525 |
2526 | [CCode (cname = "SetSoundPan")]
2527 | public static void set_sound_pan (Sound sound, float pan);
2528 |
2529 | [CCode (cname = "WaveCopy")]
2530 | public static Wave wave_copy (Wave wave);
2531 |
2532 | [CCode (cname = "WaveCrop")]
2533 | public static void wave_crop (Wave? wave, int initial_sample, int final_sample);
2534 |
2535 | [CCode (cname = "WaveFormat")]
2536 | public static void wave_format (Wave? wave, int sample_rate, int sample_size, int channels);
2537 |
2538 | [CCode (cname = "LoadWaveSamples")]
2539 | public static float[] load_wave_samples (Wave wave);
2540 |
2541 | [CCode (cname = "UnloadWaveSamples")]
2542 | public static void unload_wave_samples (float* samples);
2543 |
2544 | // Music management functions
2545 | [CCode (cname = "LoadMusicStream")]
2546 | public static Music load_music_stream (string filename);
2547 |
2548 | [CCode (cname = "LoadMusicStreamFromMemory")]
2549 | public static Music load_music_stream_from_memory (string file_type, uchar[] data);
2550 |
2551 | [CCode (cname = "IsMusicReady")]
2552 | public static bool is_music_ready (Music music);
2553 |
2554 | [CCode (cname = "UnloadMusicStream")]
2555 | public static void unload_music_stream (Music music);
2556 |
2557 | [CCode (cname = "PlayMusicStream")]
2558 | public static void play_music_stream (Music music);
2559 |
2560 | [CCode (cname = "IsMusicStreamPlaying")]
2561 | public static bool is_music_stream_playing (Music music);
2562 |
2563 | [CCode (cname = "UpdateMusicStream")]
2564 | public static void update_music_stream (Music music);
2565 |
2566 | [CCode (cname = "StopMusicStream")]
2567 | public static void stop_music_stream (Music music);
2568 |
2569 | [CCode (cname = "PauseMusicStream")]
2570 | public static void pause_music_stream (Music music);
2571 |
2572 | [CCode (cname = "ResumeMusicStream")]
2573 | public static void resume_music_stream (Music music);
2574 |
2575 | [CCode (cname = "SeekMusicStream")]
2576 | public static void seek_music_stream (Music music, float position);
2577 |
2578 | [CCode (cname = "SetMusicVolume")]
2579 | public static void set_music_volume (Music music, float volume);
2580 |
2581 | [CCode (cname = "SetMusicPitch")]
2582 | public static void set_music_pitch (Music music, float pitch);
2583 |
2584 | [CCode (cname = "SetMusicPan")]
2585 | public static void set_music_pan (Music music, float pan);
2586 |
2587 | [CCode (cname = "GetMusicTimeLength")]
2588 | public static float get_music_time_length (Music music);
2589 |
2590 | [CCode (cname = "GetMusicTimePlayed")]
2591 | public static float get_music_time_played (Music music);
2592 |
2593 | // AudioStream management functions
2594 | [CCode (cname = "LoadAudioStream")]
2595 | public static AudioStream load_audio_stream (uint sample_rate, uint sample_size, uint channels);
2596 |
2597 | [CCode (cname = "IsAudioStreamReady")]
2598 | public static bool is_audio_stream_ready (AudioStream stream);
2599 |
2600 | [CCode (cname = "UnloadAudioStream")]
2601 | public static void unload_audio_stream (AudioStream stream);
2602 |
2603 | [CCode (cname = "UpdateAudioStream")]
2604 | public static void update_audio_stream (AudioStream stream, void* data, int frame_count);
2605 |
2606 | [CCode (cname = "IsAudioStreamProcessed")]
2607 | public static bool is_audio_stream_processed (AudioStream stream);
2608 |
2609 | [CCode (cname = "PlayAudioStream")]
2610 | public static void play_audio_stream (AudioStream stream);
2611 |
2612 | [CCode (cname = "PauseAudioStream")]
2613 | public static void pause_audio_stream (AudioStream stream);
2614 |
2615 | [CCode (cname = "ResumeAudioStream")]
2616 | public static void resume_audio_stream (AudioStream stream);
2617 |
2618 | [CCode (cname = "IsAudioStreamPlaying")]
2619 | public static bool is_audio_stream_playing (AudioStream stream);
2620 |
2621 | [CCode (cname = "StopAudioStream")]
2622 | public static void stop_audio_stream (AudioStream stream);
2623 |
2624 | [CCode (cname = "SetAudioStreamVolume")]
2625 | public static void set_audio_stream_volume (AudioStream stream, float volume);
2626 |
2627 | [CCode (cname = "SetAudioStreamPitch")]
2628 | public static void set_audio_stream_pitch (AudioStream stream, float pitch);
2629 |
2630 | [CCode (cname = "SetAudioStreamPan")]
2631 | public static void set_audio_stream_pan (AudioStream stream, float pan);
2632 |
2633 | [CCode (cname = "SetAudioStreamBufferSizeDefault")]
2634 | public static void set_audio_stream_buffer_size_default (int size);
2635 |
2636 | [CCode (cname = "SetAudioStreamCallback")]
2637 | public static void set_audio_stream_callback (AudioStream stream, AudioCallback callback);
2638 |
2639 |
2640 | [CCode (cname = "AttachAudioStreamProcessor")]
2641 | public static void attach_audio_stream_processor (AudioStream stream, AudioCallback processor);
2642 |
2643 | [CCode (cname = "DetachAudioStreamProcessor")]
2644 | public static void detach_audio_stream_processor (AudioStream stream, AudioCallback processor);
2645 |
2646 |
2647 | [CCode (cname = "AttachAudioMixedProcessor")]
2648 | public static void attach_audio_mixed_processor (AudioCallback processor);
2649 |
2650 | [CCode (cname = "DetachAudioMixedProcessor")]
2651 | public static void detach_audio_mixed_processor (AudioCallback processor);
2652 | }
2653 |
--------------------------------------------------------------------------------
/vapi/rini.vapi:
--------------------------------------------------------------------------------
1 | [Version (experimental = true)]
2 | [CCode (cprefix = "", cheader_filename = "rini.h")]
3 | namespace Rini {
4 | [CCode (cname = "RINI_VERSION")]
5 | public const string VERSION;
6 |
7 | //----------------------------------------------------------------------------------
8 | // Defines and Macros
9 | //----------------------------------------------------------------------------------
10 | [CCode (cname = "RINI_MAX_LINE_SIZE")]
11 | public const int MAX_LINE_SIZE;
12 |
13 | [CCode (cname = "RINI_MAX_KEY_SIZE")]
14 | public const int MAX_KEY_SIZE;
15 |
16 | [CCode (cname = "RINI_MAX_TEXT_SIZE")]
17 | public const int MAX_TEXT_SIZE;
18 |
19 | [CCode (cname = "RINI_MAX_DESC_SIZE")]
20 | public const int MAX_DESC_SIZE;
21 |
22 | [CCode (cname = "RINI_MAX_VALUE_CAPACITY")]
23 | public const int MAX_VALUE_CAPACITY;
24 |
25 | [CCode (cname = "RINI_VALUE_DELIMITER")]
26 | public const char VALUE_DELIMITER;
27 |
28 | [CCode (cname = "RINI_LINE_COMMENT_DELIMITER")]
29 | public const char LINE_COMMENT_DELIMITER;
30 |
31 | [CCode (cname = "RINI_VALUE_COMMENTS_DELIMITER")]
32 | public const char VALUE_COMMENTS_DELIMITER;
33 |
34 | [CCode (cname = "RINI_LINE_SECTION_DELIMITER")]
35 | public const char LINE_SECTION_DELIMITER;
36 |
37 |
38 | //----------------------------------------------------------------------------------
39 | // Types and Structures Definition
40 | //----------------------------------------------------------------------------------
41 | [CCode (cname = "rini_config_value")]
42 | public struct ConfigValue {
43 | public char key[MAX_KEY_SIZE]; // Config value key identifier
44 | public char text[MAX_TEXT_SIZE]; // Config value text
45 | public char desc[MAX_DESC_SIZE]; // Config value description
46 | }
47 |
48 | [CCode (cname = "rini_config")]
49 | public struct RiniConfig {
50 | public ConfigValue[] values; // Config values array
51 | public uint count; // Config values count
52 | public uint capacity; // Config values capacity
53 | }
54 |
55 |
56 | //------------------------------------------------------------------------------------
57 | // Functions declaration
58 | //------------------------------------------------------------------------------------
59 | [CCode (cname = "rini_load_config")]
60 | public static RiniConfig load_config (string filename); // Load config from file (*.ini) or create a new config object (pass NULL)
61 |
62 | [CCode (cname = "rini_unload_config")]
63 | public static void unload_config (RiniConfig config); // Unload config data from memory
64 |
65 | [CCode (cname = "rini_save_config")]
66 | public static void save_config (RiniConfig config, string filename, string header); // Save config to file, with custom header
67 |
68 |
69 | [CCode (cname = "rini_get_config_value")]
70 | public static int get_config_value (RiniConfig config, string key); // Get config value int for provided key, returns -1 if not found
71 |
72 | [CCode (cname = "rini_get_config_value_text")]
73 | public static string get_config_value_text (RiniConfig config, string key); // Get config value text for provided key
74 |
75 | [CCode (cname = "rini_get_config_value_description")]
76 | public static string get_config_value_description (RiniConfig config, string key); // Get config value description for provided key
77 |
78 |
79 | // Set config value int/text and description for existing key or create a new entry
80 | // NOTE: When setting a text value, if id does not exist, a new entry is automatically created
81 | [CCode (cname = "rini_set_config_value")]
82 | public static int set_config_value (RiniConfig config, string key, int value, string description);
83 |
84 | [CCode (cname = "rini_set_config_value_text")]
85 | public static int set_config_value_text (RiniConfig config, string key, string text, string description);
86 |
87 |
88 | // Set config value description for existing key
89 | // WARNING: Key must exist to add description, if a description exists, it is updated
90 | [CCode (cname = "rini_set_config_value_description")]
91 | public static int set_config_value_description (RiniConfig config, string key, string description);
92 | }
93 |
--------------------------------------------------------------------------------
/vapi/rlgl.vapi:
--------------------------------------------------------------------------------
1 | [Version (experimental = true)]
2 | [CCode (cprefix = "", cheader_filename = "rlgl.h")]
3 | namespace Rlgl {
4 | [CCode (cname = "RLGL_VERSION")]
5 | public const string VERSION;
6 |
7 | //----------------------------------------------------------------------------------
8 | // Defines and Macros
9 | //----------------------------------------------------------------------------------
10 |
11 | [CCode (cname = "RL_DEFAULT_BATCH_BUFFER_ELEMENTS")]
12 | public const int DEFAULT_BATCH_BUFFER_ELEMENTS; // Default internal render batch elements limits
13 |
14 | [CCode (cname = "RL_DEFAULT_BATCH_BUFFERS")]
15 | public const int DEFAULT_BATCH_BUFFERS; // Default number of batch buffers (multi-buffering)
16 |
17 | [CCode (cname = "RL_DEFAULT_BATCH_DRAWCALLS")]
18 | public const int DEFAULT_BATCH_DRAWCALLS; // Default number of batch draw calls (by state changes: mode, texture)
19 |
20 | [CCode (cname = "RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS")]
21 | public const int DEFAULT_BATCH_MAX_TEXTURE_UNITS; // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
22 |
23 |
24 | // Internal Matrix stack
25 | [CCode (cname = "RL_MAX_MATRIX_STACK_SIZE")]
26 | public const int MAX_MATRIX_STACK_SIZE; // Maximum size of Matrix stack
27 |
28 |
29 | // Shader limits
30 | [CCode (cname = "RL_MAX_SHADER_LOCATIONS")]
31 | public const int MAX_SHADER_LOCATIONS; // Maximum number of shader locations supported
32 |
33 |
34 | // Projection matrix culling
35 | [CCode (cname = "RL_CULL_DISTANCE_NEAR")]
36 | public const int CULL_DISTANCE_NEAR; // Default near cull distance
37 |
38 | [CCode (cname = "RL_CULL_DISTANCE_FAR")]
39 | public const int CULL_DISTANCE_FAR; // Default far cull distance
40 |
41 |
42 | // Texture parameters (equivalent to OpenGL defines)
43 | [CCode (cname = "RL_TEXTURE_WRAP_S")]
44 | public const int TEXTURE_WRAP_S; // GL_TEXTURE_WRAP_S
45 |
46 | [CCode (cname = "RL_TEXTURE_WRAP_T")]
47 | public const int TEXTURE_WRAP_T; // GL_TEXTURE_WRAP_T
48 |
49 | [CCode (cname = "RL_TEXTURE_MAG_FILTER")]
50 | public const int TEXTURE_MAG_FILTER; // GL_TEXTURE_MAG_FILTER
51 |
52 | [CCode (cname = "RL_TEXTURE_MIN_FILTER")]
53 | public const int TEXTURE_MIN_FILTER; // GL_TEXTURE_MIN_FILTER
54 |
55 |
56 | [CCode (cname = "RL_TEXTURE_FILTER_NEAREST")]
57 | public const int TEXTURE_FILTER_NEAREST; // GL_NEAREST
58 |
59 | [CCode (cname = "RL_TEXTURE_FILTER_LINEAR")]
60 | public const int TEXTURE_FILTER_LINEAR; // GL_LINEAR
61 |
62 | [CCode (cname = "RL_TEXTURE_FILTER_MIP_NEAREST")]
63 | public const int TEXTURE_FILTER_MIP_NEAREST; // GL_NEAREST_MIPMAP_NEAREST
64 |
65 | [CCode (cname = "RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR")]
66 | public const int TEXTURE_FILTER_NEAREST_MIP_LINEAR; // GL_NEAREST_MIPMAP_LINEAR
67 |
68 | [CCode (cname = "RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST")]
69 | public const int TEXTURE_FILTER_LINEAR_MIP_NEAREST; // GL_LINEAR_MIPMAP_NEAREST
70 |
71 | [CCode (cname = "RL_TEXTURE_FILTER_MIP_LINEAR")]
72 | public const int TEXTURE_FILTER_MIP_LINEAR; // GL_LINEAR_MIPMAP_LINEAR
73 |
74 | [CCode (cname = "RL_TEXTURE_FILTER_ANISOTROPIC")]
75 | public const int TEXTURE_FILTER_ANISOTROPIC; // Anisotropic filter (custom identifier)
76 |
77 | [CCode (cname = "RL_TEXTURE_MIPMAP_BIAS_RATIO")]
78 | public const int TEXTURE_MIPMAP_BIAS_RATIO; // Texture mipmap bias, percentage ratio (custom identifier)
79 |
80 |
81 | [CCode (cname = "RL_TEXTURE_WRAP_REPEAT")]
82 | public const int TEXTURE_WRAP_REPEAT; // GL_REPEAT
83 |
84 | [CCode (cname = "RL_TEXTURE_WRAP_CLAMP")]
85 | public const int TEXTURE_WRAP_CLAMP; // GL_CLAMP_TO_EDGE
86 |
87 | [CCode (cname = "RL_TEXTURE_WRAP_MIRROR_REPEAT")]
88 | public const int TEXTURE_WRAP_MIRROR_REPEAT; // GL_MIRRORED_REPEAT
89 |
90 | [CCode (cname = "RL_TEXTURE_WRAP_MIRROR_CLAMP")]
91 | public const int TEXTURE_WRAP_MIRROR_CLAMP; // GL_MIRROR_CLAMP_EXT
92 |
93 | // Matrix modes (equivalent to OpenGL)
94 | [CCode (cname = "RL_MODELVIEW")]
95 | public const int MODELVIEW; // GL_MODELVIEW
96 |
97 | [CCode (cname = "RL_PROJECTION")]
98 | public const int PROJECTION; // GL_PROJECTION
99 |
100 | [CCode (cname = "RL_TEXTURE")]
101 | public const int TEXTURE; // GL_TEXTURE
102 |
103 | // Primitive assembly draw modes
104 | [CCode (cname = "RL_LINES")]
105 | public const int LINES; // GL_LINES
106 |
107 | [CCode (cname = "RL_TRIANGLES")]
108 | public const int TRIANGLES; // GL_TRIANGLES
109 |
110 | [CCode (cname = "RL_QUADS")]
111 | public const int QUADS; // GL_QUADS
112 |
113 | // GL equivalent data types
114 | [CCode (cname = "RL_UNSIGNED_BYTE")]
115 | public const int UNSIGNED_BYTE; // GL_UNSIGNED_BYTE
116 |
117 | [CCode (cname = "RL_FLOAT")]
118 | public const int FLOAT; // GL_FLOAT
119 |
120 | // GL buffer usage hint
121 | [CCode (cname = "RL_STREAM_DRAW")]
122 | public const int STREAM_DRAW; // GL_STREAM_DRAW
123 |
124 | [CCode (cname = "RL_STREAM_READ")]
125 | public const int STREAM_READ; // GL_STREAM_READ
126 |
127 | [CCode (cname = "RL_STREAM_COPY")]
128 | public const int STREAM_COPY; // GL_STREAM_COPY
129 |
130 | [CCode (cname = "RL_STATIC_DRAW")]
131 | public const int STATIC_DRAW; // GL_STATIC_DRAW
132 |
133 | [CCode (cname = "RL_STATIC_READ")]
134 | public const int STATIC_READ; // GL_STATIC_READ
135 |
136 | [CCode (cname = "RL_STATIC_COPY")]
137 | public const int STATIC_COPY; // GL_STATIC_COPY
138 |
139 | [CCode (cname = "RL_DYNAMIC_DRAW")]
140 | public const int DYNAMIC_DRAW; // GL_DYNAMIC_DRAW
141 |
142 | [CCode (cname = "RL_DYNAMIC_READ")]
143 | public const int DYNAMIC_READ; // GL_DYNAMIC_READ
144 |
145 | [CCode (cname = "RL_DYNAMIC_COPY")]
146 | public const int DYNAMIC_COPY; // GL_DYNAMIC_COPY
147 |
148 | // GL Shader type
149 | [CCode (cname = "RL_FRAGMENT_SHADER")]
150 | public const int FRAGMENT_SHADER; // GL_FRAGMENT_SHADER
151 |
152 | [CCode (cname = "RL_VERTEX_SHADER")]
153 | public const int VERTEX_SHADER; // GL_VERTEX_SHADER
154 |
155 | [CCode (cname = "RL_COMPUTE_SHADER")]
156 | public const int COMPUTE_SHADER; // GL_COMPUTE_SHADER
157 |
158 | // GL blending factors
159 | [CCode (cname = "RL_ZERO")]
160 | public const int ZERO; // GL_ZERO
161 |
162 | [CCode (cname = "RL_ONE")]
163 | public const int ONE; // GL_ONE
164 |
165 | [CCode (cname = "RL_SRC_COLOR")]
166 | public const int SRC_COLOR; // GL_SRC_COLOR
167 |
168 | [CCode (cname = "RL_ONE_MINUS_SRC_COLOR")]
169 | public const int ONE_MINUS_SRC_COLOR; // GL_ONE_MINUS_SRC_COLOR
170 |
171 | [CCode (cname = "RL_SRC_ALPHA")]
172 | public const int SRC_ALPHA; // GL_SRC_ALPHA
173 |
174 | [CCode (cname = "RL_ONE_MINUS_SRC_ALPHA")]
175 | public const int ONE_MINUS_SRC_ALPHA; // GL_ONE_MINUS_SRC_ALPHA
176 |
177 | [CCode (cname = "RL_DST_ALPHA")]
178 | public const int DST_ALPHA; // GL_DST_ALPHA
179 |
180 | [CCode (cname = "RL_ONE_MINUS_DST_ALPHA")]
181 | public const int ONE_MINUS_DST_ALPHA; // GL_ONE_MINUS_DST_ALPHA
182 |
183 | [CCode (cname = "RL_DST_COLOR")]
184 | public const int DST_COLOR; // GL_DST_COLOR
185 |
186 | [CCode (cname = "RL_ONE_MINUS_DST_COLOR")]
187 | public const int ONE_MINUS_DST_COLOR; // GL_ONE_MINUS_DST_COLOR
188 |
189 | [CCode (cname = "RL_SRC_ALPHA_SATURATE")]
190 | public const int SRC_ALPHA_SATURATE; // GL_SRC_ALPHA_SATURATE
191 |
192 | [CCode (cname = "RL_CONSTANT_COLOR")]
193 | public const int CONSTANT_COLOR; // GL_CONSTANT_COLOR
194 |
195 | [CCode (cname = "RL_ONE_MINUS_CONSTANT_COLOR")]
196 | public const int ONE_MINUS_CONSTANT_COLOR; // GL_ONE_MINUS_CONSTANT_COLOR
197 |
198 | [CCode (cname = "RL_CONSTANT_ALPHA")]
199 | public const int CONSTANT_ALPHA; // GL_CONSTANT_ALPHA
200 |
201 | [CCode (cname = "RL_ONE_MINUS_CONSTANT_ALPHA")]
202 | public const int ONE_MINUS_CONSTANT_ALPHA; // GL_ONE_MINUS_CONSTANT_ALPHA
203 |
204 | // GL blending functions/equations
205 | [CCode (cname = "RL_FUNC_ADD")]
206 | public const int FUNC_ADD; // GL_FUNC_ADD
207 |
208 | [CCode (cname = "RL_MIN")]
209 | public const int MIN; // GL_MIN
210 |
211 | [CCode (cname = "RL_MAX")]
212 | public const int MAX; // GL_MAX
213 |
214 | [CCode (cname = "RL_FUNC_SUBTRACT")]
215 | public const int FUNC_SUBTRACT; // GL_FUNC_SUBTRACT
216 |
217 | [CCode (cname = "RL_FUNC_REVERSE_SUBTRACT")]
218 | public const int FUNC_REVERSE_SUBTRACT; // GL_FUNC_REVERSE_SUBTRACT
219 |
220 | [CCode (cname = "RL_BLEND_EQUATION")]
221 | public const int BLEND_EQUATION; // GL_BLEND_EQUATION
222 |
223 | [CCode (cname = "RL_BLEND_EQUATION_RGB")]
224 | public const int BLEND_EQUATION_RGB; // GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)
225 |
226 | [CCode (cname = "RL_BLEND_EQUATION_ALPHA")]
227 | public const int BLEND_EQUATION_ALPHA; // GL_BLEND_EQUATION_ALPHA
228 |
229 | [CCode (cname = "RL_BLEND_DST_RGB")]
230 | public const int BLEND_DST_RGB; // GL_BLEND_DST_RGB
231 |
232 | [CCode (cname = "RL_BLEND_SRC_RGB")]
233 | public const int BLEND_SRC_RGB; // GL_BLEND_SRC_RGB
234 |
235 | [CCode (cname = "RL_BLEND_DST_ALPHA")]
236 | public const int BLEND_DST_ALPHA; // GL_BLEND_DST_ALPHA
237 |
238 | [CCode (cname = "RL_BLEND_SRC_ALPHA")]
239 | public const int BLEND_SRC_ALPHA; // GL_BLEND_SRC_ALPHA
240 |
241 | [CCode (cname = "RL_BLEND_COLOR")]
242 | public const int BLEND_COLOR; // GL_BLEND_COLOR
243 |
244 | //----------------------------------------------------------------------------------
245 | // Types and Structures Definition
246 | //----------------------------------------------------------------------------------
247 | [SimpleType]
248 | [CCode (cname = "Matrix")]
249 | public struct Matrix {
250 | public float m0;
251 | public float m4;
252 | public float m8;
253 | public float m12;
254 |
255 | public float m1;
256 | public float m5;
257 | public float m9;
258 | public float m13;
259 |
260 | public float m2;
261 | public float m6;
262 | public float m10;
263 | public float m14;
264 |
265 | public float m3;
266 | public float m7;
267 | public float m11;
268 | public float m15;
269 | }
270 |
271 | // Dynamic vertex buffers (position + texcoords + colors + indices arrays)
272 | [SimpleType]
273 | [CCode (cname = "rlVertexBuffer")]
274 | public struct VertexBuffer {
275 | public int elementCount; // Number of elements in the buffer (QUADS)
276 |
277 | public unowned float[] vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
278 | public unowned float[] texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
279 | public unowned uchar[] colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
280 | public unowned ushort[] indices; // Vertex indices (in case vertex data comes indexed) (6 indices per quad)
281 |
282 | public uint vaoId; // OpenGL Vertex Array Object id
283 | public unowned uint vboId[4]; // OpenGL Vertex Buffer Objects id (4 types of vertex data)
284 | }
285 |
286 | // Draw call type
287 | [SimpleType]
288 | [CCode (cname = "rlDrawCall")]
289 | public struct DrawCall {
290 | public int mode; // Drawing mode: LINES, TRIANGLES, QUADS
291 | public int vertexCount; // Number of vertex of the draw
292 | public int vertexAlignment; // Number of vertex required for index alignment (LINES, TRIANGLES)
293 | public uint textureId; // Texture id to be used on the draw -> Use to create new draw call if changes
294 | }
295 |
296 | // rlRenderBatch type
297 | [SimpleType]
298 | [CCode (cname = "rlRenderBatch")]
299 | public struct RenderBatch {
300 | public int bufferCount; // Number of vertex buffers (multi-buffering support)
301 | public int currentBuffer; // Current buffer tracking in case of multi-buffering
302 | public unowned VertexBuffer[] vertexBuffer; // Dynamic buffer(s) for vertex data
303 |
304 | public unowned DrawCall[] draws; // Draw calls array, depends on textureId
305 | public int drawCounter; // Draw calls counter
306 | public float currentDepth; // Current depth value for next draw
307 | }
308 |
309 | // OpenGL version
310 | [CCode (cname = "rlGlVersion", has_type_id = false, cprefix="RL_")]
311 | public enum GlVersion {
312 | OPENGL_11, // OpenGL 1.1
313 | OPENGL_21, // OpenGL 2.1 (GLSL 120)
314 | OPENGL_33, // OpenGL 3.3 (GLSL 330)
315 | OPENGL_43, // OpenGL 4.3 (using GLSL 330)
316 | OPENGL_ES_20 // OpenGL ES 2.0 (GLSL 100)
317 | }
318 |
319 | // Trace log level
320 | [CCode (cname = "rlTraceLogLevel", has_type_id = false, cprefix="RL_")]
321 | public enum TraceLogLevel {
322 | LOG_ALL, // Display all logs
323 | LOG_TRACE, // Trace logging, intended for internal use only
324 | LOG_DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds
325 | LOG_INFO, // Info logging, used for program execution info
326 | LOG_WARNING, // Warning logging, used on recoverable failures
327 | LOG_ERROR, // Error logging, used on unrecoverable failures
328 | LOG_FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE)
329 | LOG_NONE // Disable logging
330 | }
331 |
332 | // Texture pixel formats
333 | [CCode (cname = "rlPixelFormat", has_type_id = false, cprefix="RL_")]
334 | public enum PixelFormat {
335 | PIXELFORMAT_UNCOMPRESSED_GRAYSCALE, // 8 bit per pixel (no alpha)
336 | PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels)
337 | PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp
338 | PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp
339 | PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha)
340 | PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha)
341 | PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp
342 | PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
343 | PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
344 | PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
345 | PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
346 | PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
347 | PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp
348 | PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp
349 | PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp
350 | PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp
351 | PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp
352 | PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp
353 | PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp
354 | PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp
355 | PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp
356 | }
357 |
358 | // Texture parameters: filter mode
359 | [CCode (cname = "rlTextureFilter", has_type_id = false, cprefix="RL_")]
360 | public enum TextureFilter {
361 | TEXTURE_FILTER_POINT, // No filter, just pixel approximation
362 | TEXTURE_FILTER_BILINEAR, // Linear filtering
363 | TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps)
364 | TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x
365 | TEXTURE_FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x
366 | TEXTURE_FILTER_ANISOTROPIC_16X // Anisotropic filtering 16x
367 | }
368 |
369 | // Color blending modes (pre-defined)
370 | [CCode (cname = "rlBlendMode", has_type_id = false, cprefix="RL_")]
371 | public enum BlendMode {
372 | BLEND_ALPHA, // Blend textures considering alpha (default)
373 | BLEND_ADDITIVE, // Blend textures adding colors
374 | BLEND_MULTIPLIED, // Blend textures multiplying colors
375 | BLEND_ADD_COLORS, // Blend textures adding colors (alternative)
376 | BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative)
377 | BLEND_ALPHA_PREMULTIPLY, // Blend premultiplied textures considering alpha
378 | BLEND_CUSTOM, // Blend textures using custom src/dst factors (use rlSetBlendFactors())
379 | BLEND_CUSTOM_SEPARATE // Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
380 | }
381 |
382 | // Shader location point type
383 | [CCode (cname = "rlShaderLocationIndex", has_type_id = false, cprefix="RL_")]
384 | public enum ShaderLocationIndex {
385 | SHADER_LOC_VERTEX_POSITION, // Shader location: vertex attribute: position
386 | SHADER_LOC_VERTEX_TEXCOORD01, // Shader location: vertex attribute: texcoord01
387 | SHADER_LOC_VERTEX_TEXCOORD02, // Shader location: vertex attribute: texcoord02
388 | SHADER_LOC_VERTEX_NORMAL, // Shader location: vertex attribute: normal
389 | SHADER_LOC_VERTEX_TANGENT, // Shader location: vertex attribute: tangent
390 | SHADER_LOC_VERTEX_COLOR, // Shader location: vertex attribute: color
391 | SHADER_LOC_MATRIX_MVP, // Shader location: matrix uniform: model-view-projection
392 | SHADER_LOC_MATRIX_VIEW, // Shader location: matrix uniform: view (camera transform)
393 | SHADER_LOC_MATRIX_PROJECTION, // Shader location: matrix uniform: projection
394 | SHADER_LOC_MATRIX_MODEL, // Shader location: matrix uniform: model (transform)
395 | SHADER_LOC_MATRIX_NORMAL, // Shader location: matrix uniform: normal
396 | SHADER_LOC_VECTOR_VIEW, // Shader location: vector uniform: view
397 | SHADER_LOC_COLOR_DIFFUSE, // Shader location: vector uniform: diffuse color
398 | SHADER_LOC_COLOR_SPECULAR, // Shader location: vector uniform: specular color
399 | SHADER_LOC_COLOR_AMBIENT, // Shader location: vector uniform: ambient color
400 | SHADER_LOC_MAP_ALBEDO, // Shader location: sampler2d texture: albedo (same as: RL_SHADER_LOC_MAP_DIFFUSE)
401 | SHADER_LOC_MAP_METALNESS, // Shader location: sampler2d texture: metalness (same as: RL_SHADER_LOC_MAP_SPECULAR)
402 | SHADER_LOC_MAP_NORMAL, // Shader location: sampler2d texture: normal
403 | SHADER_LOC_MAP_ROUGHNESS, // Shader location: sampler2d texture: roughness
404 | SHADER_LOC_MAP_OCCLUSION, // Shader location: sampler2d texture: occlusion
405 | SHADER_LOC_MAP_EMISSION, // Shader location: sampler2d texture: emission
406 | SHADER_LOC_MAP_HEIGHT, // Shader location: sampler2d texture: height
407 | SHADER_LOC_MAP_CUBEMAP, // Shader location: samplerCube texture: cubemap
408 | SHADER_LOC_MAP_IRRADIANCE, // Shader location: samplerCube texture: irradiance
409 | SHADER_LOC_MAP_PREFILTER, // Shader location: samplerCube texture: prefilter
410 | SHADER_LOC_MAP_BRDF // Shader location: sampler2d texture: brdf
411 | }
412 |
413 |
414 | [CCode (cname = "RL_SHADER_LOC_MAP_DIFFUSE")]
415 | public const int SHADER_LOC_MAP_DIFFUSE;
416 |
417 | [CCode (cname = "RL_SHADER_LOC_MAP_SPECULAR")]
418 | public const int SHADER_LOC_MAP_SPECULAR;
419 |
420 |
421 | // Shader uniform data type
422 | [CCode (cname = "rlShaderUniformDataType", has_type_id = false)]
423 | public enum ShaderUniformDataType {
424 | SHADER_UNIFORM_FLOAT, // Shader uniform type: float
425 | SHADER_UNIFORM_VEC2, // Shader uniform type: vec2 (2 float)
426 | SHADER_UNIFORM_VEC3, // Shader uniform type: vec3 (3 float)
427 | SHADER_UNIFORM_VEC4, // Shader uniform type: vec4 (4 float)
428 | SHADER_UNIFORM_INT, // Shader uniform type: int
429 | SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int)
430 | SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int)
431 | SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int)
432 | SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d
433 | }
434 |
435 | // Shader attribute data types
436 | [CCode (cname = "rlShaderAttributeDataType", has_type_id = false)]
437 | public enum ShaderAttributeDataType {
438 | SHADER_ATTRIB_FLOAT, // Shader attribute type: float
439 | SHADER_ATTRIB_VEC2, // Shader attribute type: vec2 (2 float)
440 | SHADER_ATTRIB_VEC3, // Shader attribute type: vec3 (3 float)
441 | SHADER_ATTRIB_VEC4 // Shader attribute type: vec4 (4 float)
442 | }
443 |
444 | // Framebuffer attachment type
445 | [CCode (cname = "rlFramebufferAttachType", has_type_id = false)]
446 | public enum FramebufferAttachType {
447 | ATTACHMENT_COLOR_CHANNEL0, // Framebuffer attachment type: color 0
448 | ATTACHMENT_COLOR_CHANNEL1, // Framebuffer attachment type: color 1
449 | ATTACHMENT_COLOR_CHANNEL2, // Framebuffer attachment type: color 2
450 | ATTACHMENT_COLOR_CHANNEL3, // Framebuffer attachment type: color 3
451 | ATTACHMENT_COLOR_CHANNEL4, // Framebuffer attachment type: color 4
452 | ATTACHMENT_COLOR_CHANNEL5, // Framebuffer attachment type: color 5
453 | ATTACHMENT_COLOR_CHANNEL6, // Framebuffer attachment type: color 6
454 | ATTACHMENT_COLOR_CHANNEL7, // Framebuffer attachment type: color 7
455 | ATTACHMENT_DEPTH, // Framebuffer attachment type: depth
456 | ATTACHMENT_STENCIL // Framebuffer attachment type: stencil
457 | }
458 |
459 | // Framebuffer texture attachment type
460 | [CCode (cname = "rlFramebufferAttachTextureType", has_type_id = false)]
461 | public enum FramebufferAttachTextureType {
462 | ATTACHMENT_CUBEMAP_POSITIVE_X, // Framebuffer texture attachment type: cubemap, +X side
463 | ATTACHMENT_CUBEMAP_NEGATIVE_X, // Framebuffer texture attachment type: cubemap, -X side
464 | ATTACHMENT_CUBEMAP_POSITIVE_Y, // Framebuffer texture attachment type: cubemap, +Y side
465 | ATTACHMENT_CUBEMAP_NEGATIVE_Y, // Framebuffer texture attachment type: cubemap, -Y side
466 | ATTACHMENT_CUBEMAP_POSITIVE_Z, // Framebuffer texture attachment type: cubemap, +Z side
467 | ATTACHMENT_CUBEMAP_NEGATIVE_Z, // Framebuffer texture attachment type: cubemap, -Z side
468 | ATTACHMENT_TEXTURE2D, // Framebuffer texture attachment type: texture2d
469 | ATTACHMENT_RENDERBUFFER // Framebuffer texture attachment type: renderbuffer
470 | }
471 |
472 | // Face culling mode
473 | [CCode (cname = "rlCullMode", has_type_id = false)]
474 | public enum CullMode {
475 | RL_CULL_FACE_FRONT,
476 | RL_CULL_FACE_BACK
477 | }
478 |
479 | //------------------------------------------------------------------------------------
480 | // Functions Declaration - Matrix operations
481 | //------------------------------------------------------------------------------------
482 | [CCode (cname = "rlMatrixMode")]
483 | public static void rl_matrix_mode (int mode); // Choose the current matrix to be transformed
484 |
485 | [CCode (cname = "rlPushMatrix")]
486 | public static void rl_push_matrix (); // Push the current matrix to stack
487 |
488 | [CCode (cname = "rlPopMatrix")]
489 | public static void rl_pop_matrix (); // Pop latest inserted matrix from stack
490 |
491 | [CCode (cname = "rlLoadIdentity")]
492 | public static void rl_load_identity (); // Reset current matrix to identity matrix
493 |
494 | [CCode (cname = "rlTranslatef")]
495 | public static void rl_translatef (float x, float y, float z); // Multiply the current matrix by a translation matrix
496 |
497 | [CCode (cname = "rlRotatef")]
498 | public static void rl_rotatref (float angle, float x, float y, float z); // Multiply the current matrix by a rotation matrix
499 |
500 | [CCode (cname = "rlScalef")]
501 | public static void rl_scalef (float x, float y, float z); // Multiply the current matrix by a scaling matrix
502 |
503 | [CCode (cname = "rlMultMatrixf")]
504 | public static void rl_multiply_matrixf (float[] matrixf); // Multiply the current matrix by another matrix
505 |
506 | [CCode (cname = "rlFrustum")]
507 | public static void rl_frustum (double left, double right, double bottom, double top, double znear, double zfar);
508 |
509 | [CCode (cname = "rlOrtho")]
510 | public static void rl_ortho (double left, double right, double bottom, double top, double znear, double zfar);
511 |
512 | [CCode (cname = "rlViewport")]
513 | public static void rl_viewport (int x, int y, int width, int height); // Set the viewport area
514 |
515 | //------------------------------------------------------------------------------------
516 | // Functions Declaration - Vertex level operations
517 | //------------------------------------------------------------------------------------
518 | [CCode (cname = "rlBegin")]
519 | public static void rl_begin (int mode); // Initialize drawing mode (how to organize vertex)
520 |
521 | [CCode (cname = "rlEnd")]
522 | public static void rl_end (); // Finish vertex providing
523 |
524 | [CCode (cname = "rlVertex2i")]
525 | public static void rl_vertex2i (int x, int y); // Define one vertex (position) - 2 int
526 |
527 | [CCode (cname = "rlVertex2f")]
528 | public static void rl_vertex2f (float x, float y); // Define one vertex (position) - 2 float
529 |
530 | [CCode (cname = "rlVertex3f")]
531 | public static void rl_vertex3f (float x, float y, float z); // Define one vertex (position) - 3 float
532 |
533 | [CCode (cname = "rlTexCoord2f")]
534 | public static void rl_tex_coord2f (float x, float y); // Define one vertex (texture coordinate) - 2 float
535 |
536 | [CCode (cname = "rlNormal3f")]
537 | public static void rl_normal3f (float x, float y, float z); // Define one vertex (normal) - 3 float
538 |
539 | [CCode (cname = "rlColor4ub")]
540 | public static void rl_color4ub (uchar r, uchar g, uchar b, uchar a); // Define one vertex (color) - 4 byte
541 |
542 | [CCode (cname = "rlColor3f")]
543 | public static void rl_color3f (float x, float y, float z); // Define one vertex (color) - 3 float
544 |
545 | [CCode (cname = "rlColor4f")]
546 | public static void rl_color4f (float x, float y, float z, float w); // Define one vertex (color) - 4 float
547 |
548 | //------------------------------------------------------------------------------------
549 | // Functions Declaration - OpenGL style functions (common to 1.1, 3.3+, ES2)
550 | // NOTE: This functions are used to completely abstract raylib code from OpenGL layer,
551 | // some of them are direct wrappers over OpenGL calls, some others are custom
552 | //------------------------------------------------------------------------------------
553 |
554 | // Vertex buffers state
555 | [CCode (cname = "rlEnableVertexArray")]
556 | public static bool rl_enable_vertex_array (uint vaoId); // Enable vertex array (VAO, if supported)
557 |
558 | [CCode (cname = "rlDisableVertexArray")]
559 | public static void rl_disable_vertex_array (); // Disable vertex array (VAO, if supported)
560 |
561 | [CCode (cname = "rlEnableVertexBuffer")]
562 | public static void rl_enable_vertex_buffer (uint id); // Enable vertex buffer (VBO)
563 |
564 | [CCode (cname = "rlDisableVertexBuffer")]
565 | public static void rl_disable_vertex_buffer (); // Disable vertex buffer (VBO)
566 |
567 | [CCode (cname = "rlEnableVertexBufferElement")]
568 | public static void rl_enable_vertex_buffer_element (uint id);// Enable vertex buffer element (VBO element)
569 |
570 | [CCode (cname = "rlDisableVertexBufferElement")]
571 | public static void rl_disable_vertex_buffer_element (); // Disable vertex buffer element (VBO element)
572 |
573 | [CCode (cname = "rlEnableVertexAttribute")]
574 | public static void rl_enable_vertex_attribute (uint index); // Enable vertex attribute index
575 |
576 | [CCode (cname = "rlDisableVertexAttribute")]
577 | public static void rl_disable_vertex_attribute (uint index);// Disable vertex attribute index
578 | #if GRAPHICS_API_OPENGL_11
579 | [CCode (cname = "rlEnableStatePointer")]
580 | public static void rl_enable_state_pointer (int attribute_type, void* buffer); // Enable attribute state pointer
581 |
582 | [CCode (cname = "rlDisableStatePointer")]
583 | public static void rl_disable_state_pointer (int attribute_type); // Disable attribute state pointer
584 | #endif
585 |
586 | // Textures state
587 | [CCode (cname = "rlActiveTextureSlot")]
588 | public static void rl_active_texture_slot (int slot); // Select and active a texture slot
589 |
590 | [CCode (cname = "rlEnableTexture")]
591 | public static void rl_enable_texture (uint id); // Enable texture
592 |
593 | [CCode (cname = "rlDisableTexture")]
594 | public static void rl_disable_texture (); // Disable texture
595 |
596 | [CCode (cname = "rlEnableTextureCubemap")]
597 | public static void rl_enable_texture_cubemap (uint id); // Enable texture cubemap
598 |
599 | [CCode (cname = "rlDisableTextureCubemap")]
600 | public static void rl_disable_texture_cubemap (); // Disable texture cubemap
601 |
602 | [CCode (cname = "rlTextureParameters")]
603 | public static void rl_texture_parameters (uint id, int parameter, int value); // Set texture parameters (filter, wrap)
604 |
605 | [CCode (cname = "rlCubemapParameters")]
606 | public static void rl_cubemap_parameters (uint id, int parameter, int value); // Set cubemap parameters (filter, wrap)
607 |
608 | // Shader state
609 | [CCode (cname = "rlEnableShader")]
610 | public static void rl_enable_shader (uint id); // Enable shader program
611 |
612 | [CCode (cname = "rlDisableShader")]
613 | public static void rl_disable_shader (); // Disable shader program
614 |
615 | // Framebuffer state
616 | [CCode (cname = "rlEnableFramebuffer")]
617 | public static void rl_enable_framebuffer (uint id); // Enable render texture (fbo)
618 |
619 | [CCode (cname = "rlDisableFramebuffer")]
620 | public static void rl_disable_framebuffer (); // Disable render texture (fbo), return to default framebuffer
621 |
622 | [CCode (cname = "rlActiveDrawBuffers")]
623 | public static void rl_active_draw_buffers (int count); // Activate multiple draw color buffers
624 |
625 | // General render state
626 | [CCode (cname = "rlEnableColorBlend")]
627 | public static void rl_enable_color_blend (); // Enable color blending
628 |
629 | [CCode (cname = "rlDisableColorBlend")]
630 | public static void rl_disable_color_blend (); // Disable color blending
631 |
632 | [CCode (cname = "rlEnableDepthTest")]
633 | public static void rl_enable_depth_test (); // Enable depth test
634 |
635 | [CCode (cname = "rlDisableDepthTest")]
636 | public static void rl_disable_depth_test (); // Disable depth test
637 |
638 | [CCode (cname = "rlEnableDepthMask")]
639 | public static void rl_enable_depth_mask (); // Enable depth write
640 |
641 | [CCode (cname = "rlDisableDepthMask")]
642 | public static void rl_disable_depth_mask (); // Disable depth write
643 |
644 | [CCode (cname = "rlEnableBackfaceCulling")]
645 | public static void rl_enable_backface_culling (); // Enable backface culling
646 |
647 | [CCode (cname = "rlDisableBackfaceCulling")]
648 | public static void rl_disable_backface_culling (); // Disable backface culling
649 |
650 | [CCode (cname = "rlSetCullFace")]
651 | public static void rl_set_cull_face (int mode); // Set face culling mode
652 |
653 | [CCode (cname = "rlEnableScissorTest")]
654 | public static void rl_enable_scissor_test (); // Enable scissor test
655 |
656 | [CCode (cname = "rlDisableScissorTest")]
657 | public static void rl_disable_scissor_test (); // Disable scissor test
658 |
659 | [CCode (cname = "rlScissor")]
660 | public static void rl_scissor (int x, int y, int width, int height); // Scissor test
661 |
662 | [CCode (cname = "rlEnableWireMode")]
663 | public static void rl_enable_wire_mode (); // Enable wire mode
664 |
665 | [CCode (cname = "rlDisableWireMode")]
666 | public static void rl_disable_wire_mode (); // Disable wire mode
667 |
668 | [CCode (cname = "rlSetLineWidth")]
669 | public static void rl_set_line_width (float width); // Set the line drawing width
670 |
671 | [CCode (cname = "rlGetLineWidth")]
672 | public static float rl_get_line_width (); // Get the line drawing width
673 |
674 | [CCode (cname = "rlEnableSmoothLines")]
675 | public static void rl_enable_smooth_lines (); // Enable line aliasing
676 |
677 | [CCode (cname = "rlDisableSmoothLines")]
678 | public static void rl_disable_smooth_lines (); // Disable line aliasing
679 |
680 | [CCode (cname = "rlEnableStereoRender")]
681 | public static void rl_enable_stereo_render (); // Enable stereo rendering
682 |
683 | [CCode (cname = "rlDisableStereoRender")]
684 | public static void rl_disable_stereo_render (); // Disable stereo rendering
685 |
686 | [CCode (cname = "rlIsStereoRenderEnabled")]
687 | public static bool rl_is_stereo_render_enabled (); // Check if stereo render is enabled
688 |
689 |
690 | [CCode (cname = "rlClearColor")]
691 | public static void rl_clear_color (uchar r, uchar g, uchar b, uchar a); // Clear color buffer with color
692 |
693 | [CCode (cname = "rlClearScreenBuffers")]
694 | public static void rl_clear_screen_buffers (); // Clear used screen buffers (color and depth)
695 |
696 | [CCode (cname = "rlCheckErrors")]
697 | public static void rl_check_errors (); // Check and log OpenGL error codes
698 |
699 | [CCode (cname = "rlSetBlendMode")]
700 | public static void rl_set_blend_mode (int mode); // Set blending mode
701 |
702 | [CCode (cname = "rlSetBlendFactors")]
703 | public static void rl_set_blend_factors (int source_factor, int desitination_factor, int equation); // Set blending mode factor and equation (using OpenGL factors)
704 |
705 | [CCode (cname = "rlSetBlendFactorsSeparate")]
706 | public static void rl_set_blend_factors_separate (int source_rgb, int destination_rgb, int source_alpha, int desitination_alpha, int eq_rgb, int eq_alpha); // Set blending mode factors and equations separately (using OpenGL factors)
707 |
708 | //------------------------------------------------------------------------------------
709 | // Functions Declaration - rlgl functionality
710 | //------------------------------------------------------------------------------------
711 | // rlgl initialization functions
712 | [CCode (cname = "rlglInit")]
713 | public static void rlgl_init (int width, int height); // Initialize rlgl (buffers, shaders, textures, states)
714 |
715 | [CCode (cname = "rlglClose")]
716 | public static void rlgl_close (); // De-initialize rlgl (buffers, shaders, textures)
717 |
718 | [CCode (cname = "rlLoadExtensions")]
719 | public static void rl_load_extensions (void* loader); // Load OpenGL extensions (loader function required)
720 |
721 | [CCode (cname = "rlGetVersion")]
722 | public static int get_version (); // Get current OpenGL version
723 |
724 | [CCode (cname = "rlSetFramebufferWidth")]
725 | public static void rl_set_framebuffer_width (int width); // Set current framebuffer width
726 |
727 | [CCode (cname = "rlGetFramebufferWidth")]
728 | public static int get_framebuffer_width (); // Get default framebuffer width
729 |
730 | [CCode (cname = "rlSetFramebufferHeight")]
731 | public static void rl_set_framebuffer_height (int height); // Set current framebuffer height
732 |
733 | [CCode (cname = "rlGetFramebufferHeight")]
734 | public static int get_framebuffer_height (); // Get default framebuffer height
735 |
736 |
737 | [CCode (cname = "rlGetTextureIdDefault")]
738 | public static uint get_texture_id_default (); // Get default texture id
739 |
740 | [CCode (cname = "rlGetlocashader_idDefault")]
741 | public static uint get_shader_id_default (); // Get default shader id
742 |
743 | [CCode (cname = "rlGetShaderLocsDefault")]
744 | public static int[] rl_get_shader_locations_default (); // Get default shader locations
745 |
746 | // Render batch management
747 | // NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode
748 | // but this render batch API is exposed in case of custom batches are required
749 | [CCode (cname = "rlLoadRenderBatch")]
750 | public static RenderBatch rl_load_render_batch (int buffer_count, int buffer_elements); // Load a render batch system
751 |
752 | [CCode (cname = "rlUnloadRenderBatch")]
753 | public static void rl_unload_render_batch (RenderBatch batch); // Unload render batch system
754 |
755 | [CCode (cname = "rlDrawRenderBatch")]
756 | public static void rl_draw_render_batch (RenderBatch batch); // Draw render batch data (Update->Draw->Reset)
757 |
758 | [CCode (cname = "rlSetRenderBatchActive")]
759 | public static void rl_set_render_batch_active (RenderBatch batch); // Set the active render batch for rlgl (NULL for default internal)
760 |
761 | [CCode (cname = "rlDrawRenderBatchActive")]
762 | public static void rl_draw_render_batch_active (); // Update and draw internal render batch
763 |
764 | [CCode (cname = "rlCheckRenderBatchLimit")]
765 | public static bool rl_check_render_batch_limit (int vertex_count); // Check internal buffer overflow for a given number of vertex
766 |
767 |
768 | [CCode (cname = "rlSetTexture")]
769 | public static void rl_set_texture (uint id); // Set current texture for render batch and check buffers limits
770 |
771 | //------------------------------------------------------------------------------------------------------------------------
772 | // Vertex buffers management
773 | [CCode (cname = "rlLoadVertexArray")]
774 | public static uint load_vertex_array (); // Load vertex array (vao) if supported
775 |
776 | [CCode (cname = "rlLoadVertexBuffer")]
777 | public static uint load_vertex_buffer (void* buffer, int size, bool is_dynamic); // Load a vertex buffer attribute
778 |
779 | [CCode (cname = "rlLoadVertexBufferElement")]
780 | public static uint load_vertex_buffer_element (void* buffer, int size, bool is_dynamic); // Load a new attributes element buffer
781 |
782 | [CCode (cname = "rlUpdateVertexBuffer")]
783 | public static void rl_update_vertex_buffer (uint buffer_id, void* data, int data_size, int offset); // Update GPU buffer with new data
784 |
785 | [CCode (cname = "rlUpdateVertexBufferElements")]
786 | public static void rl_update_vertex_buffer_elements (uint id, void* data, int data_size, int offset); // Update vertex buffer elements with new data
787 |
788 | [CCode (cname = "rlUnloadVertexArray")]
789 | public static void rl_unload_vertex_array (uint vao_id);
790 |
791 | [CCode (cname = "rlUnloadVertexBuffer")]
792 | public static void rl_unload_vertex_buffer (uint vbo_id);
793 |
794 | [CCode (cname = "rlSetVertexAttribute")]
795 | public static void rl_set_vertex_attribute (uint index, int component_size, int type, bool is_normalized, int stride, void* pointer);
796 |
797 | [CCode (cname = "rlSetVertexAttributeDivisor")]
798 | public static void rl_set_vertex_attribute_divisor (uint index, int divisor);
799 |
800 | [CCode (cname = "rlSetVertexAttributeDefault")]
801 | public static void rl_set_vertex_attribute_default (int location_index, void* value, int attribute_type, int count); // Set vertex attribute default value
802 |
803 | [CCode (cname = "rlDrawVertexArray")]
804 | public static void rl_draw_vertex_array (int offset, int count);
805 |
806 | [CCode (cname = "rlDrawVertexArrayElements")]
807 | public static void rl_draw_vertex_array_elements (int offset, int count, void* buffer);
808 |
809 | [CCode (cname = "rlDrawVertexArrayInstanced")]
810 | public static void rl_draw_vertex_array_instanced (int offset, int count, int instances);
811 |
812 | [CCode (cname = "rlDrawVertexArrayElementsInstanced")]
813 | public static void rl_draw_vertex_array_elements_instanced (int offset, int count, void* buffer, int instances);
814 |
815 | // Textures management
816 | [CCode (cname = "rlLoadTexture")]
817 | public static uint rl_load_texture (void* data, int width, int height, int format, int mipmap_count); // Load texture in GPU
818 |
819 | [CCode (cname = "rlLoadTextureDepth")]
820 | public static uint rl_load_texture_depth (int width, int height, bool use_render_buffer); // Load depth texture/renderbuffer (to be attached to fbo)
821 |
822 | [CCode (cname = "rlLoadTextureCubemap")]
823 | public static uint rl_load_texture_cubemap (void* data, int size, int format); // Load texture cubemap
824 |
825 | [CCode (cname = "rlUpdateTexture")]
826 | public static void rl_update_texture (uint id, int offset_x, int offset_y, int width, int height, int format, void* data); // Update GPU texture with new data
827 |
828 | [CCode (cname = "rlGetGlTextureFormats")]
829 | public static void rl_get_gl_texture_formats (int format, out uint gl_internal_format, out uint gl_format, out uint gl_type); // Get OpenGL internal formats
830 |
831 | [CCode (cname = "rlGetPixelFormatName")]
832 | public static string rl_get_pixel_format_name (uint format); // Get name string for pixel format
833 |
834 | [CCode (cname = "rlUnloadTexture")]
835 | public static void rl_unload_texture (uint id); // Unload texture from GPU memory
836 |
837 | [CCode (cname = "rlGenTextureMipmaps")]
838 | public static void rl_gen_texture_mipmaps (uint id, int width, int height, int format, out int mipmaps); // Generate mipmap data for selected texture
839 |
840 | [CCode (cname = "rlReadTexturePixels")]
841 | public static void* rl_read_texture_pixels (uint id, int width, int height, int format); // Read texture pixel data
842 |
843 | [CCode (cname = "rlReadScreenPixels")]
844 | public static uchar[] rl_read_screen_pixels (int width, int height); // Read screen pixel data (color buffer)
845 |
846 | // Framebuffer management (fbo)
847 | [CCode (cname = "rlLoadFramebuffer")]
848 | public static uint rl_load_framebuffer (int width, int height); // Load an empty framebuffer
849 |
850 | [CCode (cname = "rlFramebufferAttach")]
851 | public static void rl_framebuffer_attach (uint fbo_id, uint texture_id, int attach_type, int texture_type, int mipmap_level); // Attach texture/renderbuffer to a framebuffer
852 |
853 | [CCode (cname = "rlFramebufferComplete")]
854 | public static bool rl_framebuffer_complete (uint id); // Verify framebuffer is complete
855 |
856 | [CCode (cname = "rlUnloadFramebuffer")]
857 | public static void rl_unload_framebuffer (uint id); // Delete framebuffer from GPU
858 |
859 | // Shaders management
860 | [CCode (cname = "rlLoadShaderCode")]
861 | public static uint rl_load_shader_code (string vertex_shader, string fragment_shader); // Load shader from code strings
862 |
863 | [CCode (cname = "rlCompileShader")]
864 | public static uint rl_compile_shader (string shader_code, int type); // Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
865 |
866 | [CCode (cname = "rlLoadShaderProgram")]
867 | public static uint rl_load_shader_program (uint vertex_shader_id, uint fragment_shader_id); // Load custom shader program
868 |
869 | [CCode (cname = "rlUnloadShaderProgram")]
870 | public static void rl_unload_shader_program (uint id); // Unload shader program
871 |
872 | [CCode (cname = "rlGetLocationUniform")]
873 | public static int rl_get_location_uniform (uint shader_location_id, string uniform_name); // Get shader location uniform
874 |
875 | [CCode (cname = "rlGetLocationAttrib")]
876 | public static int rl_get_location_attribute (uint shader_location_id, string attribute_name); // Get shader location attribute
877 |
878 | [CCode (cname = "rlSetUniform")]
879 | public static void rl_set_uniform (int location_index, void* value, int uniform_type, int count); // Set shader value uniform
880 |
881 | [CCode (cname = "rlSetUniformMatrix")]
882 | public static void rl_set_uniform_matrix (int location_index, Matrix matrix); // Set shader value matrix
883 |
884 | [CCode (cname = "rlSetUniformSampler")]
885 | public static void rl_set_uniform_sampler (int location_index, uint texture_id); // Set shader value sampler
886 |
887 | [CCode (cname = "rlSetShader", array_length = false)]
888 | public static void rl_set_shader (uint id, int[] locs); // Set shader currently active (id and locations)
889 |
890 | // Compute shader management
891 | [CCode (cname = "rlLoadComputeShaderProgram")]
892 | public static uint rl_load_compute_shader_program (uint shader_location_id); // Load compute shader program
893 |
894 | [CCode (cname = "rlComputeShaderDispatch")]
895 | public static void rl_compute_shader_dispatch (uint group_x, uint group_y, uint group_z); // Dispatch compute shader (equivalent to *draw* for graphics pipeline)
896 |
897 | // Shader buffer storage object management (ssbo)
898 | [CCode (cname = "rlLoadShaderBuffer")]
899 | public static uint rl_load_shader_buffer (uint size, void* data, int usage_hint); // Load shader storage buffer object (SSBO)
900 |
901 | [CCode (cname = "rlUnloadShaderBuffer")]
902 | public static void rl_unload_shader_buffer (uint ssbo_id); // Unload shader storage buffer object (SSBO)
903 |
904 | [CCode (cname = "rlUpdateShaderBuffer")]
905 | public static void rl_update_shader_buffer (uint id, void* data, uint data_size, uint offset); // Update SSBO buffer data
906 |
907 | [CCode (cname = "rlBindShaderBuffer")]
908 | public static void rl_bind_shader_buffer (uint id, uint index); // Bind SSBO buffer
909 |
910 | [CCode (cname = "rlReadShaderBuffer")]
911 | public static void rl_read_shader_buffer (uint id, void* destination, uint count, uint offset); // Read SSBO buffer data (GPU->CPU)
912 |
913 | [CCode (cname = "rlCopyShaderBuffer")]
914 | public static void rl_copy_shader_buffer (uint destination_id, uint src_id, uint destination_offset, uint src_offset, uint count); // Copy SSBO data between buffers
915 |
916 | [CCode (cname = "rlGetShaderBufferSize")]
917 | public static uint rl_get_shader_buffer_size (uint id); // Get SSBO buffer size
918 |
919 | // Buffer management
920 | [CCode (cname = "rlBindImageTexture")]
921 | public static void rl_bind_image_texture(uint id, uint index, int format, bool is_read_only); // Bind image texture
922 |
923 | // Matrix state management
924 | [CCode (cname = "rlGetMatrixModelview")]
925 | public static Matrix rl_get_matrix_modelview (); // Get internal modelview matrix
926 |
927 | [CCode (cname = "rlGetMatrixProjection")]
928 | public static Matrix rl_get_matrix_projection (); // Get internal projection matrix
929 |
930 | [CCode (cname = "rlGetMatrixTransform")]
931 | public static Matrix rl_get_matrix_transform (); // Get internal accumulated transform matrix
932 |
933 | [CCode (cname = "rlGetMatrixProjectionStereo")]
934 | public static Matrix rl_get_matrix_projection_stereo (int eye); // Get internal projection matrix for stereo render (selected eye)
935 |
936 | [CCode (cname = "rlGetMatrixViewOffsetStereo")]
937 | public static Matrix rl_get_matrix_view_offset_stereo (int eye); // Get internal view offset matrix for stereo render (selected eye)
938 |
939 | [CCode (cname = "rlSetMatrixProjection")]
940 | public static void rl_set_matrix_projection (Matrix projection); // Set a custom projection matrix (replaces internal projection matrix)
941 |
942 | [CCode (cname = "rlSetMatrixModelview")]
943 | public static void rl_set_matrix_modelview (Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix)
944 |
945 | [CCode (cname = "rlSetMatrixProjectionStereo")]
946 | public static void rl_set_matrix_projection_stereo (Matrix right, Matrix left); // Set eyes projection matrices for stereo rendering
947 |
948 | [CCode (cname = "rlSetMatrixViewOffsetStereo")]
949 | public static void rl_set_matrix_view_offset_stereo (Matrix right, Matrix left); // Set eyes view offsets matrices for stereo rendering
950 |
951 | // Quick and dirty cube/quad buffers load->draw->unload
952 | [CCode (cname = "rlLoadDrawCube")]
953 | public static void rl_load_draw_cube (); // Load and draw a cube
954 |
955 | [CCode (cname = "rlLoadDrawQuad")]
956 | public static void rl_load_draw_quad (); // Load and draw a quad
957 | }
958 |
--------------------------------------------------------------------------------