WARNING: This addition is based on a PR and it's still under review, not sure if it will be maintained in the future. In general, raylib tries to avoid callbacks usage mechanisms.
As prior commit, but complete fix for XBox controller and trigger
buttons too.
> The joystick range is a float from -1 through +1. Casting this to int
> yields only three possible values: -1, 0, and 1. This gives a
> misleading joystick placement in the demo.
>
> By casting to int after the multiplication to get pixel values, the
> demo reveals the analog feel of the joystick.
The joystick range is a float from -1 through +1. Casting this to int
yields only three possible values: -1, 0, and 1. This gives a
misleading joystick placement in the demo.
By casting to int after the multiplication, the demo reveals the
analog feel of the joystick.
* Start 2d lights example.
* finish example
* update image.
* Cleanup render textures
* Fixes to handle shadows on edges that are near to the light better.
* tabs
* move to shapes
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
* Add panning to raudio and update audio_raw_stream example.
* remove pan smoothing, code formatting changes following pull request comments
Co-authored-by: Ray <raysan5@gmail.com>
* Add zig buildfile for examples.
- `zig build` to compile all examples
- `zig build [module]` to compile all examples for a module (e.g. `zig build core`)
- `zig build [example]` to compile _and run_ a particular example (e.g. `zig build core_basic_window`)
You can use `-Dtarget=` to compile for a non-native platform, such as
`zig build -Dtarget=x86_64-windows-gnu` to compile from Linux to
Windows.
* Skip pthread example on Windows.
* Select appropriate lib file based on target.
raylib was using `stb_perlin.h` library to generate perlin noise, it seems that recently this library has been flagged as it could be infringing some algorythm patent. For security, it has been removed from raylib.
CONVENTIONS:
- Functions are always self-contained, no function use another raymath function inside, required code is directly re-implemented inside
- Functions input parameters are always received by value
- Functions use always a "result" variable for return
- Functions are always defined inline
- Angles are always in radians (DEG2RAD/RAD2DEG macros provided for convenience)
* new models_magicavoxel_loading example
* Portable header-only file "magicavoxel_loader.h" for MagicaVoxel loader example.
* models_magicavoxel_loading example added to CMakeLists.txt and Makefile
* fix models_magicavoxel_loading example for linux.
* * vox_loader into "src/external/vox_loader.h"
* vox file support for "models.c"
* updated example "models/models_magicavoxel_loading.c"
* * Fix Vox_FreeArrays (removed memory leak)
* * removed magicavoxel_loader.h
* * Revert vs2019 solution
* * vox_loader.h -> Support custom memory allocators
* vox_loader.h -> Reverse Y<>Z for left to right handed system
* models/models_magicavoxel_loading.c -> fix model center
* * vox_loader.h -> Removed Raylib dependencies
* * Changed Vox_LoadFileName to Vox_LoadFromMemory
* new models_magicavoxel_loading example
* Portable header-only file "magicavoxel_loader.h" for MagicaVoxel loader example.
* models_magicavoxel_loading example added to CMakeLists.txt and Makefile
* fix models_magicavoxel_loading example for linux.
* * vox_loader into "src/external/vox_loader.h"
* vox file support for "models.c"
* updated example "models/models_magicavoxel_loading.c"
* * Fix Vox_FreeArrays (removed memory leak)
* * removed magicavoxel_loader.h
* * Revert vs2019 solution
- DrawTextRec() and DrawTextRecEx() have been moved to example, those functions could be very specific depending on user needs so it's better to give the user the full source in case of special requirements instead of allowing a function with +10 input parameters.
* Fix Makefile to build WASM examples.
- Add --preload-file flag before specifying the resource dir
- Add empty resource dir to `shapes/` (otherwise wasm-ld will fail)
- Add wasm outputs to .gitigore
* Delete .gitignore
Co-authored-by: Ray <raysan5@gmail.com>
Now rlgl uses the `Matrix` type, just make sure it has been previously defined somewhere... I don't like this approach but it's probably the easier one for the users... still looking for a better solution... maybe using something like
`#define MATRIX_TYPE`, so it can be checked in other modules.
rlgl has been redesigned to avoid any dependency to `raylib` or `raymath`, all functions using some of those libs have been reviewed.
- REMOVED: `Texture2D`, `Shader` structs dependency
- REMOVED: `Vector3`, `Matrix` structs dependency
- REMOVED: raymath functions dependency, all required math is implemented in rlgl
- ADDED: `rlMatrix` custom rlgl type
- ADDED: `utils.c`: `rlMatrixFromMatrix()` and `rlMatrixToMatrix()` for a safe conversion between raylib<->rlgl matrix types
- ADDED: `rl` prefix to all `rlgl` structs
- Other small tweaks here and there
* Added my own model and license to Raylib exclusively created by me and provided for use in the examples (and other projects if anyone decides to)
* Use animation vertices on initial load if possible.
* Added girl model to model example
* Revamped GLTF model loading as it was wrong by default. Also updated some comments.
GLTF models were loaded only by mesh but they should be loaded recursively by hierarchical nodes because tehre are some static node transformations that are to be applied to the vertices. It also resulted in more meshes being included in some models.
It is the correct way of loading GLTF and what is suggested in the official examples.
Currenlty limiting to only one scene but more can be included later.
* Refactored the new names and structure of extracted functions.
* Safer and easier read value.
* Made reading easier for accessor->bufferView->buffer in GLTF.
Now there is no need to check for supported types or anything.
* Correct inclusion of limits.h in the cases of MSVC based compilers vs the world
* Removed weird example file
RENAMED: GetCodepoints() -> LoadCodepoints(), now codepoint array data is loaded dynamically instead of reusing a limited static buffer.
ADDED: UnloadCodepoints() to safely free loaded codepoints
RENAMED: GetNextCodepoint() -> GetCodepoint()
Added missing null terminator when adding characters to the string, otherwise garbage values are read (often zeros which are equal to '\0', but not every time).
This error results in random characters appearing in the text box every one in a while:
```
asdfg??? ll??
```
It is corrected with the proposed fix.
This problem was observed by my student, Gonzalo Rivera Lazo.
* Hotfix for glitchy camera
Super small fix that was causing the camera to glitch every x amount of seconds/pixels. Works much better now, 3/4 lines changed.
* fixed dumb visual studio formatting problems
* Typo fix
Changed "bsasic" to "basic" in the comments.
* Added pixel-perfect camera example
Added pixel-perfect camera example, both the .c file and the cover .png image. The example works with any resolution you want, as long as the ratio stays the same
(ex. 16:9, 4:3) ecc.
* Fixed Typecasts
Fixed compiler errors (implicit conversions)
* Precomputed rectangles, time-based movement and whitespace fix
Moved the source and destination rectangles for the renderTexture into their own variables, modified the animation to be time-based instead of frame-based, fixed the bug with whitespaces.
* Fixed spacing and added more consistency with sinf() and cosf()
* Fixed *= operator spacing
* Added an example for raylib OpenGL interop.
* Removed C99 variable-length array to fix MSVC errors
* Moved the opengl interop example from shaders to others.
* adds DrawTexturedPoly with example
* the actual example ... ahem
* moved DrawTexturePoly to textures function and example
NB function name changed to fit with other DrawTextureXXX functions
(no "d" )
Co-authored-by: codifies <you@example.com>
Vr simulator has been moved to core module and completely redesigned. Now user is in charge of stereo-render fbo and also in full control of distortion shader. Code is a bit more complex but better aligned with other raylib examples.
* Implement a load values from accessor function.
Added some more value types for the different GLTF attributes.
Fixed crash when loading animated triangle.
* Split GLTF model loading into separate functions for readability.
* Fixed the already working models that I broke when introducing GLTFReadValue.
Improved the example for gltf models to be able to switch between a few models.
* Removed license from screen. It is pu inside a license file anyway.
* Small improvements on the naming of functions
Removed (*model). and replaced it with model->
Some enums values have been renamed to be more consistent and also provide a more detailed description:
- ShaderLocationIndex: LOC_VERTEX_POSITION -> SHADER_SHADER_LOC_VERTEX_POSITION
- ShaderUniformDataType: UNIFORM_VEC2 -> SHADER_UNIFORM_VEC2
- MaterialMapType: MAP_ALBEDO -> MATERIAL_MAP_ALBEDO
- PixelFormat: UNCOMPRESSED_GRAYSCALE -> PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
* Added bone binding to whole mesh and not only set vertices.
+ Also added missed setting of the animation count.
+ Removed double ; on one line
* Added more of the gltf sample models
https://github.com/KhronosGroup/glTF-Sample-Models
We need to make it working for all of them.
* Binding to initial bind pose added.
* Fix cube disappearing bug because lerpPercent could be Inf.
* Fixed for rigged figure also
* Fixing typecast warnings generated by visual studio 2019 in examples.
* Changes to fixes based on feedback
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
Mostly typecasts, and some int to unsigned short changes, and including the windsock 2 library in the examples.
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
* Added example for gltf animation and split some functions for loading model animations into IQM and GLTF similar to how models are being loaded.
* Removed wrongly duplicated function
* Bone loading for gltf model (not working at this point)
* Loading info about vertex to joint connection but animation is still not working
* Skeleton and pose is correctly loaded. Need to communicate about interpolation in GLTF
* The model almost looks like a real person on animation.
* Fixed model loading with bones.
Also updated license info on the model.
* Cleaned up some code and updated examples.
* Fix identation issues
* Fix identation issues
* Fix identation issues
* Documenting the compiler flags
* Moved some android compiler flags and added documentation on them too.
* Some more restructuring.
Removed unnecessary comments that were self described by the code.
Added some more explanations around certain parts of CMake and especially around compiler flags.
* Delete emscripten.cmake
This file is not needed at this point. EMSDK provides a toolchain file that has a lot more things in it and is better supported. Project currently works fine with the documentation provided in Emscripten SDK on how to build projects.
* First pass file separation.
The main two files are cleaner now. Only important things can be seen. Major changes include:
- raylib_static is now the alias instead of raylib
- Repeating segments are removed and pulled into separate files into <root>/cmake
- File is reordered to make more sense
- Installs are better structured
- Library is build into an output directory "raylib" instead of "src"
- All public header files are now set as a public header file
- Source files need to be listed (it is a bad practice to capture them using wildcards and file globs)
- CMakeLists are better commented
* Second pass on the example dirs.
They are quite complex so I'm more hesitant to do major changes. Also it works pretty well. Noticed that I forgot one of the seperated files and added it into src/CMakeLists.txt.
* Returned the header copy as it was convenient to have the public headers copied.
* A better description to the variable RAYLIB_IS_MAIN
Co-authored-by: Rob Loach <robloach@gmail.com>
* Remove debug message
Co-authored-by: Rob Loach <robloach@gmail.com>
* Improvements based on review.
* Simplify the install condition to not be platform specific as it was before.
Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
* Remove some CMAKE variables as they don't affect the build in any way
Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
Co-authored-by: Rob Loach <robloach@gmail.com>
Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>