Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
3657948c1d
27 changed files with 913 additions and 438 deletions
|
|
@ -36,9 +36,6 @@ include(CompilerFlags)
|
|||
# Registers build options that are exposed to cmake
|
||||
include(CMakeOptions.txt)
|
||||
|
||||
# Enforces a few environment and compiler configurations
|
||||
include(BuildOptions)
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11)
|
||||
MESSAGE(FATAL_ERROR "Cannot disable both Wayland and X11")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ option(ENABLE_MSAN "Enable MemorySanitizer (MSan) for debugging (not recommended
|
|||
# Shared library is always PIC. Static library should be PIC too if linked into a shared library
|
||||
option(WITH_PIC "Compile static library as position-independent code" OFF)
|
||||
option(BUILD_SHARED_LIBS "Build raylib as a shared library" OFF)
|
||||
option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" OFF)
|
||||
cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_BUILD ON)
|
||||
|
||||
enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one")
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
if(${PLATFORM} MATCHES "Desktop" AND APPLE)
|
||||
if(MACOS_FATLIB)
|
||||
if (CMAKE_OSX_ARCHITECTURES)
|
||||
message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides -DMACOS_FATLIB=ON")
|
||||
else()
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64;i386")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# This helps support the case where emsdk toolchain file is used
|
||||
# either by setting it with -DCMAKE_TOOLCHAIN_FILE=<path_to_emsdk>/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
|
||||
# or by using "emcmake cmake -B build -S ." as described in https://emscripten.org/docs/compiling/Building-Projects.html
|
||||
if(EMSCRIPTEN)
|
||||
SET(PLATFORM Web CACHE STRING "Forcing PLATFORM_WEB because EMSCRIPTEN was detected")
|
||||
endif()
|
||||
|
||||
# vim: ft=cmake
|
||||
|
|
@ -70,8 +70,9 @@ RAYLIB_SRC_PATH ?= ../src
|
|||
|
||||
# Locations of raylib.h and libraylib.a/libraylib.so
|
||||
# NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
|
||||
RAYLIB_INCLUDE_PATH ?= /usr/local/include
|
||||
RAYLIB_LIB_PATH ?= /usr/local/lib
|
||||
DESTDIR ?= /usr/local
|
||||
RAYLIB_INCLUDE_PATH ?= $(DESTDIR)/include
|
||||
RAYLIB_LIB_PATH ?= $(DESTDIR)/lib
|
||||
|
||||
# Library type compilation: STATIC (.a) or SHARED (.so/.dll)
|
||||
RAYLIB_LIBTYPE ?= STATIC
|
||||
|
|
@ -582,6 +583,7 @@ MODELS = \
|
|||
models/models_mesh_generation \
|
||||
models/models_mesh_picking \
|
||||
models/models_orthographic_projection \
|
||||
models/models_point_rendering \
|
||||
models/models_rlgl_solar_system \
|
||||
models/models_skybox \
|
||||
models/models_waving_cubes \
|
||||
|
|
|
|||
|
|
@ -35,8 +35,9 @@ RAYLIB_PATH ?= ..
|
|||
|
||||
# Locations of raylib.h and libraylib.a/libraylib.so
|
||||
# NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
|
||||
RAYLIB_INCLUDE_PATH ?= /usr/local/include
|
||||
RAYLIB_LIB_PATH ?= /usr/local/lib
|
||||
DESTDIR ?= /usr/local
|
||||
RAYLIB_INCLUDE_PATH ?= $(DESTDIR)/include
|
||||
RAYLIB_LIB_PATH ?= $(DESTDIR)/lib
|
||||
|
||||
# Library type compilation: STATIC (.a) or SHARED (.so/.dll)
|
||||
RAYLIB_LIBTYPE ?= STATIC
|
||||
|
|
@ -447,6 +448,7 @@ MODELS = \
|
|||
models/models_mesh_generation \
|
||||
models/models_mesh_picking \
|
||||
models/models_orthographic_projection \
|
||||
models/models_point_rendering \
|
||||
models/models_rlgl_solar_system \
|
||||
models/models_skybox \
|
||||
models/models_waving_cubes \
|
||||
|
|
|
|||
|
|
@ -147,11 +147,12 @@ Examples using raylib models functionality, including models loading/generation
|
|||
| 91 | [models_loading_vox](models/models_loading_vox.c) | <img src="models/models_loading_vox.png" alt="models_loading_vox" width="80"> | ⭐️☆☆☆ | **4.0** | **4.0** | [Johann Nadalutti](https://github.com/procfxgen) |
|
||||
| 92 | [models_loading_m3d](models/models_loading_m3d.c) | <img src="models/models_loading_m3d.png" alt="models_loading_m3d" width="80"> | ⭐️☆☆☆ | **4.2** | **4.2** | [bzt](https://bztsrc.gitlab.io/model3d) |
|
||||
| 93 | [models_orthographic_projection](models/models_orthographic_projection.c) | <img src="models/models_orthographic_projection.png" alt="models_orthographic_projection" width="80"> | ⭐️☆☆☆ | 2.0 | 3.7 | [Max Danielsson](https://github.com/autious) |
|
||||
| 94 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | <img src="models/models_rlgl_solar_system.png" alt="models_rlgl_solar_system" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||
| 95 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | <img src="models/models_yaw_pitch_roll.png" alt="models_yaw_pitch_roll" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Berni](https://github.com/Berni8k) |
|
||||
| 96 | [models_waving_cubes](models/models_waving_cubes.c) | <img src="models/models_waving_cubes.png" alt="models_waving_cubes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [codecat](https://github.com/codecat) |
|
||||
| 97 | [models_heightmap](models/models_heightmap.c) | <img src="models/models_heightmap.png" alt="models_heightmap" width="80"> | ⭐️☆☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||
| 98 | [models_skybox](models/models_skybox.c) | <img src="models/models_skybox.png" alt="models_skybox" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||
| 94 | [models_point_rendering](models/models_point_rendering.c) | <img src="models/models_point_rendering.png" alt="models_point_rendering" width="80"> | ⭐️⭐️☆☆ | 5.0 | 5.0 | [Reese Gallagher](https://github.com/satchelfrost) |
|
||||
| 95 | [models_rlgl_solar_system](models/models_rlgl_solar_system.c) | <img src="models/models_rlgl_solar_system.png" alt="models_rlgl_solar_system" width="80"> | ⭐️⭐️⭐️⭐️ | 2.5 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||
| 96 | [models_yaw_pitch_roll](models/models_yaw_pitch_roll.c) | <img src="models/models_yaw_pitch_roll.png" alt="models_yaw_pitch_roll" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Berni](https://github.com/Berni8k) |
|
||||
| 97 | [models_waving_cubes](models/models_waving_cubes.c) | <img src="models/models_waving_cubes.png" alt="models_waving_cubes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [codecat](https://github.com/codecat) |
|
||||
| 98 | [models_heightmap](models/models_heightmap.c) | <img src="models/models_heightmap.png" alt="models_heightmap" width="80"> | ⭐️☆☆☆ | 1.8 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||
| 99 | [models_skybox](models/models_skybox.c) | <img src="models/models_skybox.png" alt="models_skybox" width="80"> | ⭐️⭐️☆☆ | 1.8 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||
|
||||
### category: shaders
|
||||
|
||||
|
|
@ -159,26 +160,25 @@ Examples using raylib shaders functionality, including shaders loading, paramete
|
|||
|
||||
| ## | example | image | difficulty<br>level | version<br>created | last version<br>updated | original<br>developer |
|
||||
|----|----------|--------|:-------------------:|:------------------:|:------------------:|:----------|
|
||||
| 99 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | <img src="shaders/shaders_basic_lighting.png" alt="shaders_basic_lighting" width="80"> | ⭐️⭐️⭐️⭐️ | 3.0 | **4.2** | [Chris Camacho](https://github.com/codifies) |
|
||||
| 100 | [shaders_model_shader](shaders/shaders_model_shader.c) | <img src="shaders/shaders_model_shader.png" alt="shaders_model_shader" width="80"> | ⭐️⭐️☆☆ | 1.3 | 3.7 | [Ray](https://github.com/raysan5) |
|
||||
| 101 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | <img src="shaders/shaders_shapes_textures.png" alt="shaders_shapes_textures" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
|
||||
| 102 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | <img src="shaders/shaders_custom_uniform.png" alt="shaders_custom_uniform" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||
| 103 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | <img src="shaders/shaders_postprocessing.png" alt="shaders_postprocessing" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||
| 104 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | <img src="shaders/shaders_palette_switch.png" alt="shaders_palette_switch" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) |
|
||||
| 105 | [shaders_raymarching](shaders/shaders_raymarching.c) | <img src="shaders/shaders_raymarching.png" alt="shaders_raymarching" width="80"> | ⭐️⭐️⭐️⭐️ | 2.0 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||
| 106 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | <img src="shaders/shaders_texture_drawing.png" alt="shaders_texture_drawing" width="80"> | ⭐️⭐️☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/) |
|
||||
| 107 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | <img src="shaders/shaders_texture_outline.png" alt="shaders_texture_outline" width="80"> | ⭐️⭐️⭐️☆ | **4.0** | **4.0** | [Samuel Skiff](https://github.com/GoldenThumbs) |
|
||||
| 108 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | <img src="shaders/shaders_texture_waves.png" alt="shaders_texture_waves" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) |
|
||||
| 109 | [shaders_julia_set](shaders/shaders_julia_set.c) | <img src="shaders/shaders_julia_set.png" alt="shaders_julia_set" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [eggmund](https://github.com/eggmund) |
|
||||
| 110 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | <img src="shaders/shaders_eratosthenes.png" alt="shaders_eratosthenes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [ProfJski](https://github.com/ProfJski) |
|
||||
| 111 | [shaders_fog](shaders/shaders_fog.c) | <img src="shaders/shaders_fog.png" alt="shaders_fog" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||
| 112 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | <img src="shaders/shaders_simple_mask.png" alt="shaders_simple_mask" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||
| 113 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | <img src="shaders/shaders_hot_reloading.png" alt="shaders_hot_reloading" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||
| 114 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | <img src="shaders/shaders_mesh_instancing.png" alt="shaders_mesh_instancing" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.2** | [seanpringle](https://github.com/seanpringle) |
|
||||
| 115 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | <img src="shaders/shaders_multi_sample2d.png" alt="shaders_multi_sample2d" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||
| 116 | [shaders_spotlight](shaders/shaders_spotlight.c) | <img src="shaders/shaders_spotlight.png" alt="shaders_spotlight" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||
| 117 | [shaders_deferred_render](shaders/shaders_deferred_render.c) | <img src="shaders/shaders_deferred_render.png" alt="shaders_deferred_render" width="80"> | ⭐️⭐️⭐️⭐️ | 4.5 | 4.5 | [Justin Andreas Lacoste](https://github.com/27justin) |
|
||||
| 118 | [shaders_vertex_displacement](shaders/shaders_vertex_displacement.c) | <img src="shaders/shaders_vertex_displacement.png" alt="shaders_deferred_render" width="80"> | ⭐️☆☆☆ | 1.5 | 1.5 | [Alex ZH](https://github.com/ZzzhHe) |
|
||||
| 100 | [shaders_basic_lighting](shaders/shaders_basic_lighting.c) | <img src="shaders/shaders_basic_lighting.png" alt="shaders_basic_lighting" width="80"> | ⭐️⭐️⭐️⭐️ | 3.0 | **4.2** | [Chris Camacho](https://github.com/codifies) |
|
||||
| 101 | [shaders_model_shader](shaders/shaders_model_shader.c) | <img src="shaders/shaders_model_shader.png" alt="shaders_model_shader" width="80"> | ⭐️⭐️☆☆ | 1.3 | 3.7 | [Ray](https://github.com/raysan5) |
|
||||
| 102 | [shaders_shapes_textures](shaders/shaders_shapes_textures.c) | <img src="shaders/shaders_shapes_textures.png" alt="shaders_shapes_textures" width="80"> | ⭐️⭐️☆☆ | 1.7 | 3.7 | [Ray](https://github.com/raysan5) |
|
||||
| 103 | [shaders_custom_uniform](shaders/shaders_custom_uniform.c) | <img src="shaders/shaders_custom_uniform.png" alt="shaders_custom_uniform" width="80"> | ⭐️⭐️☆☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||
| 104 | [shaders_postprocessing](shaders/shaders_postprocessing.c) | <img src="shaders/shaders_postprocessing.png" alt="shaders_postprocessing" width="80"> | ⭐️⭐️⭐️☆ | 1.3 | **4.0** | [Ray](https://github.com/raysan5) |
|
||||
| 105 | [shaders_palette_switch](shaders/shaders_palette_switch.c) | <img src="shaders/shaders_palette_switch.png" alt="shaders_palette_switch" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Marco Lizza](https://github.com/MarcoLizza) |
|
||||
| 106 | [shaders_raymarching](shaders/shaders_raymarching.c) | <img src="shaders/shaders_raymarching.png" alt="shaders_raymarching" width="80"> | ⭐️⭐️⭐️⭐️ | 2.0 | **4.2** | [Ray](https://github.com/raysan5) |
|
||||
| 107 | [shaders_texture_drawing](shaders/shaders_texture_drawing.c) | <img src="shaders/shaders_texture_drawing.png" alt="shaders_texture_drawing" width="80"> | ⭐️⭐️☆☆ | 2.0 | 3.7 | [Michał Ciesielski](https://github.com/) |
|
||||
| 108 | [shaders_texture_outline](shaders/shaders_texture_outline.c) | <img src="shaders/shaders_texture_outline.png" alt="shaders_texture_outline" width="80"> | ⭐️⭐️⭐️☆ | **4.0** | **4.0** | [Samuel Skiff](https://github.com/GoldenThumbs) |
|
||||
| 109 | [shaders_texture_waves](shaders/shaders_texture_waves.c) | <img src="shaders/shaders_texture_waves.png" alt="shaders_texture_waves" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Anata](https://github.com/anatagawa) |
|
||||
| 110 | [shaders_julia_set](shaders/shaders_julia_set.c) | <img src="shaders/shaders_julia_set.png" alt="shaders_julia_set" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [eggmund](https://github.com/eggmund) |
|
||||
| 111 | [shaders_eratosthenes](shaders/shaders_eratosthenes.c) | <img src="shaders/shaders_eratosthenes.png" alt="shaders_eratosthenes" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | **4.0** | [ProfJski](https://github.com/ProfJski) |
|
||||
| 112 | [shaders_fog](shaders/shaders_fog.c) | <img src="shaders/shaders_fog.png" alt="shaders_fog" width="80"> | ⭐️⭐️⭐️☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||
| 113 | [shaders_simple_mask](shaders/shaders_simple_mask.c) | <img src="shaders/shaders_simple_mask.png" alt="shaders_simple_mask" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||
| 114 | [shaders_hot_reloading](shaders/shaders_hot_reloading.c) | <img src="shaders/shaders_hot_reloading.png" alt="shaders_hot_reloading" width="80"> | ⭐️⭐️⭐️☆ | 3.0 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||
| 115 | [shaders_mesh_instancing](shaders/shaders_mesh_instancing.c) | <img src="shaders/shaders_mesh_instancing.png" alt="shaders_mesh_instancing" width="80"> | ⭐️⭐️⭐️⭐️ | 3.7 | **4.2** | [seanpringle](https://github.com/seanpringle) |
|
||||
| 116 | [shaders_multi_sample2d](shaders/shaders_multi_sample2d.c) | <img src="shaders/shaders_multi_sample2d.png" alt="shaders_multi_sample2d" width="80"> | ⭐️⭐️☆☆ | 3.5 | 3.5 | [Ray](https://github.com/raysan5) |
|
||||
| 117 | [shaders_spotlight](shaders/shaders_spotlight.c) | <img src="shaders/shaders_spotlight.png" alt="shaders_spotlight" width="80"> | ⭐️⭐️☆☆ | 2.5 | 3.7 | [Chris Camacho](https://github.com/codifies) |
|
||||
| 118 | [shaders_deferred_render](shaders/shaders_deferred_render.c) | <img src="shaders/shaders_deferred_render.png" alt="shaders_deferred_render" width="80"> | ⭐️⭐️⭐️⭐️ | 4.5 | 4.5 | [Justin Andreas Lacoste](https://github.com/27justin) |
|
||||
|
||||
### category: audio
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ int main(void)
|
|||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
float deltaTime = 0.015f;//GetFrameTime();
|
||||
|
||||
|
||||
// Dropped files logic
|
||||
//----------------------------------------------------------------------------------
|
||||
if (IsFileDropped())
|
||||
|
|
@ -157,11 +157,6 @@ int main(void)
|
|||
}
|
||||
else player.canJump = true;
|
||||
|
||||
camera.zoom += ((float)GetMouseWheelMove()*0.05f);
|
||||
|
||||
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
|
||||
else if (camera.zoom < 0.25f) camera.zoom = 0.25f;
|
||||
|
||||
if (IsKeyPressed(KEY_R))
|
||||
{
|
||||
// Reset game state
|
||||
|
|
@ -176,12 +171,44 @@ int main(void)
|
|||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Events playing
|
||||
// NOTE: Logic must be before Camera update because it depends on mouse-wheel value,
|
||||
// that can be set by the played event... but some other inputs could be affected
|
||||
//----------------------------------------------------------------------------------
|
||||
if (eventPlaying)
|
||||
{
|
||||
// NOTE: Multiple events could be executed in a single frame
|
||||
while (playFrameCounter == aelist.events[currentPlayFrame].frame)
|
||||
{
|
||||
PlayAutomationEvent(aelist.events[currentPlayFrame]);
|
||||
currentPlayFrame++;
|
||||
|
||||
if (currentPlayFrame == aelist.count)
|
||||
{
|
||||
eventPlaying = false;
|
||||
currentPlayFrame = 0;
|
||||
playFrameCounter = 0;
|
||||
|
||||
TraceLog(LOG_INFO, "FINISH PLAYING!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
playFrameCounter++;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Update camera
|
||||
//----------------------------------------------------------------------------------
|
||||
camera.target = player.position;
|
||||
camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f };
|
||||
float minX = 1000, minY = 1000, maxX = -1000, maxY = -1000;
|
||||
|
||||
// WARNING: On event replay, mouse-wheel internal value is set
|
||||
camera.zoom += ((float)GetMouseWheelMove()*0.05f);
|
||||
if (camera.zoom > 3.0f) camera.zoom = 3.0f;
|
||||
else if (camera.zoom < 0.25f) camera.zoom = 0.25f;
|
||||
|
||||
for (int i = 0; i < MAX_ENVIRONMENT_ELEMENTS; i++)
|
||||
{
|
||||
EnvElement *element = &envElements[i];
|
||||
|
|
@ -200,8 +227,8 @@ int main(void)
|
|||
if (min.y > 0) camera.offset.y = screenHeight/2 - min.y;
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Toggle events recording
|
||||
if (IsKeyPressed(KEY_S))
|
||||
// Events management
|
||||
if (IsKeyPressed(KEY_S)) // Toggle events recording
|
||||
{
|
||||
if (!eventPlaying)
|
||||
{
|
||||
|
|
@ -222,7 +249,7 @@ int main(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (IsKeyPressed(KEY_A))
|
||||
else if (IsKeyPressed(KEY_A)) // Toggle events playing (WARNING: Starts next frame)
|
||||
{
|
||||
if (!eventRecording && (aelist.count > 0))
|
||||
{
|
||||
|
|
@ -241,32 +268,7 @@ int main(void)
|
|||
camera.zoom = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (eventPlaying)
|
||||
{
|
||||
// NOTE: Multiple events could be executed in a single frame
|
||||
while (playFrameCounter == aelist.events[currentPlayFrame].frame)
|
||||
{
|
||||
TraceLog(LOG_INFO, "PLAYING: PlayFrameCount: %i | currentPlayFrame: %i | Event Frame: %i, param: %i",
|
||||
playFrameCounter, currentPlayFrame, aelist.events[currentPlayFrame].frame, aelist.events[currentPlayFrame].params[0]);
|
||||
|
||||
PlayAutomationEvent(aelist.events[currentPlayFrame]);
|
||||
currentPlayFrame++;
|
||||
|
||||
if (currentPlayFrame == aelist.count)
|
||||
{
|
||||
eventPlaying = false;
|
||||
currentPlayFrame = 0;
|
||||
playFrameCounter = 0;
|
||||
|
||||
TraceLog(LOG_INFO, "FINISH PLAYING!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
playFrameCounter++;
|
||||
}
|
||||
|
||||
if (eventRecording || eventPlaying) frameCounter++;
|
||||
else frameCounter = 0;
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
182
examples/models/models_point_rendering.c
Normal file
182
examples/models/models_point_rendering.c
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
/*******************************************************************************************
|
||||
*
|
||||
* raylib example - point rendering
|
||||
*
|
||||
* Example originally created with raylib 5.0, last time updated with raylib 5.0
|
||||
*
|
||||
* Example contributed by Reese Gallagher (@satchelfrost) and reviewed by Ramon Santamaria (@raysan5)
|
||||
*
|
||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||
* BSD-like license that allows static linking with closed source software
|
||||
*
|
||||
* Copyright (c) 2024 Reese Gallagher (@satchelfrost)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include <stdlib.h> // Required for: rand()
|
||||
#include <math.h> // Required for: cos(), sin()
|
||||
|
||||
#define MAX_POINTS 10000000 // 10 million
|
||||
#define MIN_POINTS 1000 // 1 thousand
|
||||
|
||||
// Generate mesh using points
|
||||
Mesh GenMeshPoints(int numPoints);
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - point rendering");
|
||||
|
||||
Camera camera = {
|
||||
.position = { 3.0f, 3.0f, 3.0f },
|
||||
.target = { 0.0f, 0.0f, 0.0f },
|
||||
.up = { 0.0f, 1.0f, 0.0f },
|
||||
.fovy = 45.0f,
|
||||
.projection = CAMERA_PERSPECTIVE
|
||||
};
|
||||
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f };
|
||||
bool useDrawModelPoints = true;
|
||||
bool numPointsChanged = false;
|
||||
int numPoints = 1000;
|
||||
|
||||
Mesh mesh = GenMeshPoints(numPoints);
|
||||
Model model = LoadModelFromMesh(mesh);
|
||||
|
||||
//SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while(!WindowShouldClose())
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera, CAMERA_ORBITAL);
|
||||
|
||||
if (IsKeyPressed(KEY_SPACE)) useDrawModelPoints = !useDrawModelPoints;
|
||||
if (IsKeyPressed(KEY_UP))
|
||||
{
|
||||
numPoints = (numPoints*10 > MAX_POINTS)? MAX_POINTS : numPoints*10;
|
||||
numPointsChanged = true;
|
||||
}
|
||||
if (IsKeyPressed(KEY_DOWN))
|
||||
{
|
||||
numPoints = (numPoints/10 < MIN_POINTS)? MIN_POINTS : numPoints/10;
|
||||
numPointsChanged = true;
|
||||
}
|
||||
|
||||
// Upload a different point cloud size
|
||||
if (numPointsChanged)
|
||||
{
|
||||
UnloadModel(model);
|
||||
mesh = GenMeshPoints(numPoints);
|
||||
model = LoadModelFromMesh(mesh);
|
||||
numPointsChanged = false;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(BLACK);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
// The new method only uploads the points once to the GPU
|
||||
if (useDrawModelPoints)
|
||||
{
|
||||
DrawModelPoints(model, position, 1.0f, WHITE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The old method must continually draw the "points" (lines)
|
||||
for (int i = 0; i < numPoints; i++)
|
||||
{
|
||||
Vector3 pos = {
|
||||
.x = mesh.vertices[i*3 + 0],
|
||||
.y = mesh.vertices[i*3 + 1],
|
||||
.z = mesh.vertices[i*3 + 2],
|
||||
};
|
||||
Color color = {
|
||||
.r = mesh.colors[i*4 + 0],
|
||||
.g = mesh.colors[i*4 + 1],
|
||||
.b = mesh.colors[i*4 + 2],
|
||||
.a = mesh.colors[i*4 + 3],
|
||||
};
|
||||
|
||||
DrawPoint3D(pos, color);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw a unit sphere for reference
|
||||
DrawSphereWires(position, 1.0f, 10, 10, YELLOW);
|
||||
|
||||
EndMode3D();
|
||||
|
||||
// Draw UI text
|
||||
DrawText(TextFormat("Point Count: %d", numPoints), 20, screenHeight - 50, 40, WHITE);
|
||||
DrawText("Up - increase points", 20, 70, 20, WHITE);
|
||||
DrawText("Down - decrease points", 20, 100, 20, WHITE);
|
||||
DrawText("Space - drawing function", 20, 130, 20, WHITE);
|
||||
|
||||
if (useDrawModelPoints) DrawText("Using: DrawModelPoints()", 20, 160, 20, GREEN);
|
||||
else DrawText("Using: DrawPoint3D()", 20, 160, 20, RED);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadModel(model);
|
||||
|
||||
CloseWindow();
|
||||
//--------------------------------------------------------------------------------------
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Generate a spherical point cloud
|
||||
Mesh GenMeshPoints(int numPoints)
|
||||
{
|
||||
Mesh mesh = {
|
||||
.triangleCount = 1,
|
||||
.vertexCount = numPoints,
|
||||
.vertices = (float *)MemAlloc(numPoints*3*sizeof(float)),
|
||||
.colors = (unsigned char*)MemAlloc(numPoints*4*sizeof(unsigned char)),
|
||||
};
|
||||
|
||||
// https://en.wikipedia.org/wiki/Spherical_coordinate_system
|
||||
for (int i = 0; i < numPoints; i++)
|
||||
{
|
||||
float theta = PI*rand()/RAND_MAX;
|
||||
float phi = 2.0f*PI*rand()/RAND_MAX;
|
||||
float r = 10.0f*rand()/RAND_MAX;
|
||||
|
||||
mesh.vertices[i*3 + 0] = r*sin(theta)*cos(phi);
|
||||
mesh.vertices[i*3 + 1] = r*sin(theta)*sin(phi);
|
||||
mesh.vertices[i*3 + 2] = r*cos(theta);
|
||||
|
||||
Color color = ColorFromHSV(r*360.0f, 1.0f, 1.0f);
|
||||
|
||||
mesh.colors[i*4 + 0] = color.r;
|
||||
mesh.colors[i*4 + 1] = color.g;
|
||||
mesh.colors[i*4 + 2] = color.b;
|
||||
mesh.colors[i*4 + 3] = color.a;
|
||||
}
|
||||
|
||||
// Upload mesh data from CPU (RAM) to GPU (VRAM) memory
|
||||
UploadMesh(&mesh, false);
|
||||
|
||||
return mesh;
|
||||
}
|
||||
BIN
examples/models/models_point_rendering.png
Normal file
BIN
examples/models/models_point_rendering.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 127 KiB |
|
|
@ -3215,12 +3215,12 @@
|
|||
},
|
||||
{
|
||||
"name": "ToggleFullscreen",
|
||||
"description": "Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)",
|
||||
"description": "Toggle window state: fullscreen/windowed [resizes monitor to match window resolution] (only PLATFORM_DESKTOP)",
|
||||
"returnType": "void"
|
||||
},
|
||||
{
|
||||
"name": "ToggleBorderlessWindowed",
|
||||
"description": "Toggle window state: borderless windowed (only PLATFORM_DESKTOP)",
|
||||
"description": "Toggle window state: borderless windowed [resizes window to match monitor resolution] (only PLATFORM_DESKTOP)",
|
||||
"returnType": "void"
|
||||
},
|
||||
{
|
||||
|
|
@ -5485,11 +5485,11 @@
|
|||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color1"
|
||||
"name": "inner"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color2"
|
||||
"name": "outer"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -5785,11 +5785,11 @@
|
|||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color1"
|
||||
"name": "top"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color2"
|
||||
"name": "bottom"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -5816,11 +5816,11 @@
|
|||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color1"
|
||||
"name": "left"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "color2"
|
||||
"name": "right"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -5835,19 +5835,19 @@
|
|||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "col1"
|
||||
"name": "topLeft"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "col2"
|
||||
"name": "bottomLeft"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "col3"
|
||||
"name": "topRight"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "col4"
|
||||
"name": "bottomRight"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -10366,6 +10366,60 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DrawModelPoints",
|
||||
"description": "Draw a model as points",
|
||||
"returnType": "void",
|
||||
"params": [
|
||||
{
|
||||
"type": "Model",
|
||||
"name": "model"
|
||||
},
|
||||
{
|
||||
"type": "Vector3",
|
||||
"name": "position"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "scale"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "tint"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DrawModelPointsEx",
|
||||
"description": "Draw a model as points with extended parameters",
|
||||
"returnType": "void",
|
||||
"params": [
|
||||
{
|
||||
"type": "Model",
|
||||
"name": "model"
|
||||
},
|
||||
{
|
||||
"type": "Vector3",
|
||||
"name": "position"
|
||||
},
|
||||
{
|
||||
"type": "Vector3",
|
||||
"name": "rotationAxis"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "rotationAngle"
|
||||
},
|
||||
{
|
||||
"type": "Vector3",
|
||||
"name": "scale"
|
||||
},
|
||||
{
|
||||
"type": "Color",
|
||||
"name": "tint"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DrawBoundingBox",
|
||||
"description": "Draw bounding box (wires)",
|
||||
|
|
|
|||
|
|
@ -3158,12 +3158,12 @@ return {
|
|||
},
|
||||
{
|
||||
name = "ToggleFullscreen",
|
||||
description = "Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)",
|
||||
description = "Toggle window state: fullscreen/windowed [resizes monitor to match window resolution] (only PLATFORM_DESKTOP)",
|
||||
returnType = "void"
|
||||
},
|
||||
{
|
||||
name = "ToggleBorderlessWindowed",
|
||||
description = "Toggle window state: borderless windowed (only PLATFORM_DESKTOP)",
|
||||
description = "Toggle window state: borderless windowed [resizes window to match monitor resolution] (only PLATFORM_DESKTOP)",
|
||||
returnType = "void"
|
||||
},
|
||||
{
|
||||
|
|
@ -4697,8 +4697,8 @@ return {
|
|||
{type = "int", name = "centerX"},
|
||||
{type = "int", name = "centerY"},
|
||||
{type = "float", name = "radius"},
|
||||
{type = "Color", name = "color1"},
|
||||
{type = "Color", name = "color2"}
|
||||
{type = "Color", name = "inner"},
|
||||
{type = "Color", name = "outer"}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -4835,8 +4835,8 @@ return {
|
|||
{type = "int", name = "posY"},
|
||||
{type = "int", name = "width"},
|
||||
{type = "int", name = "height"},
|
||||
{type = "Color", name = "color1"},
|
||||
{type = "Color", name = "color2"}
|
||||
{type = "Color", name = "top"},
|
||||
{type = "Color", name = "bottom"}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -4848,8 +4848,8 @@ return {
|
|||
{type = "int", name = "posY"},
|
||||
{type = "int", name = "width"},
|
||||
{type = "int", name = "height"},
|
||||
{type = "Color", name = "color1"},
|
||||
{type = "Color", name = "color2"}
|
||||
{type = "Color", name = "left"},
|
||||
{type = "Color", name = "right"}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -4858,10 +4858,10 @@ return {
|
|||
returnType = "void",
|
||||
params = {
|
||||
{type = "Rectangle", name = "rec"},
|
||||
{type = "Color", name = "col1"},
|
||||
{type = "Color", name = "col2"},
|
||||
{type = "Color", name = "col3"},
|
||||
{type = "Color", name = "col4"}
|
||||
{type = "Color", name = "topLeft"},
|
||||
{type = "Color", name = "bottomLeft"},
|
||||
{type = "Color", name = "topRight"},
|
||||
{type = "Color", name = "bottomRight"}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -7213,6 +7213,30 @@ return {
|
|||
{type = "Color", name = "tint"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "DrawModelPoints",
|
||||
description = "Draw a model as points",
|
||||
returnType = "void",
|
||||
params = {
|
||||
{type = "Model", name = "model"},
|
||||
{type = "Vector3", name = "position"},
|
||||
{type = "float", name = "scale"},
|
||||
{type = "Color", name = "tint"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "DrawModelPointsEx",
|
||||
description = "Draw a model as points with extended parameters",
|
||||
returnType = "void",
|
||||
params = {
|
||||
{type = "Model", name = "model"},
|
||||
{type = "Vector3", name = "position"},
|
||||
{type = "Vector3", name = "rotationAxis"},
|
||||
{type = "float", name = "rotationAngle"},
|
||||
{type = "Vector3", name = "scale"},
|
||||
{type = "Color", name = "tint"}
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "DrawBoundingBox",
|
||||
description = "Draw bounding box (wires)",
|
||||
|
|
|
|||
|
|
@ -984,7 +984,7 @@ Callback 006: AudioCallback() (2 input parameters)
|
|||
Param[1]: bufferData (type: void *)
|
||||
Param[2]: frames (type: unsigned int)
|
||||
|
||||
Functions found: 573
|
||||
Functions found: 575
|
||||
|
||||
Function 001: InitWindow() (3 input parameters)
|
||||
Name: InitWindow
|
||||
|
|
@ -1056,12 +1056,12 @@ Function 013: ClearWindowState() (1 input parameters)
|
|||
Function 014: ToggleFullscreen() (0 input parameters)
|
||||
Name: ToggleFullscreen
|
||||
Return type: void
|
||||
Description: Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
|
||||
Description: Toggle window state: fullscreen/windowed [resizes monitor to match window resolution] (only PLATFORM_DESKTOP)
|
||||
No input parameters
|
||||
Function 015: ToggleBorderlessWindowed() (0 input parameters)
|
||||
Name: ToggleBorderlessWindowed
|
||||
Return type: void
|
||||
Description: Toggle window state: borderless windowed (only PLATFORM_DESKTOP)
|
||||
Description: Toggle window state: borderless windowed [resizes window to match monitor resolution] (only PLATFORM_DESKTOP)
|
||||
No input parameters
|
||||
Function 016: MaximizeWindow() (0 input parameters)
|
||||
Name: MaximizeWindow
|
||||
|
|
@ -2176,8 +2176,8 @@ Function 217: DrawCircleGradient() (5 input parameters)
|
|||
Param[1]: centerX (type: int)
|
||||
Param[2]: centerY (type: int)
|
||||
Param[3]: radius (type: float)
|
||||
Param[4]: color1 (type: Color)
|
||||
Param[5]: color2 (type: Color)
|
||||
Param[4]: inner (type: Color)
|
||||
Param[5]: outer (type: Color)
|
||||
Function 218: DrawCircleV() (3 input parameters)
|
||||
Name: DrawCircleV
|
||||
Return type: void
|
||||
|
|
@ -2278,8 +2278,8 @@ Function 229: DrawRectangleGradientV() (6 input parameters)
|
|||
Param[2]: posY (type: int)
|
||||
Param[3]: width (type: int)
|
||||
Param[4]: height (type: int)
|
||||
Param[5]: color1 (type: Color)
|
||||
Param[6]: color2 (type: Color)
|
||||
Param[5]: top (type: Color)
|
||||
Param[6]: bottom (type: Color)
|
||||
Function 230: DrawRectangleGradientH() (6 input parameters)
|
||||
Name: DrawRectangleGradientH
|
||||
Return type: void
|
||||
|
|
@ -2288,17 +2288,17 @@ Function 230: DrawRectangleGradientH() (6 input parameters)
|
|||
Param[2]: posY (type: int)
|
||||
Param[3]: width (type: int)
|
||||
Param[4]: height (type: int)
|
||||
Param[5]: color1 (type: Color)
|
||||
Param[6]: color2 (type: Color)
|
||||
Param[5]: left (type: Color)
|
||||
Param[6]: right (type: Color)
|
||||
Function 231: DrawRectangleGradientEx() (5 input parameters)
|
||||
Name: DrawRectangleGradientEx
|
||||
Return type: void
|
||||
Description: Draw a gradient-filled rectangle with custom vertex colors
|
||||
Param[1]: rec (type: Rectangle)
|
||||
Param[2]: col1 (type: Color)
|
||||
Param[3]: col2 (type: Color)
|
||||
Param[4]: col3 (type: Color)
|
||||
Param[5]: col4 (type: Color)
|
||||
Param[2]: topLeft (type: Color)
|
||||
Param[3]: bottomLeft (type: Color)
|
||||
Param[4]: topRight (type: Color)
|
||||
Param[5]: bottomRight (type: Color)
|
||||
Function 232: DrawRectangleLines() (5 input parameters)
|
||||
Name: DrawRectangleLines
|
||||
Return type: void
|
||||
|
|
@ -3955,13 +3955,31 @@ Function 464: DrawModelWiresEx() (6 input parameters)
|
|||
Param[4]: rotationAngle (type: float)
|
||||
Param[5]: scale (type: Vector3)
|
||||
Param[6]: tint (type: Color)
|
||||
Function 465: DrawBoundingBox() (2 input parameters)
|
||||
Function 465: DrawModelPoints() (4 input parameters)
|
||||
Name: DrawModelPoints
|
||||
Return type: void
|
||||
Description: Draw a model as points
|
||||
Param[1]: model (type: Model)
|
||||
Param[2]: position (type: Vector3)
|
||||
Param[3]: scale (type: float)
|
||||
Param[4]: tint (type: Color)
|
||||
Function 466: DrawModelPointsEx() (6 input parameters)
|
||||
Name: DrawModelPointsEx
|
||||
Return type: void
|
||||
Description: Draw a model as points with extended parameters
|
||||
Param[1]: model (type: Model)
|
||||
Param[2]: position (type: Vector3)
|
||||
Param[3]: rotationAxis (type: Vector3)
|
||||
Param[4]: rotationAngle (type: float)
|
||||
Param[5]: scale (type: Vector3)
|
||||
Param[6]: tint (type: Color)
|
||||
Function 467: DrawBoundingBox() (2 input parameters)
|
||||
Name: DrawBoundingBox
|
||||
Return type: void
|
||||
Description: Draw bounding box (wires)
|
||||
Param[1]: box (type: BoundingBox)
|
||||
Param[2]: color (type: Color)
|
||||
Function 466: DrawBillboard() (5 input parameters)
|
||||
Function 468: DrawBillboard() (5 input parameters)
|
||||
Name: DrawBillboard
|
||||
Return type: void
|
||||
Description: Draw a billboard texture
|
||||
|
|
@ -3970,7 +3988,7 @@ Function 466: DrawBillboard() (5 input parameters)
|
|||
Param[3]: position (type: Vector3)
|
||||
Param[4]: scale (type: float)
|
||||
Param[5]: tint (type: Color)
|
||||
Function 467: DrawBillboardRec() (6 input parameters)
|
||||
Function 469: DrawBillboardRec() (6 input parameters)
|
||||
Name: DrawBillboardRec
|
||||
Return type: void
|
||||
Description: Draw a billboard texture defined by source
|
||||
|
|
@ -3980,7 +3998,7 @@ Function 467: DrawBillboardRec() (6 input parameters)
|
|||
Param[4]: position (type: Vector3)
|
||||
Param[5]: size (type: Vector2)
|
||||
Param[6]: tint (type: Color)
|
||||
Function 468: DrawBillboardPro() (9 input parameters)
|
||||
Function 470: DrawBillboardPro() (9 input parameters)
|
||||
Name: DrawBillboardPro
|
||||
Return type: void
|
||||
Description: Draw a billboard texture defined by source and rotation
|
||||
|
|
@ -3993,13 +4011,13 @@ Function 468: DrawBillboardPro() (9 input parameters)
|
|||
Param[7]: origin (type: Vector2)
|
||||
Param[8]: rotation (type: float)
|
||||
Param[9]: tint (type: Color)
|
||||
Function 469: UploadMesh() (2 input parameters)
|
||||
Function 471: UploadMesh() (2 input parameters)
|
||||
Name: UploadMesh
|
||||
Return type: void
|
||||
Description: Upload mesh vertex data in GPU and provide VAO/VBO ids
|
||||
Param[1]: mesh (type: Mesh *)
|
||||
Param[2]: dynamic (type: bool)
|
||||
Function 470: UpdateMeshBuffer() (5 input parameters)
|
||||
Function 472: UpdateMeshBuffer() (5 input parameters)
|
||||
Name: UpdateMeshBuffer
|
||||
Return type: void
|
||||
Description: Update mesh vertex data in GPU for a specific buffer index
|
||||
|
|
@ -4008,19 +4026,19 @@ Function 470: UpdateMeshBuffer() (5 input parameters)
|
|||
Param[3]: data (type: const void *)
|
||||
Param[4]: dataSize (type: int)
|
||||
Param[5]: offset (type: int)
|
||||
Function 471: UnloadMesh() (1 input parameters)
|
||||
Function 473: UnloadMesh() (1 input parameters)
|
||||
Name: UnloadMesh
|
||||
Return type: void
|
||||
Description: Unload mesh data from CPU and GPU
|
||||
Param[1]: mesh (type: Mesh)
|
||||
Function 472: DrawMesh() (3 input parameters)
|
||||
Function 474: DrawMesh() (3 input parameters)
|
||||
Name: DrawMesh
|
||||
Return type: void
|
||||
Description: Draw a 3d mesh with material and transform
|
||||
Param[1]: mesh (type: Mesh)
|
||||
Param[2]: material (type: Material)
|
||||
Param[3]: transform (type: Matrix)
|
||||
Function 473: DrawMeshInstanced() (4 input parameters)
|
||||
Function 475: DrawMeshInstanced() (4 input parameters)
|
||||
Name: DrawMeshInstanced
|
||||
Return type: void
|
||||
Description: Draw multiple mesh instances with material and different transforms
|
||||
|
|
@ -4028,35 +4046,35 @@ Function 473: DrawMeshInstanced() (4 input parameters)
|
|||
Param[2]: material (type: Material)
|
||||
Param[3]: transforms (type: const Matrix *)
|
||||
Param[4]: instances (type: int)
|
||||
Function 474: GetMeshBoundingBox() (1 input parameters)
|
||||
Function 476: GetMeshBoundingBox() (1 input parameters)
|
||||
Name: GetMeshBoundingBox
|
||||
Return type: BoundingBox
|
||||
Description: Compute mesh bounding box limits
|
||||
Param[1]: mesh (type: Mesh)
|
||||
Function 475: GenMeshTangents() (1 input parameters)
|
||||
Function 477: GenMeshTangents() (1 input parameters)
|
||||
Name: GenMeshTangents
|
||||
Return type: void
|
||||
Description: Compute mesh tangents
|
||||
Param[1]: mesh (type: Mesh *)
|
||||
Function 476: ExportMesh() (2 input parameters)
|
||||
Function 478: ExportMesh() (2 input parameters)
|
||||
Name: ExportMesh
|
||||
Return type: bool
|
||||
Description: Export mesh data to file, returns true on success
|
||||
Param[1]: mesh (type: Mesh)
|
||||
Param[2]: fileName (type: const char *)
|
||||
Function 477: ExportMeshAsCode() (2 input parameters)
|
||||
Function 479: ExportMeshAsCode() (2 input parameters)
|
||||
Name: ExportMeshAsCode
|
||||
Return type: bool
|
||||
Description: Export mesh as code file (.h) defining multiple arrays of vertex attributes
|
||||
Param[1]: mesh (type: Mesh)
|
||||
Param[2]: fileName (type: const char *)
|
||||
Function 478: GenMeshPoly() (2 input parameters)
|
||||
Function 480: GenMeshPoly() (2 input parameters)
|
||||
Name: GenMeshPoly
|
||||
Return type: Mesh
|
||||
Description: Generate polygonal mesh
|
||||
Param[1]: sides (type: int)
|
||||
Param[2]: radius (type: float)
|
||||
Function 479: GenMeshPlane() (4 input parameters)
|
||||
Function 481: GenMeshPlane() (4 input parameters)
|
||||
Name: GenMeshPlane
|
||||
Return type: Mesh
|
||||
Description: Generate plane mesh (with subdivisions)
|
||||
|
|
@ -4064,42 +4082,42 @@ Function 479: GenMeshPlane() (4 input parameters)
|
|||
Param[2]: length (type: float)
|
||||
Param[3]: resX (type: int)
|
||||
Param[4]: resZ (type: int)
|
||||
Function 480: GenMeshCube() (3 input parameters)
|
||||
Function 482: GenMeshCube() (3 input parameters)
|
||||
Name: GenMeshCube
|
||||
Return type: Mesh
|
||||
Description: Generate cuboid mesh
|
||||
Param[1]: width (type: float)
|
||||
Param[2]: height (type: float)
|
||||
Param[3]: length (type: float)
|
||||
Function 481: GenMeshSphere() (3 input parameters)
|
||||
Function 483: GenMeshSphere() (3 input parameters)
|
||||
Name: GenMeshSphere
|
||||
Return type: Mesh
|
||||
Description: Generate sphere mesh (standard sphere)
|
||||
Param[1]: radius (type: float)
|
||||
Param[2]: rings (type: int)
|
||||
Param[3]: slices (type: int)
|
||||
Function 482: GenMeshHemiSphere() (3 input parameters)
|
||||
Function 484: GenMeshHemiSphere() (3 input parameters)
|
||||
Name: GenMeshHemiSphere
|
||||
Return type: Mesh
|
||||
Description: Generate half-sphere mesh (no bottom cap)
|
||||
Param[1]: radius (type: float)
|
||||
Param[2]: rings (type: int)
|
||||
Param[3]: slices (type: int)
|
||||
Function 483: GenMeshCylinder() (3 input parameters)
|
||||
Function 485: GenMeshCylinder() (3 input parameters)
|
||||
Name: GenMeshCylinder
|
||||
Return type: Mesh
|
||||
Description: Generate cylinder mesh
|
||||
Param[1]: radius (type: float)
|
||||
Param[2]: height (type: float)
|
||||
Param[3]: slices (type: int)
|
||||
Function 484: GenMeshCone() (3 input parameters)
|
||||
Function 486: GenMeshCone() (3 input parameters)
|
||||
Name: GenMeshCone
|
||||
Return type: Mesh
|
||||
Description: Generate cone/pyramid mesh
|
||||
Param[1]: radius (type: float)
|
||||
Param[2]: height (type: float)
|
||||
Param[3]: slices (type: int)
|
||||
Function 485: GenMeshTorus() (4 input parameters)
|
||||
Function 487: GenMeshTorus() (4 input parameters)
|
||||
Name: GenMeshTorus
|
||||
Return type: Mesh
|
||||
Description: Generate torus mesh
|
||||
|
|
@ -4107,7 +4125,7 @@ Function 485: GenMeshTorus() (4 input parameters)
|
|||
Param[2]: size (type: float)
|
||||
Param[3]: radSeg (type: int)
|
||||
Param[4]: sides (type: int)
|
||||
Function 486: GenMeshKnot() (4 input parameters)
|
||||
Function 488: GenMeshKnot() (4 input parameters)
|
||||
Name: GenMeshKnot
|
||||
Return type: Mesh
|
||||
Description: Generate trefoil knot mesh
|
||||
|
|
@ -4115,84 +4133,84 @@ Function 486: GenMeshKnot() (4 input parameters)
|
|||
Param[2]: size (type: float)
|
||||
Param[3]: radSeg (type: int)
|
||||
Param[4]: sides (type: int)
|
||||
Function 487: GenMeshHeightmap() (2 input parameters)
|
||||
Function 489: GenMeshHeightmap() (2 input parameters)
|
||||
Name: GenMeshHeightmap
|
||||
Return type: Mesh
|
||||
Description: Generate heightmap mesh from image data
|
||||
Param[1]: heightmap (type: Image)
|
||||
Param[2]: size (type: Vector3)
|
||||
Function 488: GenMeshCubicmap() (2 input parameters)
|
||||
Function 490: GenMeshCubicmap() (2 input parameters)
|
||||
Name: GenMeshCubicmap
|
||||
Return type: Mesh
|
||||
Description: Generate cubes-based map mesh from image data
|
||||
Param[1]: cubicmap (type: Image)
|
||||
Param[2]: cubeSize (type: Vector3)
|
||||
Function 489: LoadMaterials() (2 input parameters)
|
||||
Function 491: LoadMaterials() (2 input parameters)
|
||||
Name: LoadMaterials
|
||||
Return type: Material *
|
||||
Description: Load materials from model file
|
||||
Param[1]: fileName (type: const char *)
|
||||
Param[2]: materialCount (type: int *)
|
||||
Function 490: LoadMaterialDefault() (0 input parameters)
|
||||
Function 492: LoadMaterialDefault() (0 input parameters)
|
||||
Name: LoadMaterialDefault
|
||||
Return type: Material
|
||||
Description: Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
|
||||
No input parameters
|
||||
Function 491: IsMaterialReady() (1 input parameters)
|
||||
Function 493: IsMaterialReady() (1 input parameters)
|
||||
Name: IsMaterialReady
|
||||
Return type: bool
|
||||
Description: Check if a material is ready
|
||||
Param[1]: material (type: Material)
|
||||
Function 492: UnloadMaterial() (1 input parameters)
|
||||
Function 494: UnloadMaterial() (1 input parameters)
|
||||
Name: UnloadMaterial
|
||||
Return type: void
|
||||
Description: Unload material from GPU memory (VRAM)
|
||||
Param[1]: material (type: Material)
|
||||
Function 493: SetMaterialTexture() (3 input parameters)
|
||||
Function 495: SetMaterialTexture() (3 input parameters)
|
||||
Name: SetMaterialTexture
|
||||
Return type: void
|
||||
Description: Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)
|
||||
Param[1]: material (type: Material *)
|
||||
Param[2]: mapType (type: int)
|
||||
Param[3]: texture (type: Texture2D)
|
||||
Function 494: SetModelMeshMaterial() (3 input parameters)
|
||||
Function 496: SetModelMeshMaterial() (3 input parameters)
|
||||
Name: SetModelMeshMaterial
|
||||
Return type: void
|
||||
Description: Set material for a mesh
|
||||
Param[1]: model (type: Model *)
|
||||
Param[2]: meshId (type: int)
|
||||
Param[3]: materialId (type: int)
|
||||
Function 495: LoadModelAnimations() (2 input parameters)
|
||||
Function 497: LoadModelAnimations() (2 input parameters)
|
||||
Name: LoadModelAnimations
|
||||
Return type: ModelAnimation *
|
||||
Description: Load model animations from file
|
||||
Param[1]: fileName (type: const char *)
|
||||
Param[2]: animCount (type: int *)
|
||||
Function 496: UpdateModelAnimation() (3 input parameters)
|
||||
Function 498: UpdateModelAnimation() (3 input parameters)
|
||||
Name: UpdateModelAnimation
|
||||
Return type: void
|
||||
Description: Update model animation pose
|
||||
Param[1]: model (type: Model)
|
||||
Param[2]: anim (type: ModelAnimation)
|
||||
Param[3]: frame (type: int)
|
||||
Function 497: UnloadModelAnimation() (1 input parameters)
|
||||
Function 499: UnloadModelAnimation() (1 input parameters)
|
||||
Name: UnloadModelAnimation
|
||||
Return type: void
|
||||
Description: Unload animation data
|
||||
Param[1]: anim (type: ModelAnimation)
|
||||
Function 498: UnloadModelAnimations() (2 input parameters)
|
||||
Function 500: UnloadModelAnimations() (2 input parameters)
|
||||
Name: UnloadModelAnimations
|
||||
Return type: void
|
||||
Description: Unload animation array data
|
||||
Param[1]: animations (type: ModelAnimation *)
|
||||
Param[2]: animCount (type: int)
|
||||
Function 499: IsModelAnimationValid() (2 input parameters)
|
||||
Function 501: IsModelAnimationValid() (2 input parameters)
|
||||
Name: IsModelAnimationValid
|
||||
Return type: bool
|
||||
Description: Check model animation skeleton match
|
||||
Param[1]: model (type: Model)
|
||||
Param[2]: anim (type: ModelAnimation)
|
||||
Function 500: CheckCollisionSpheres() (4 input parameters)
|
||||
Function 502: CheckCollisionSpheres() (4 input parameters)
|
||||
Name: CheckCollisionSpheres
|
||||
Return type: bool
|
||||
Description: Check collision between two spheres
|
||||
|
|
@ -4200,40 +4218,40 @@ Function 500: CheckCollisionSpheres() (4 input parameters)
|
|||
Param[2]: radius1 (type: float)
|
||||
Param[3]: center2 (type: Vector3)
|
||||
Param[4]: radius2 (type: float)
|
||||
Function 501: CheckCollisionBoxes() (2 input parameters)
|
||||
Function 503: CheckCollisionBoxes() (2 input parameters)
|
||||
Name: CheckCollisionBoxes
|
||||
Return type: bool
|
||||
Description: Check collision between two bounding boxes
|
||||
Param[1]: box1 (type: BoundingBox)
|
||||
Param[2]: box2 (type: BoundingBox)
|
||||
Function 502: CheckCollisionBoxSphere() (3 input parameters)
|
||||
Function 504: CheckCollisionBoxSphere() (3 input parameters)
|
||||
Name: CheckCollisionBoxSphere
|
||||
Return type: bool
|
||||
Description: Check collision between box and sphere
|
||||
Param[1]: box (type: BoundingBox)
|
||||
Param[2]: center (type: Vector3)
|
||||
Param[3]: radius (type: float)
|
||||
Function 503: GetRayCollisionSphere() (3 input parameters)
|
||||
Function 505: GetRayCollisionSphere() (3 input parameters)
|
||||
Name: GetRayCollisionSphere
|
||||
Return type: RayCollision
|
||||
Description: Get collision info between ray and sphere
|
||||
Param[1]: ray (type: Ray)
|
||||
Param[2]: center (type: Vector3)
|
||||
Param[3]: radius (type: float)
|
||||
Function 504: GetRayCollisionBox() (2 input parameters)
|
||||
Function 506: GetRayCollisionBox() (2 input parameters)
|
||||
Name: GetRayCollisionBox
|
||||
Return type: RayCollision
|
||||
Description: Get collision info between ray and box
|
||||
Param[1]: ray (type: Ray)
|
||||
Param[2]: box (type: BoundingBox)
|
||||
Function 505: GetRayCollisionMesh() (3 input parameters)
|
||||
Function 507: GetRayCollisionMesh() (3 input parameters)
|
||||
Name: GetRayCollisionMesh
|
||||
Return type: RayCollision
|
||||
Description: Get collision info between ray and mesh
|
||||
Param[1]: ray (type: Ray)
|
||||
Param[2]: mesh (type: Mesh)
|
||||
Param[3]: transform (type: Matrix)
|
||||
Function 506: GetRayCollisionTriangle() (4 input parameters)
|
||||
Function 508: GetRayCollisionTriangle() (4 input parameters)
|
||||
Name: GetRayCollisionTriangle
|
||||
Return type: RayCollision
|
||||
Description: Get collision info between ray and triangle
|
||||
|
|
@ -4241,7 +4259,7 @@ Function 506: GetRayCollisionTriangle() (4 input parameters)
|
|||
Param[2]: p1 (type: Vector3)
|
||||
Param[3]: p2 (type: Vector3)
|
||||
Param[4]: p3 (type: Vector3)
|
||||
Function 507: GetRayCollisionQuad() (5 input parameters)
|
||||
Function 509: GetRayCollisionQuad() (5 input parameters)
|
||||
Name: GetRayCollisionQuad
|
||||
Return type: RayCollision
|
||||
Description: Get collision info between ray and quad
|
||||
|
|
@ -4250,158 +4268,158 @@ Function 507: GetRayCollisionQuad() (5 input parameters)
|
|||
Param[3]: p2 (type: Vector3)
|
||||
Param[4]: p3 (type: Vector3)
|
||||
Param[5]: p4 (type: Vector3)
|
||||
Function 508: InitAudioDevice() (0 input parameters)
|
||||
Function 510: InitAudioDevice() (0 input parameters)
|
||||
Name: InitAudioDevice
|
||||
Return type: void
|
||||
Description: Initialize audio device and context
|
||||
No input parameters
|
||||
Function 509: CloseAudioDevice() (0 input parameters)
|
||||
Function 511: CloseAudioDevice() (0 input parameters)
|
||||
Name: CloseAudioDevice
|
||||
Return type: void
|
||||
Description: Close the audio device and context
|
||||
No input parameters
|
||||
Function 510: IsAudioDeviceReady() (0 input parameters)
|
||||
Function 512: IsAudioDeviceReady() (0 input parameters)
|
||||
Name: IsAudioDeviceReady
|
||||
Return type: bool
|
||||
Description: Check if audio device has been initialized successfully
|
||||
No input parameters
|
||||
Function 511: SetMasterVolume() (1 input parameters)
|
||||
Function 513: SetMasterVolume() (1 input parameters)
|
||||
Name: SetMasterVolume
|
||||
Return type: void
|
||||
Description: Set master volume (listener)
|
||||
Param[1]: volume (type: float)
|
||||
Function 512: GetMasterVolume() (0 input parameters)
|
||||
Function 514: GetMasterVolume() (0 input parameters)
|
||||
Name: GetMasterVolume
|
||||
Return type: float
|
||||
Description: Get master volume (listener)
|
||||
No input parameters
|
||||
Function 513: LoadWave() (1 input parameters)
|
||||
Function 515: LoadWave() (1 input parameters)
|
||||
Name: LoadWave
|
||||
Return type: Wave
|
||||
Description: Load wave data from file
|
||||
Param[1]: fileName (type: const char *)
|
||||
Function 514: LoadWaveFromMemory() (3 input parameters)
|
||||
Function 516: LoadWaveFromMemory() (3 input parameters)
|
||||
Name: LoadWaveFromMemory
|
||||
Return type: Wave
|
||||
Description: Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
|
||||
Param[1]: fileType (type: const char *)
|
||||
Param[2]: fileData (type: const unsigned char *)
|
||||
Param[3]: dataSize (type: int)
|
||||
Function 515: IsWaveReady() (1 input parameters)
|
||||
Function 517: IsWaveReady() (1 input parameters)
|
||||
Name: IsWaveReady
|
||||
Return type: bool
|
||||
Description: Checks if wave data is ready
|
||||
Param[1]: wave (type: Wave)
|
||||
Function 516: LoadSound() (1 input parameters)
|
||||
Function 518: LoadSound() (1 input parameters)
|
||||
Name: LoadSound
|
||||
Return type: Sound
|
||||
Description: Load sound from file
|
||||
Param[1]: fileName (type: const char *)
|
||||
Function 517: LoadSoundFromWave() (1 input parameters)
|
||||
Function 519: LoadSoundFromWave() (1 input parameters)
|
||||
Name: LoadSoundFromWave
|
||||
Return type: Sound
|
||||
Description: Load sound from wave data
|
||||
Param[1]: wave (type: Wave)
|
||||
Function 518: LoadSoundAlias() (1 input parameters)
|
||||
Function 520: LoadSoundAlias() (1 input parameters)
|
||||
Name: LoadSoundAlias
|
||||
Return type: Sound
|
||||
Description: Create a new sound that shares the same sample data as the source sound, does not own the sound data
|
||||
Param[1]: source (type: Sound)
|
||||
Function 519: IsSoundReady() (1 input parameters)
|
||||
Function 521: IsSoundReady() (1 input parameters)
|
||||
Name: IsSoundReady
|
||||
Return type: bool
|
||||
Description: Checks if a sound is ready
|
||||
Param[1]: sound (type: Sound)
|
||||
Function 520: UpdateSound() (3 input parameters)
|
||||
Function 522: UpdateSound() (3 input parameters)
|
||||
Name: UpdateSound
|
||||
Return type: void
|
||||
Description: Update sound buffer with new data
|
||||
Param[1]: sound (type: Sound)
|
||||
Param[2]: data (type: const void *)
|
||||
Param[3]: sampleCount (type: int)
|
||||
Function 521: UnloadWave() (1 input parameters)
|
||||
Function 523: UnloadWave() (1 input parameters)
|
||||
Name: UnloadWave
|
||||
Return type: void
|
||||
Description: Unload wave data
|
||||
Param[1]: wave (type: Wave)
|
||||
Function 522: UnloadSound() (1 input parameters)
|
||||
Function 524: UnloadSound() (1 input parameters)
|
||||
Name: UnloadSound
|
||||
Return type: void
|
||||
Description: Unload sound
|
||||
Param[1]: sound (type: Sound)
|
||||
Function 523: UnloadSoundAlias() (1 input parameters)
|
||||
Function 525: UnloadSoundAlias() (1 input parameters)
|
||||
Name: UnloadSoundAlias
|
||||
Return type: void
|
||||
Description: Unload a sound alias (does not deallocate sample data)
|
||||
Param[1]: alias (type: Sound)
|
||||
Function 524: ExportWave() (2 input parameters)
|
||||
Function 526: ExportWave() (2 input parameters)
|
||||
Name: ExportWave
|
||||
Return type: bool
|
||||
Description: Export wave data to file, returns true on success
|
||||
Param[1]: wave (type: Wave)
|
||||
Param[2]: fileName (type: const char *)
|
||||
Function 525: ExportWaveAsCode() (2 input parameters)
|
||||
Function 527: ExportWaveAsCode() (2 input parameters)
|
||||
Name: ExportWaveAsCode
|
||||
Return type: bool
|
||||
Description: Export wave sample data to code (.h), returns true on success
|
||||
Param[1]: wave (type: Wave)
|
||||
Param[2]: fileName (type: const char *)
|
||||
Function 526: PlaySound() (1 input parameters)
|
||||
Function 528: PlaySound() (1 input parameters)
|
||||
Name: PlaySound
|
||||
Return type: void
|
||||
Description: Play a sound
|
||||
Param[1]: sound (type: Sound)
|
||||
Function 527: StopSound() (1 input parameters)
|
||||
Function 529: StopSound() (1 input parameters)
|
||||
Name: StopSound
|
||||
Return type: void
|
||||
Description: Stop playing a sound
|
||||
Param[1]: sound (type: Sound)
|
||||
Function 528: PauseSound() (1 input parameters)
|
||||
Function 530: PauseSound() (1 input parameters)
|
||||
Name: PauseSound
|
||||
Return type: void
|
||||
Description: Pause a sound
|
||||
Param[1]: sound (type: Sound)
|
||||
Function 529: ResumeSound() (1 input parameters)
|
||||
Function 531: ResumeSound() (1 input parameters)
|
||||
Name: ResumeSound
|
||||
Return type: void
|
||||
Description: Resume a paused sound
|
||||
Param[1]: sound (type: Sound)
|
||||
Function 530: IsSoundPlaying() (1 input parameters)
|
||||
Function 532: IsSoundPlaying() (1 input parameters)
|
||||
Name: IsSoundPlaying
|
||||
Return type: bool
|
||||
Description: Check if a sound is currently playing
|
||||
Param[1]: sound (type: Sound)
|
||||
Function 531: SetSoundVolume() (2 input parameters)
|
||||
Function 533: SetSoundVolume() (2 input parameters)
|
||||
Name: SetSoundVolume
|
||||
Return type: void
|
||||
Description: Set volume for a sound (1.0 is max level)
|
||||
Param[1]: sound (type: Sound)
|
||||
Param[2]: volume (type: float)
|
||||
Function 532: SetSoundPitch() (2 input parameters)
|
||||
Function 534: SetSoundPitch() (2 input parameters)
|
||||
Name: SetSoundPitch
|
||||
Return type: void
|
||||
Description: Set pitch for a sound (1.0 is base level)
|
||||
Param[1]: sound (type: Sound)
|
||||
Param[2]: pitch (type: float)
|
||||
Function 533: SetSoundPan() (2 input parameters)
|
||||
Function 535: SetSoundPan() (2 input parameters)
|
||||
Name: SetSoundPan
|
||||
Return type: void
|
||||
Description: Set pan for a sound (0.5 is center)
|
||||
Param[1]: sound (type: Sound)
|
||||
Param[2]: pan (type: float)
|
||||
Function 534: WaveCopy() (1 input parameters)
|
||||
Function 536: WaveCopy() (1 input parameters)
|
||||
Name: WaveCopy
|
||||
Return type: Wave
|
||||
Description: Copy a wave to a new wave
|
||||
Param[1]: wave (type: Wave)
|
||||
Function 535: WaveCrop() (3 input parameters)
|
||||
Function 537: WaveCrop() (3 input parameters)
|
||||
Name: WaveCrop
|
||||
Return type: void
|
||||
Description: Crop a wave to defined frames range
|
||||
Param[1]: wave (type: Wave *)
|
||||
Param[2]: initFrame (type: int)
|
||||
Param[3]: finalFrame (type: int)
|
||||
Function 536: WaveFormat() (4 input parameters)
|
||||
Function 538: WaveFormat() (4 input parameters)
|
||||
Name: WaveFormat
|
||||
Return type: void
|
||||
Description: Convert wave data to desired format
|
||||
|
|
@ -4409,203 +4427,203 @@ Function 536: WaveFormat() (4 input parameters)
|
|||
Param[2]: sampleRate (type: int)
|
||||
Param[3]: sampleSize (type: int)
|
||||
Param[4]: channels (type: int)
|
||||
Function 537: LoadWaveSamples() (1 input parameters)
|
||||
Function 539: LoadWaveSamples() (1 input parameters)
|
||||
Name: LoadWaveSamples
|
||||
Return type: float *
|
||||
Description: Load samples data from wave as a 32bit float data array
|
||||
Param[1]: wave (type: Wave)
|
||||
Function 538: UnloadWaveSamples() (1 input parameters)
|
||||
Function 540: UnloadWaveSamples() (1 input parameters)
|
||||
Name: UnloadWaveSamples
|
||||
Return type: void
|
||||
Description: Unload samples data loaded with LoadWaveSamples()
|
||||
Param[1]: samples (type: float *)
|
||||
Function 539: LoadMusicStream() (1 input parameters)
|
||||
Function 541: LoadMusicStream() (1 input parameters)
|
||||
Name: LoadMusicStream
|
||||
Return type: Music
|
||||
Description: Load music stream from file
|
||||
Param[1]: fileName (type: const char *)
|
||||
Function 540: LoadMusicStreamFromMemory() (3 input parameters)
|
||||
Function 542: LoadMusicStreamFromMemory() (3 input parameters)
|
||||
Name: LoadMusicStreamFromMemory
|
||||
Return type: Music
|
||||
Description: Load music stream from data
|
||||
Param[1]: fileType (type: const char *)
|
||||
Param[2]: data (type: const unsigned char *)
|
||||
Param[3]: dataSize (type: int)
|
||||
Function 541: IsMusicReady() (1 input parameters)
|
||||
Function 543: IsMusicReady() (1 input parameters)
|
||||
Name: IsMusicReady
|
||||
Return type: bool
|
||||
Description: Checks if a music stream is ready
|
||||
Param[1]: music (type: Music)
|
||||
Function 542: UnloadMusicStream() (1 input parameters)
|
||||
Function 544: UnloadMusicStream() (1 input parameters)
|
||||
Name: UnloadMusicStream
|
||||
Return type: void
|
||||
Description: Unload music stream
|
||||
Param[1]: music (type: Music)
|
||||
Function 543: PlayMusicStream() (1 input parameters)
|
||||
Function 545: PlayMusicStream() (1 input parameters)
|
||||
Name: PlayMusicStream
|
||||
Return type: void
|
||||
Description: Start music playing
|
||||
Param[1]: music (type: Music)
|
||||
Function 544: IsMusicStreamPlaying() (1 input parameters)
|
||||
Function 546: IsMusicStreamPlaying() (1 input parameters)
|
||||
Name: IsMusicStreamPlaying
|
||||
Return type: bool
|
||||
Description: Check if music is playing
|
||||
Param[1]: music (type: Music)
|
||||
Function 545: UpdateMusicStream() (1 input parameters)
|
||||
Function 547: UpdateMusicStream() (1 input parameters)
|
||||
Name: UpdateMusicStream
|
||||
Return type: void
|
||||
Description: Updates buffers for music streaming
|
||||
Param[1]: music (type: Music)
|
||||
Function 546: StopMusicStream() (1 input parameters)
|
||||
Function 548: StopMusicStream() (1 input parameters)
|
||||
Name: StopMusicStream
|
||||
Return type: void
|
||||
Description: Stop music playing
|
||||
Param[1]: music (type: Music)
|
||||
Function 547: PauseMusicStream() (1 input parameters)
|
||||
Function 549: PauseMusicStream() (1 input parameters)
|
||||
Name: PauseMusicStream
|
||||
Return type: void
|
||||
Description: Pause music playing
|
||||
Param[1]: music (type: Music)
|
||||
Function 548: ResumeMusicStream() (1 input parameters)
|
||||
Function 550: ResumeMusicStream() (1 input parameters)
|
||||
Name: ResumeMusicStream
|
||||
Return type: void
|
||||
Description: Resume playing paused music
|
||||
Param[1]: music (type: Music)
|
||||
Function 549: SeekMusicStream() (2 input parameters)
|
||||
Function 551: SeekMusicStream() (2 input parameters)
|
||||
Name: SeekMusicStream
|
||||
Return type: void
|
||||
Description: Seek music to a position (in seconds)
|
||||
Param[1]: music (type: Music)
|
||||
Param[2]: position (type: float)
|
||||
Function 550: SetMusicVolume() (2 input parameters)
|
||||
Function 552: SetMusicVolume() (2 input parameters)
|
||||
Name: SetMusicVolume
|
||||
Return type: void
|
||||
Description: Set volume for music (1.0 is max level)
|
||||
Param[1]: music (type: Music)
|
||||
Param[2]: volume (type: float)
|
||||
Function 551: SetMusicPitch() (2 input parameters)
|
||||
Function 553: SetMusicPitch() (2 input parameters)
|
||||
Name: SetMusicPitch
|
||||
Return type: void
|
||||
Description: Set pitch for a music (1.0 is base level)
|
||||
Param[1]: music (type: Music)
|
||||
Param[2]: pitch (type: float)
|
||||
Function 552: SetMusicPan() (2 input parameters)
|
||||
Function 554: SetMusicPan() (2 input parameters)
|
||||
Name: SetMusicPan
|
||||
Return type: void
|
||||
Description: Set pan for a music (0.5 is center)
|
||||
Param[1]: music (type: Music)
|
||||
Param[2]: pan (type: float)
|
||||
Function 553: GetMusicTimeLength() (1 input parameters)
|
||||
Function 555: GetMusicTimeLength() (1 input parameters)
|
||||
Name: GetMusicTimeLength
|
||||
Return type: float
|
||||
Description: Get music time length (in seconds)
|
||||
Param[1]: music (type: Music)
|
||||
Function 554: GetMusicTimePlayed() (1 input parameters)
|
||||
Function 556: GetMusicTimePlayed() (1 input parameters)
|
||||
Name: GetMusicTimePlayed
|
||||
Return type: float
|
||||
Description: Get current music time played (in seconds)
|
||||
Param[1]: music (type: Music)
|
||||
Function 555: LoadAudioStream() (3 input parameters)
|
||||
Function 557: LoadAudioStream() (3 input parameters)
|
||||
Name: LoadAudioStream
|
||||
Return type: AudioStream
|
||||
Description: Load audio stream (to stream raw audio pcm data)
|
||||
Param[1]: sampleRate (type: unsigned int)
|
||||
Param[2]: sampleSize (type: unsigned int)
|
||||
Param[3]: channels (type: unsigned int)
|
||||
Function 556: IsAudioStreamReady() (1 input parameters)
|
||||
Function 558: IsAudioStreamReady() (1 input parameters)
|
||||
Name: IsAudioStreamReady
|
||||
Return type: bool
|
||||
Description: Checks if an audio stream is ready
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Function 557: UnloadAudioStream() (1 input parameters)
|
||||
Function 559: UnloadAudioStream() (1 input parameters)
|
||||
Name: UnloadAudioStream
|
||||
Return type: void
|
||||
Description: Unload audio stream and free memory
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Function 558: UpdateAudioStream() (3 input parameters)
|
||||
Function 560: UpdateAudioStream() (3 input parameters)
|
||||
Name: UpdateAudioStream
|
||||
Return type: void
|
||||
Description: Update audio stream buffers with data
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Param[2]: data (type: const void *)
|
||||
Param[3]: frameCount (type: int)
|
||||
Function 559: IsAudioStreamProcessed() (1 input parameters)
|
||||
Function 561: IsAudioStreamProcessed() (1 input parameters)
|
||||
Name: IsAudioStreamProcessed
|
||||
Return type: bool
|
||||
Description: Check if any audio stream buffers requires refill
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Function 560: PlayAudioStream() (1 input parameters)
|
||||
Function 562: PlayAudioStream() (1 input parameters)
|
||||
Name: PlayAudioStream
|
||||
Return type: void
|
||||
Description: Play audio stream
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Function 561: PauseAudioStream() (1 input parameters)
|
||||
Function 563: PauseAudioStream() (1 input parameters)
|
||||
Name: PauseAudioStream
|
||||
Return type: void
|
||||
Description: Pause audio stream
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Function 562: ResumeAudioStream() (1 input parameters)
|
||||
Function 564: ResumeAudioStream() (1 input parameters)
|
||||
Name: ResumeAudioStream
|
||||
Return type: void
|
||||
Description: Resume audio stream
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Function 563: IsAudioStreamPlaying() (1 input parameters)
|
||||
Function 565: IsAudioStreamPlaying() (1 input parameters)
|
||||
Name: IsAudioStreamPlaying
|
||||
Return type: bool
|
||||
Description: Check if audio stream is playing
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Function 564: StopAudioStream() (1 input parameters)
|
||||
Function 566: StopAudioStream() (1 input parameters)
|
||||
Name: StopAudioStream
|
||||
Return type: void
|
||||
Description: Stop audio stream
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Function 565: SetAudioStreamVolume() (2 input parameters)
|
||||
Function 567: SetAudioStreamVolume() (2 input parameters)
|
||||
Name: SetAudioStreamVolume
|
||||
Return type: void
|
||||
Description: Set volume for audio stream (1.0 is max level)
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Param[2]: volume (type: float)
|
||||
Function 566: SetAudioStreamPitch() (2 input parameters)
|
||||
Function 568: SetAudioStreamPitch() (2 input parameters)
|
||||
Name: SetAudioStreamPitch
|
||||
Return type: void
|
||||
Description: Set pitch for audio stream (1.0 is base level)
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Param[2]: pitch (type: float)
|
||||
Function 567: SetAudioStreamPan() (2 input parameters)
|
||||
Function 569: SetAudioStreamPan() (2 input parameters)
|
||||
Name: SetAudioStreamPan
|
||||
Return type: void
|
||||
Description: Set pan for audio stream (0.5 is centered)
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Param[2]: pan (type: float)
|
||||
Function 568: SetAudioStreamBufferSizeDefault() (1 input parameters)
|
||||
Function 570: SetAudioStreamBufferSizeDefault() (1 input parameters)
|
||||
Name: SetAudioStreamBufferSizeDefault
|
||||
Return type: void
|
||||
Description: Default size for new audio streams
|
||||
Param[1]: size (type: int)
|
||||
Function 569: SetAudioStreamCallback() (2 input parameters)
|
||||
Function 571: SetAudioStreamCallback() (2 input parameters)
|
||||
Name: SetAudioStreamCallback
|
||||
Return type: void
|
||||
Description: Audio thread callback to request new data
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Param[2]: callback (type: AudioCallback)
|
||||
Function 570: AttachAudioStreamProcessor() (2 input parameters)
|
||||
Function 572: AttachAudioStreamProcessor() (2 input parameters)
|
||||
Name: AttachAudioStreamProcessor
|
||||
Return type: void
|
||||
Description: Attach audio stream processor to stream, receives the samples as 'float'
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Param[2]: processor (type: AudioCallback)
|
||||
Function 571: DetachAudioStreamProcessor() (2 input parameters)
|
||||
Function 573: DetachAudioStreamProcessor() (2 input parameters)
|
||||
Name: DetachAudioStreamProcessor
|
||||
Return type: void
|
||||
Description: Detach audio stream processor from stream
|
||||
Param[1]: stream (type: AudioStream)
|
||||
Param[2]: processor (type: AudioCallback)
|
||||
Function 572: AttachAudioMixedProcessor() (1 input parameters)
|
||||
Function 574: AttachAudioMixedProcessor() (1 input parameters)
|
||||
Name: AttachAudioMixedProcessor
|
||||
Return type: void
|
||||
Description: Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'
|
||||
Param[1]: processor (type: AudioCallback)
|
||||
Function 573: DetachAudioMixedProcessor() (1 input parameters)
|
||||
Function 575: DetachAudioMixedProcessor() (1 input parameters)
|
||||
Name: DetachAudioMixedProcessor
|
||||
Return type: void
|
||||
Description: Detach audio stream processor from the entire audio pipeline
|
||||
|
|
|
|||
|
|
@ -670,7 +670,7 @@
|
|||
<Param type="unsigned int" name="frames" desc="" />
|
||||
</Callback>
|
||||
</Callbacks>
|
||||
<Functions count="573">
|
||||
<Functions count="575">
|
||||
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
|
||||
<Param type="int" name="width" desc="" />
|
||||
<Param type="int" name="height" desc="" />
|
||||
|
|
@ -703,9 +703,9 @@
|
|||
<Function name="ClearWindowState" retType="void" paramCount="1" desc="Clear window configuration state flags">
|
||||
<Param type="unsigned int" name="flags" desc="" />
|
||||
</Function>
|
||||
<Function name="ToggleFullscreen" retType="void" paramCount="0" desc="Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)">
|
||||
<Function name="ToggleFullscreen" retType="void" paramCount="0" desc="Toggle window state: fullscreen/windowed [resizes monitor to match window resolution] (only PLATFORM_DESKTOP)">
|
||||
</Function>
|
||||
<Function name="ToggleBorderlessWindowed" retType="void" paramCount="0" desc="Toggle window state: borderless windowed (only PLATFORM_DESKTOP)">
|
||||
<Function name="ToggleBorderlessWindowed" retType="void" paramCount="0" desc="Toggle window state: borderless windowed [resizes window to match monitor resolution] (only PLATFORM_DESKTOP)">
|
||||
</Function>
|
||||
<Function name="MaximizeWindow" retType="void" paramCount="0" desc="Set window state: maximized, if resizable (only PLATFORM_DESKTOP)">
|
||||
</Function>
|
||||
|
|
@ -1353,8 +1353,8 @@
|
|||
<Param type="int" name="centerX" desc="" />
|
||||
<Param type="int" name="centerY" desc="" />
|
||||
<Param type="float" name="radius" desc="" />
|
||||
<Param type="Color" name="color1" desc="" />
|
||||
<Param type="Color" name="color2" desc="" />
|
||||
<Param type="Color" name="inner" desc="" />
|
||||
<Param type="Color" name="outer" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawCircleV" retType="void" paramCount="3" desc="Draw a color-filled circle (Vector version)">
|
||||
<Param type="Vector2" name="center" desc="" />
|
||||
|
|
@ -1431,23 +1431,23 @@
|
|||
<Param type="int" name="posY" desc="" />
|
||||
<Param type="int" name="width" desc="" />
|
||||
<Param type="int" name="height" desc="" />
|
||||
<Param type="Color" name="color1" desc="" />
|
||||
<Param type="Color" name="color2" desc="" />
|
||||
<Param type="Color" name="top" desc="" />
|
||||
<Param type="Color" name="bottom" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawRectangleGradientH" retType="void" paramCount="6" desc="Draw a horizontal-gradient-filled rectangle">
|
||||
<Param type="int" name="posX" desc="" />
|
||||
<Param type="int" name="posY" desc="" />
|
||||
<Param type="int" name="width" desc="" />
|
||||
<Param type="int" name="height" desc="" />
|
||||
<Param type="Color" name="color1" desc="" />
|
||||
<Param type="Color" name="color2" desc="" />
|
||||
<Param type="Color" name="left" desc="" />
|
||||
<Param type="Color" name="right" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawRectangleGradientEx" retType="void" paramCount="5" desc="Draw a gradient-filled rectangle with custom vertex colors">
|
||||
<Param type="Rectangle" name="rec" desc="" />
|
||||
<Param type="Color" name="col1" desc="" />
|
||||
<Param type="Color" name="col2" desc="" />
|
||||
<Param type="Color" name="col3" desc="" />
|
||||
<Param type="Color" name="col4" desc="" />
|
||||
<Param type="Color" name="topLeft" desc="" />
|
||||
<Param type="Color" name="bottomLeft" desc="" />
|
||||
<Param type="Color" name="topRight" desc="" />
|
||||
<Param type="Color" name="bottomRight" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawRectangleLines" retType="void" paramCount="5" desc="Draw rectangle outline">
|
||||
<Param type="int" name="posX" desc="" />
|
||||
|
|
@ -2637,6 +2637,20 @@
|
|||
<Param type="Vector3" name="scale" desc="" />
|
||||
<Param type="Color" name="tint" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawModelPoints" retType="void" paramCount="4" desc="Draw a model as points">
|
||||
<Param type="Model" name="model" desc="" />
|
||||
<Param type="Vector3" name="position" desc="" />
|
||||
<Param type="float" name="scale" desc="" />
|
||||
<Param type="Color" name="tint" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawModelPointsEx" retType="void" paramCount="6" desc="Draw a model as points with extended parameters">
|
||||
<Param type="Model" name="model" desc="" />
|
||||
<Param type="Vector3" name="position" desc="" />
|
||||
<Param type="Vector3" name="rotationAxis" desc="" />
|
||||
<Param type="float" name="rotationAngle" desc="" />
|
||||
<Param type="Vector3" name="scale" desc="" />
|
||||
<Param type="Color" name="tint" desc="" />
|
||||
</Function>
|
||||
<Function name="DrawBoundingBox" retType="void" paramCount="2" desc="Draw bounding box (wires)">
|
||||
<Param type="BoundingBox" name="box" desc="" />
|
||||
<Param type="Color" name="color" desc="" />
|
||||
|
|
|
|||
|
|
@ -17,9 +17,8 @@ if (NOT raylib_FOUND) # If there's none, fetch and build raylib
|
|||
FetchContent_GetProperties(raylib)
|
||||
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
|
||||
set(FETCHCONTENT_QUIET NO)
|
||||
FetchContent_Populate(raylib)
|
||||
FetchContent_MakeAvailable(raylib)
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples
|
||||
add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
|||
4
src/external/RGFW.h
vendored
4
src/external/RGFW.h
vendored
|
|
@ -4999,7 +4999,9 @@ static const struct wl_callback_listener wl_surface_frame_listener = {
|
|||
#define WIN32_LEAN_AND_MEAN
|
||||
#define OEMRESOURCE
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
__declspec(dllimport) int __stdcall WideCharToMultiByte( UINT CodePage, DWORD dwFlags, const WCHAR* lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCCH lpDefaultChar, LPBOOL lpUsedDefaultChar);
|
||||
|
||||
#include <processthreadsapi.h>
|
||||
#include <wchar.h>
|
||||
#include <locale.h>
|
||||
|
|
|
|||
|
|
@ -281,14 +281,15 @@ void android_main(struct android_app *app)
|
|||
// Request to end the native activity
|
||||
ANativeActivity_finish(app->activity);
|
||||
|
||||
// Android ALooper_pollAll() variables
|
||||
// Android ALooper_pollOnce() variables
|
||||
int pollResult = 0;
|
||||
int pollEvents = 0;
|
||||
|
||||
// Waiting for application events before complete finishing
|
||||
while (!app->destroyRequested)
|
||||
{
|
||||
while ((pollResult = ALooper_pollAll(0, NULL, &pollEvents, (void **)&platform.source)) >= 0)
|
||||
// Poll all events until we reach return value TIMEOUT, meaning no events left to process
|
||||
while ((pollResult = ALooper_pollOnce(0, NULL, &pollEvents, (void **)&platform.source)) > ALOOPER_POLL_TIMEOUT)
|
||||
{
|
||||
if (platform.source != NULL) platform.source->process(app, platform.source);
|
||||
}
|
||||
|
|
@ -682,22 +683,23 @@ void PollInputEvents(void)
|
|||
CORE.Input.Keyboard.keyRepeatInFrame[i] = 0;
|
||||
}
|
||||
|
||||
// Android ALooper_pollAll() variables
|
||||
// Android ALooper_pollOnce() variables
|
||||
int pollResult = 0;
|
||||
int pollEvents = 0;
|
||||
|
||||
// Poll Events (registered events)
|
||||
// Poll Events (registered events) until we reach TIMEOUT which indicates there are no events left to poll
|
||||
// NOTE: Activity is paused if not enabled (platform.appEnabled)
|
||||
while ((pollResult = ALooper_pollAll(platform.appEnabled? 0 : -1, NULL, &pollEvents, (void**)&platform.source)) >= 0)
|
||||
while ((pollResult = ALooper_pollOnce(platform.appEnabled? 0 : -1, NULL, &pollEvents, (void**)&platform.source)) > ALOOPER_POLL_TIMEOUT)
|
||||
{
|
||||
// Process this event
|
||||
if (platform.source != NULL) platform.source->process(platform.app, platform.source);
|
||||
|
||||
// NOTE: Never close window, native activity is controlled by the system!
|
||||
// NOTE: Allow closing the window in case a configuration change happened.
|
||||
// The android_main function should be allowed to return to its caller in order for the
|
||||
// Android OS to relaunch the activity.
|
||||
if (platform.app->destroyRequested != 0)
|
||||
{
|
||||
//CORE.Window.shouldClose = true;
|
||||
//ANativeActivity_finish(platform.app->activity);
|
||||
CORE.Window.shouldClose = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -767,20 +769,20 @@ int InitPlatform(void)
|
|||
|
||||
TRACELOG(LOG_INFO, "PLATFORM: ANDROID: Initialized successfully");
|
||||
|
||||
// Android ALooper_pollAll() variables
|
||||
// Android ALooper_pollOnce() variables
|
||||
int pollResult = 0;
|
||||
int pollEvents = 0;
|
||||
|
||||
// Wait for window to be initialized (display and context)
|
||||
while (!CORE.Window.ready)
|
||||
{
|
||||
// Process events loop
|
||||
while ((pollResult = ALooper_pollAll(0, NULL, &pollEvents, (void**)&platform.source)) >= 0)
|
||||
// Process events until we reach TIMEOUT, which indicates no more events queued.
|
||||
while ((pollResult = ALooper_pollOnce(0, NULL, &pollEvents, (void**)&platform.source)) > ALOOPER_POLL_TIMEOUT)
|
||||
{
|
||||
// Process this event
|
||||
if (platform.source != NULL) platform.source->process(platform.app, platform.source);
|
||||
|
||||
// NOTE: Never close window, native activity is controlled by the system!
|
||||
// NOTE: It's highly likely destroyRequested will never be non-zero at the start of the activity lifecycle.
|
||||
//if (platform.app->destroyRequested != 0) CORE.Window.shouldClose = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -811,6 +813,12 @@ void ClosePlatform(void)
|
|||
eglTerminate(platform.device);
|
||||
platform.device = EGL_NO_DISPLAY;
|
||||
}
|
||||
|
||||
// NOTE: Reset global state in case the activity is being relaunched.
|
||||
if (platform.app->destroyRequested != 0) {
|
||||
CORE = (CoreData){0};
|
||||
platform = (PlatformData){0};
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize display device and framebuffer
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ static void ErrorCallback(int error, const char *description);
|
|||
|
||||
// Window callbacks events
|
||||
static void WindowSizeCallback(GLFWwindow *window, int width, int height); // GLFW3 WindowSize Callback, runs when window is resized
|
||||
static void WindowPosCallback(GLFWwindow* window, int x, int y); // GLFW3 WindowPos Callback, runs when window is moved
|
||||
static void WindowIconifyCallback(GLFWwindow *window, int iconified); // GLFW3 WindowIconify Callback, runs when window is minimized/restored
|
||||
static void WindowMaximizeCallback(GLFWwindow* window, int maximized); // GLFW3 Window Maximize Callback, runs when window is maximized
|
||||
static void WindowFocusCallback(GLFWwindow *window, int focused); // GLFW3 WindowFocus Callback, runs when window get/lose focus
|
||||
|
|
@ -147,8 +148,8 @@ void ToggleFullscreen(void)
|
|||
if (!CORE.Window.fullscreen)
|
||||
{
|
||||
// Store previous window position (in case we exit fullscreen)
|
||||
glfwGetWindowPos(platform.handle, &CORE.Window.position.x, &CORE.Window.position.y);
|
||||
|
||||
CORE.Window.previousPosition = CORE.Window.position;
|
||||
|
||||
int monitorCount = 0;
|
||||
int monitorIndex = GetCurrentMonitor();
|
||||
GLFWmonitor **monitors = glfwGetMonitors(&monitorCount);
|
||||
|
|
@ -179,7 +180,11 @@ void ToggleFullscreen(void)
|
|||
CORE.Window.fullscreen = false;
|
||||
CORE.Window.flags &= ~FLAG_FULLSCREEN_MODE;
|
||||
|
||||
glfwSetWindowMonitor(platform.handle, NULL, CORE.Window.position.x, CORE.Window.position.y, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
|
||||
glfwSetWindowMonitor(platform.handle, NULL, CORE.Window.previousPosition.x, CORE.Window.previousPosition.y, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
|
||||
|
||||
// we update the window position right away
|
||||
CORE.Window.position.x = CORE.Window.previousPosition.x;
|
||||
CORE.Window.position.y = CORE.Window.previousPosition.y;
|
||||
}
|
||||
|
||||
// Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS)
|
||||
|
|
@ -190,11 +195,11 @@ void ToggleFullscreen(void)
|
|||
// Toggle borderless windowed mode
|
||||
void ToggleBorderlessWindowed(void)
|
||||
{
|
||||
// Leave fullscreen before attempting to set borderless windowed mode and get screen position from it
|
||||
// Leave fullscreen before attempting to set borderless windowed mode
|
||||
bool wasOnFullscreen = false;
|
||||
if (CORE.Window.fullscreen)
|
||||
{
|
||||
CORE.Window.previousPosition = CORE.Window.position;
|
||||
// fullscreen already saves the previous position so it does not need to be set here again
|
||||
ToggleFullscreen();
|
||||
wasOnFullscreen = true;
|
||||
}
|
||||
|
|
@ -213,7 +218,7 @@ void ToggleBorderlessWindowed(void)
|
|||
{
|
||||
// Store screen position and size
|
||||
// NOTE: If it was on fullscreen, screen position was already stored, so skip setting it here
|
||||
if (!wasOnFullscreen) glfwGetWindowPos(platform.handle, &CORE.Window.previousPosition.x, &CORE.Window.previousPosition.y);
|
||||
if (!wasOnFullscreen) CORE.Window.previousPosition = CORE.Window.position;
|
||||
CORE.Window.previousScreen = CORE.Window.screen;
|
||||
|
||||
// Set undecorated and topmost modes and flags
|
||||
|
|
@ -255,6 +260,9 @@ void ToggleBorderlessWindowed(void)
|
|||
glfwFocusWindow(platform.handle);
|
||||
|
||||
CORE.Window.flags &= ~FLAG_BORDERLESS_WINDOWED_MODE;
|
||||
|
||||
CORE.Window.position.x = CORE.Window.previousPosition.x;
|
||||
CORE.Window.position.y = CORE.Window.previousPosition.y;
|
||||
}
|
||||
}
|
||||
else TRACELOG(LOG_WARNING, "GLFW: Failed to find video mode for selected monitor");
|
||||
|
|
@ -592,6 +600,9 @@ void SetWindowTitle(const char *title)
|
|||
// Set window position on screen (windowed mode)
|
||||
void SetWindowPosition(int x, int y)
|
||||
{
|
||||
// Update CORE.Window.position as well
|
||||
CORE.Window.position.x = x;
|
||||
CORE.Window.position.y = y;
|
||||
glfwSetWindowPos(platform.handle, x, y);
|
||||
}
|
||||
|
||||
|
|
@ -614,8 +625,9 @@ void SetWindowMonitor(int monitor)
|
|||
{
|
||||
TRACELOG(LOG_INFO, "GLFW: Selected monitor: [%i] %s", monitor, glfwGetMonitorName(monitors[monitor]));
|
||||
|
||||
const int screenWidth = CORE.Window.screen.width;
|
||||
const int screenHeight = CORE.Window.screen.height;
|
||||
// Here the render width has to be used again in case high dpi flag is enabled
|
||||
const int screenWidth = CORE.Window.render.width;
|
||||
const int screenHeight = CORE.Window.render.height;
|
||||
int monitorWorkareaX = 0;
|
||||
int monitorWorkareaY = 0;
|
||||
int monitorWorkareaWidth = 0;
|
||||
|
|
@ -1568,12 +1580,17 @@ int InitPlatform(void)
|
|||
int monitorWidth = 0;
|
||||
int monitorHeight = 0;
|
||||
glfwGetMonitorWorkarea(monitor, &monitorX, &monitorY, &monitorWidth, &monitorHeight);
|
||||
|
||||
int posX = monitorX + (monitorWidth - (int)CORE.Window.screen.width)/2;
|
||||
int posY = monitorY + (monitorHeight - (int)CORE.Window.screen.height)/2;
|
||||
|
||||
// Here CORE.Window.render.width/height should be used instead of CORE.Window.screen.width/height to center the window correctly when the high dpi flag is enabled.
|
||||
int posX = monitorX + (monitorWidth - (int)CORE.Window.render.width)/2;
|
||||
int posY = monitorY + (monitorHeight - (int)CORE.Window.render.height)/2;
|
||||
if (posX < monitorX) posX = monitorX;
|
||||
if (posY < monitorY) posY = monitorY;
|
||||
SetWindowPosition(posX, posY);
|
||||
|
||||
// Update CORE.Window.position here so it is correct from the start
|
||||
CORE.Window.position.x = posX;
|
||||
CORE.Window.position.y = posY;
|
||||
}
|
||||
|
||||
// Load OpenGL extensions
|
||||
|
|
@ -1585,6 +1602,7 @@ int InitPlatform(void)
|
|||
//----------------------------------------------------------------------------
|
||||
// Set window callback events
|
||||
glfwSetWindowSizeCallback(platform.handle, WindowSizeCallback); // NOTE: Resizing not allowed by default!
|
||||
glfwSetWindowPosCallback(platform.handle, WindowPosCallback);
|
||||
glfwSetWindowMaximizeCallback(platform.handle, WindowMaximizeCallback);
|
||||
glfwSetWindowIconifyCallback(platform.handle, WindowIconifyCallback);
|
||||
glfwSetWindowFocusCallback(platform.handle, WindowFocusCallback);
|
||||
|
|
@ -1681,7 +1699,12 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
|||
|
||||
// NOTE: Postprocessing texture is not scaled to new size
|
||||
}
|
||||
|
||||
static void WindowPosCallback(GLFWwindow* window, int x, int y)
|
||||
{
|
||||
// Set current window position
|
||||
CORE.Window.position.x = x;
|
||||
CORE.Window.position.y = y;
|
||||
}
|
||||
static void WindowContentScaleCallback(GLFWwindow *window, float scalex, float scaley)
|
||||
{
|
||||
CORE.Window.screenScale = MatrixScale(scalex, scaley, 1.0f);
|
||||
|
|
|
|||
|
|
@ -76,9 +76,7 @@ void CloseWindow(void);
|
|||
#define Size NSSIZE
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
__declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char *lpMultiByteStr, int cbMultiByte, wchar_t *lpWideCharStr, int cchWideChar);
|
||||
#endif
|
||||
|
||||
#include "../external/RGFW.h"
|
||||
|
||||
|
|
@ -538,10 +536,8 @@ void *GetWindowHandle(void)
|
|||
{
|
||||
#ifdef RGFW_WEBASM
|
||||
return (void*)platform.window->src.ctx;
|
||||
#elif !defined(RGFW_WINDOWS)
|
||||
return (void *)platform.window->src.window;
|
||||
#else
|
||||
return platform.window->src.hwnd;
|
||||
return (void*)platform.window->src.window;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ static const short linuxToRaylibMap[KEYMAP_SIZE] = {
|
|||
[BTN_TL] = GAMEPAD_BUTTON_LEFT_TRIGGER_1,
|
||||
[BTN_TL2] = GAMEPAD_BUTTON_LEFT_TRIGGER_2,
|
||||
[BTN_TR] = GAMEPAD_BUTTON_RIGHT_TRIGGER_1,
|
||||
[BTN_TR2] GAMEPAD_BUTTON_RIGHT_TRIGGER_2,
|
||||
[BTN_TR2] = GAMEPAD_BUTTON_RIGHT_TRIGGER_2,
|
||||
[BTN_SELECT] = GAMEPAD_BUTTON_MIDDLE_LEFT,
|
||||
[BTN_MODE] = GAMEPAD_BUTTON_MIDDLE,
|
||||
[BTN_START] = GAMEPAD_BUTTON_MIDDLE_RIGHT,
|
||||
|
|
|
|||
|
|
@ -1626,7 +1626,9 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data,
|
|||
{
|
||||
music.ctxType = MUSIC_AUDIO_FLAC;
|
||||
music.ctxData = ctxFlac;
|
||||
music.stream = LoadAudioStream(ctxFlac->sampleRate, ctxFlac->bitsPerSample, ctxFlac->channels);
|
||||
int sampleSize = ctxFlac->bitsPerSample;
|
||||
if (ctxFlac->bitsPerSample == 24) sampleSize = 16; // Forcing conversion to s16 on UpdateMusicStream()
|
||||
music.stream = LoadAudioStream(ctxFlac->sampleRate, sampleSize, ctxFlac->channels);
|
||||
music.frameCount = (unsigned int)ctxFlac->totalPCMFrameCount;
|
||||
music.looping = true; // Looping enabled by default
|
||||
musicLoaded = true;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue