3 Commits

Author SHA1 Message Date
e1a40799bd docs: fix typos (#6375) 2026-11-07 12:28:22 +01:00
b72f0377e4 [examples] Fix 2D camera offsets (#6372)
* [examples] Fix 2D camera offsets

* Remove raymath.h includes
2026-11-07 10:56:03 +01:00
a375c6dca4 [raudio] Clamp envelope point counts in jar_xm module loader (#6371)
Co-authored-by: eunho87 <freeim7144@gmail.com>
2026-11-07 10:54:00 +01:00
6 changed files with 15 additions and 10 deletions

View File

@ -3,7 +3,7 @@
Some people ported raylib to other languages in the form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list or if it had been updated/archived.
# Recommendations for binding authors.
This is a set of recomendations and guidelines for binding authors, meant to help your binding be as useful as possible to your users.
This is a set of recommendations and guidelines for binding authors, meant to help your binding be as useful as possible to your users.
* Binding should be reasonably up to date with the last release, out of date bindings may be removed from bindings.md
* Binding should expose all of raylib's API. This is to ensure compatibility with all raylib features, and allow your users to do everything in the target language they can do in C raylib.
@ -16,7 +16,7 @@ This is a set of recomendations and guidelines for binding authors, meant to hel
* Bindings that expose additional 'high level' functions to make the binding more native to the host language, should also include the base C style API in addition to those other functions. This is requested in order to make it easier for people to understand the raylib API independent of the language being used.
* Bindings should have clear usage and setup instructions. Examples in the host language are highly recommended. You want your users to be able to get started right away.
* If a binding exists for a language, before making a new one, binding authors should try to work together on maintaining a single binding for a language, this is requested in order to prevent fragmentation and confusion for users.
* Instructions on how to build for web are highly recomeneed if the langauge supports it. This allows your bindings to be used for game jams :)
* Instructions on how to build for web are highly recommended if the language supports it. This allows your bindings to be used for game jams :)
### Language Bindings

View File

@ -56,6 +56,8 @@ int main(void)
camera.target = Vector2Add(camera.target, delta);
}
Vector2 renderScale = { (float)GetRenderWidth()/GetScreenWidth(), (float)GetRenderHeight()/GetScreenHeight() };
if (zoomMode == 0)
{
// Zoom based on mouse wheel
@ -66,7 +68,7 @@ int main(void)
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
// Set the offset to where the mouse is, mouse is scaled to viewport space, but offset is in unscaled pixels
camera.offset = Vector2Multiply(GetMousePosition(), GetWindowScaleDPI());
camera.offset = Vector2Multiply(GetMousePosition(), renderScale);
// Set the target to match, so that the camera maps the world space point
// under the cursor to the screen space point under the cursor at any zoom
@ -87,7 +89,7 @@ int main(void)
Vector2 mouseWorldPos = GetScreenToWorld2D(GetMousePosition(), camera);
// Set the offset to where the mouse is, mouse is scaled to viewport space, but offset is in unscaled pixels
camera.offset = Vector2Multiply(GetMousePosition(), GetWindowScaleDPI());
camera.offset = Vector2Multiply(GetMousePosition(), renderScale);
// Set the target to match, so that the camera maps the world space point
// under the cursor to the screen space point under the cursor at any zoom

View File

@ -19,7 +19,6 @@
********************************************************************************************/
#include "raylib.h"
#include "raymath.h"
#define PLAYER_SIZE 40
@ -40,13 +39,13 @@ int main(void)
Camera2D camera1 = { 0 };
camera1.target = (Vector2){ player1.x, player1.y };
camera1.offset = Vector2Multiply((Vector2){ 200.0f, 200.0f }, GetWindowScaleDPI());
camera1.offset = (Vector2){ 200.0f, 200.0f };
camera1.rotation = 0.0f;
camera1.zoom = 1.0f;
Camera2D camera2 = { 0 };
camera2.target = (Vector2){ player2.x, player2.y };
camera2.offset = Vector2Multiply((Vector2){ 200.0f, 200.0f }, GetWindowScaleDPI());
camera2.offset = (Vector2){ 200.0f, 200.0f };
camera2.rotation = 0.0f;
camera2.zoom = 1.0f;

View File

@ -18,7 +18,6 @@
#include "raylib.h"
#include "rlgl.h" // Required for: rlSetBlendFactorsSeparate()
#include "raymath.h" // Required for: Vector2Multiply()
//------------------------------------------------------------------------------------
// Program main entry point
@ -47,7 +46,7 @@ int main(void)
// Set magnifying glass zoom
camera.zoom = 2;
// Offset by half the size of the magnifying glass to counteract drawing the texture centered on the mouse position
camera.offset = Vector2Multiply((Vector2){ 128, 128 }, GetWindowScaleDPI());
camera.offset = (Vector2){ 128, 128 };
SetTargetFPS(60);
//--------------------------------------------------------------------------------------

View File

@ -4,7 +4,7 @@ This provides a base project template which builds with [CMake](https://cmake.or
## Usage
To compile the example, use one of the following dependending on your build target...
To compile the example, use one of the following depending on your build target...
### Desktop

View File

@ -902,6 +902,11 @@ char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t modd
instr->volume_envelope.num_points = READ_U8(offset + 225);
instr->panning_envelope.num_points = READ_U8(offset + 226);
if (instr->volume_envelope.num_points > NUM_ENVELOPE_POINTS)
instr->volume_envelope.num_points = NUM_ENVELOPE_POINTS;
if (instr->panning_envelope.num_points > NUM_ENVELOPE_POINTS)
instr->panning_envelope.num_points = NUM_ENVELOPE_POINTS;
for(uint8_t j = 0; j < instr->volume_envelope.num_points; ++j) {
instr->volume_envelope.points[j].frame = READ_U16(offset + 129 + 4 * j);
instr->volume_envelope.points[j].value = READ_U16(offset + 129 + 4 * j + 2);