Expand description
🛡️ V-Shield - Platform Layer + Sync Primitives for Ry-Dit
V-Shield provee:
- 🎨 Colores constantes para RyDit (con o sin raylib)
- đź”’ Sync Primitives multiplataforma (Mutex, RwLock, Barrier, Condvar)
- 🖥️ Platform Detection (Linux, Windows, macOS, Android, iOS, WASM)
- 🔄 Platform Sync para sincronización de renderizado
§Features
| Feature | DescripciĂłn | Dependencias |
|---|---|---|
native (default) | Sync nativo (std::sync) | Ninguna extra |
wasm | Sync para WASM | Ninguna extra |
graphics (default) | Colores raylib + window init | raylib |
async-tokio | Wrappers async | tokio (solo sync) |
rt-linux | Linux real-time | rtsc |
§Ejemplo rápido
use v_shield::sync::{Mutex, RwLock};
use v_shield::platform::{current_platform, PlatformConfig};
use v_shield::platform_sync::PlatformSync;
// Platform detection
let p = current_platform();
println!("Running on: {}", p.name());
// Config defaults
let config = PlatformConfig::for_current();
// Sync primitives
let data = Mutex::new(vec![1, 2, 3]);
let cache = RwLock::new(String::new());
// Platform sync para renderizado
let mut sync = PlatformSync::new();
// sync.sync(); // al final de cada frame§Para Termux/Android
Funciona sin cambios en Termux. Solo necesitas:
pkg install clang libx11-dev libxcb-devRe-exports§
pub use platform::current_platform;pub use platform::Platform;pub use platform::PlatformConfig;pub use platform_sync::PlatformSync;pub use platform_sync::PlatformSyncMode;pub use raylib;pub use raylib::consts::KeyboardKey::*;
Modules§
- audio
- Contains code related to audio.
RaylibAudioplays sounds and music. - automation
- callbacks
- camera
- Utility code for using Raylib
Camera3DandCamera2D - collision
- Common collision handling code
- color
Colormanipulation helpers- consts
- Various constant enums to use with raylib
- core
- data
- Data manipulation functions. Compress and Decompress with DEFLATE
- drawing
- Contains code related to drawing. Types that can be set as a surface to draw will implement the
RaylibDrawtrait - ease
- Easing and interpolation helpers.
- error
- Definitions for error types used throught the crate
- ffi
- The raw, unsafe FFI binding, in case you need that escape hatch or the safe layer doesn’t provide something you need.
- file
- File manipulation functions. Should be parity with std::fs except on emscripten
- input
- Keyboard, Controller, and Mouse related functions
- logging
- math
- misc
- Useful functions that don’t fit anywhere else
- models
- 3D Model, Mesh, and Animation
- platform
- 🛡️ V-Shield Platform Detection
- platform_
sync - 🛡️ V-Shield Platform Sync
- rgui
- shaders
- Code for the safe manipulation of shaders
- sync
- 🛡️ V-Shield Sync Primitives
- text
- Text and Font related functions Text manipulation functions are super unsafe so use rust String functions
- texture
- Image and texture related functions
- vr
- Vr related functions
- window
- Window manipulation functions
Macros§
Structs§
- Audio
Stream - Audio
Stream Processor Callback - This struct encapsulates a rust callback
and guarantees the lifetime to be long enough (’a)
(once
get_as_user_datais called, it the struct should not be moved again! -> use Pin<..>) - Automation
Event - Automation
Event List - Bone
Info - Bounding
Box - Camera2D
- Camera3D
- Color
- Dropped
File Path List - File
Path List - Font
- Glyph
Info - Image
- Image
Colors - Image
Palette - Material
- Material
Map - Matrix
- Mesh
- Model
- Model
Animation - Monitor
Info - Music
- Mutex
- A mutual exclusion primitive useful for protecting shared data
- NPatch
Info - RSlice
Glyph Info - RSlice
Vec4 - Rand
SeqIterator - Random
Sequence - Struct for holding the result of RaylibHandle::load_random_sequence. This is a thin wrapper for an array of i32. The reason it exists is because Raylib expects you to unload the sequence it creates manually, and this struct does it for you.
- Ray
- RayCollision
- Raylib
Audio - This token is used to indicate audio is initialized. It’s also used to create
Wave,Sound,Music,AudioStream, andSoundAlias. All of those have a lifetime that is bound to RaylibAudio. The compiler will disallow you from using them without ensuring that theRaylibAudiois present while doing so. - Raylib
Audio Init Error - Raylib
Blend Mode - Raylib
Builder - A builder that allows more customization of the game window shown to the user before the
RaylibHandleis created. - Raylib
Draw Handle - Raylib
Handle - The main interface into the Raylib API.
- Raylib
Mode2D - Raylib
Mode3D - Raylib
Scissor Mode - Raylib
Shader Mode - Raylib
Texture Mode - Raylib
Thread - This token is used to ensure certain functions are only running on the same thread raylib was initialized from. This is useful for architectures like macos where cocoa can only be called from one thread.
- RaylibVR
Mode - Rectangle
- Render
Texture2D - RwLock
- A reader-writer lock
- SetLog
Error - Shader
- Sound
- Sound
Alias - Texture2D
- Transform
- Vector2
- Vector3
- Vector4
- VrDevice
Info - VrStereo
Config - Wave
- Wave
Samples - Weak
Font - Weak
Material - Weak
Mesh - Weak
Model - Weak
Model Animation - Weak
Render Texture2D - Weak
Shader - Weak
Texture2D - Window
State
Enums§
- Blend
Mode - Camera
Mode - Camera
Projection - Color
RyDit - Colores básicos para RyDit
- Config
Flags - Cubemap
Layout - Gamepad
Axis - Gamepad
Button - Gesture
- GuiCheck
BoxProperty - GuiColor
Picker Property - GuiCombo
BoxProperty - GuiControl
- GuiControl
Property - GuiDefault
Property - GuiDropdown
BoxProperty - GuiIcon
Name - GuiList
View Property - GuiProgress
BarProperty - GuiScroll
BarProperty - GuiSlider
Property - GuiSpinner
Property - GuiState
- GuiText
Alignment - GuiText
Alignment Vertical - GuiText
BoxProperty - GuiText
Wrap Mode - GuiToggle
Property - Keyboard
Key - Material
MapIndex - Mouse
Button - Mouse
Cursor - NPatch
Layout - Pixel
Format - Shader
Location Index - Shader
Uniform Data Type - Texture
Filter - Texture
Wrap - Trace
LogLevel
Constants§
- BLACK
- BLUE
- BROWN
- CYAN
- DEG2RAD
- GRAY
- GREEN
- LIME
- MAGENTA
- MAROON
- MAX_
MATERIAL_ MAPS - MAX_
SHADER_ LOCATIONS - NAVY
- OLIVE
- ORANGE
- PI
- PINK
- PURPLE
- RAD2DEG
- RED
- TEAL
- VERSION
- VersiĂłn del crate
- WHITE
- YELLOW
Traits§
- AsF32
- Audio
Sample - A marker trait specifying an audio sample (
u8,i16, orf32). - GuiProperty
- Raylib
Blend Mode Ext - Raylib
Draw - Raylib
Draw3D - Raylib
Draw Gui - Raylib
Font - Raylib
Material - Raylib
Mesh - Raylib
Mode2D Ext - Raylib
Mode3D Ext - Raylib
Model - Raylib
Model Animation - Raylib
Render Texture2D - Raylib
Scissor Mode Ext - Raylib
Shader - Raylib
Shader Mode Ext - Raylib
Texture2D - Raylib
Texture Mode Ext - RaylibVR
Mode Ext - ShaderV
Functions§
- attach_
audio_ stream_ processor_ to_ music - check_
collision_ circles - Checks collision between two circles.
- check_
collision_ lines - Check the collision between two lines defined by two points each, returns collision point by reference
- check_
collision_ point_ circle - Checks if point is inside circle.
- check_
collision_ point_ line - Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
- check_
collision_ point_ poly - Check if point is within a polygon described by array of vertices
- check_
collision_ point_ triangle - Checks if point is inside a triangle.
- check_
collision_ spheres - Detects collision between two spheres.
- compress_
data - Compress data (DEFLATE algorythm)
- custom_
trace_ âšlog_ callback - decode_
data_ base64 - decompress_
data - Decompress data (DEFLATE algorythm)
- encode_
data_ base64 - Encode data to Base64 string
- export_
data_ as_ code - Export data to code (.h), returns true on success
- gen_
image_ font_ atlas - Generates image font atlas using
charsinfo. Sets a pointer to an array of rectangles raylib allocated that MUST manually be freed. Good luck freeing it safely though ;) - get_
camera_ matrix - Returns camera transform matrix (view matrix)
- get_
camera_ matrix2D - Returns camera 2D transform matrix (view matrix)
- get_
current_ monitor - get_
current_ monitor_ index - get_
monitor_ count - Get number of connected monitors
- get_
monitor_ height - Get height of monitor Only checks that monitor index is in range in debug mode
- get_
monitor_ info - Gets the attributes of the monitor as well as the name fails if monitor name is not a utf8 string
- get_
monitor_ name - Get name of monitor Only checks that monitor index is in range in debug mode
- get_
monitor_ physical_ height - Get physical height of monitor Only checks that monitor index is in range in debug mode
- get_
monitor_ physical_ width - Get physical width of monitor Only checks that monitor index is in range in debug mode
- get_
monitor_ position - Get position of monitor Only checks that monitor index is in range in debug mode
- get_
monitor_ refresh_ rate - Get specified monitor refresh rate
- get_
monitor_ width - Get width of monitor Only checks that monitor index is in range in debug mode
- get_
pixel_ data_ size - Gets pixel data size in bytes (image or texture).
- get_
ray_ collision_ model - Gets collision info between ray and model.
- get_
ray_ collision_ quad - Gets collision info between ray and model.
- get_
ray_ collision_ sphere - Detects collision between ray and sphere.
- get_
ray_ collision_ triangle - Gets collision info between ray and triangle.
- init
- Creates a
RaylibBuilderfor choosing window options before initialization. - init_
window - Inicializar ventana
- key_
from_ i32 - lerp
- A convenience function for linearly interpolating an
f32. - open_
url - Open URL with default system browser (if available)
- rcolor
- rquat
- A convenience function for making a new
Quaternion. - rrect
- A convenience function for making a new
Rectangle. - rvec2
- A convenience function for making a new
Vector2. - rvec3
- A convenience function for making a new
Vector3. - set_
audio_ stream_ callback - Audio thread callback to request new data
- set_
load_ file_ data_ callback - Set custom file binary data loader
- set_
load_ file_ text_ callback - Set custom file text data loader
- set_
save_ file_ data_ callback - Set custom file binary data saver
- set_
save_ file_ text_ callback - Set custom file text data saver
- set_
trace_ log_ callback - Set custom trace log