mirror of
https://github.com/raysan5/raylib.git
synced 2026-11-25 09:01:47 -05:00
Compare commits
10 Commits
453cc35f27
...
fdc8b37391
| Author | SHA1 | Date | |
|---|---|---|---|
| fdc8b37391 | |||
| 795ec32880 | |||
| 76ddc33b02 | |||
| 97bf3160dc | |||
| 2c620574ab | |||
| 02a65e3df6 | |||
| a7cf7e74b9 | |||
| c284ea62de | |||
| 1a615c9e64 | |||
| ae96b95c38 |
@ -124,7 +124,7 @@ This is a set of recomendations and guidelines for binding authors, meant to hel
|
||||
| [Rayua](https://github.com/uiua-lang/rayua) | **5.5** | [Uiua](https://www.uiua.org/) | **???** |
|
||||
| [Target](https://github.com/FinnDemonCat/Target/tree/main/lib/raylib) | **5.5** | [Dart](https://dart.dev/) | Apache-2.0 license |
|
||||
| [mach-raylib](https://github.com/angluca/mach-raylib) | **6.x-dev** | [Mach](https://machlang.org/) | MIT |
|
||||
| [gcl native raylib module](https://github.com/gnuchanos/GnuchanOS/tree/main/language) | **6.0** | [gclang](https://github.com/gnuchanos/GnuchanOS/tree/main/language) | GPLv3 |
|
||||
| [gcl native raylib module](https://github.com/gnuchanos/gcl/blob/main/src/Modules/gcl_raylib.c) | **6.x-dev** | [gcl](https://github.com/gnuchanos/gcl) | GPLv3 |
|
||||
|
||||
|
||||
### Utility Wrappers
|
||||
|
||||
@ -672,6 +672,7 @@ TEXTURES = \
|
||||
|
||||
TEXT = \
|
||||
text/text_3d_drawing \
|
||||
text/text_animations \
|
||||
text/text_codepoints_loading \
|
||||
text/text_font_filters \
|
||||
text/text_font_loading \
|
||||
|
||||
@ -633,6 +633,7 @@ TEXTURES = \
|
||||
|
||||
TEXT = \
|
||||
text/text_3d_drawing \
|
||||
text/text_animations \
|
||||
text/text_codepoints_loading \
|
||||
text/text_font_filters \
|
||||
text/text_font_loading \
|
||||
@ -1172,6 +1173,9 @@ text/text_3d_drawing: text/text_3d_drawing.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||
--preload-file text/resources/shaders/glsl100/alpha_discard.fs@resources/shaders/glsl100/alpha_discard.fs
|
||||
|
||||
text/text_animations: text/text_animations.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
|
||||
|
||||
text/text_codepoints_loading: text/text_codepoints_loading.c
|
||||
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) \
|
||||
--preload-file text/resources/DotGothic16-Regular.ttf@resources/DotGothic16-Regular.ttf
|
||||
|
||||
@ -19,7 +19,7 @@ Run the following commands from the repository root:
|
||||
- `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`)
|
||||
|
||||
## EXAMPLES COLLECTION [TOTAL: 222]
|
||||
## EXAMPLES COLLECTION [TOTAL: 223]
|
||||
|
||||
### category: core [49]
|
||||
|
||||
@ -169,7 +169,7 @@ Examples using raylib textures functionality, including image/textures loading/g
|
||||
| [textures_framebuffer_rendering](textures/textures_framebuffer_rendering.c) | <img src="textures/textures_framebuffer_rendering.png" alt="textures_framebuffer_rendering" width="80"> | ⭐⭐☆☆ | 5.6 | 5.6 | [Jack Boakes](https://github.com/jackboakes) |
|
||||
| [textures_portal_window](textures/textures_portal_window.c) | <img src="textures/textures_portal_window.png" alt="textures_portal_window" width="80"> | ⭐⭐⭐⭐️ | 6.0 | 6.0 | [PanicTitan](https://github.com/PanicTitan) |
|
||||
|
||||
### category: text [16]
|
||||
### category: text [17]
|
||||
|
||||
Examples using raylib text functionality, including sprite fonts loading/generation and text drawing, provided by raylib [text](../src/rtext.c) module.
|
||||
|
||||
@ -191,6 +191,7 @@ Examples using raylib text functionality, including sprite fonts loading/generat
|
||||
| [text_inline_styling](text/text_inline_styling.c) | <img src="text/text_inline_styling.png" alt="text_inline_styling" width="80"> | ⭐⭐⭐☆ | 6.0 | 6.0 | [Wagner Barongello](https://github.com/SultansOfCode) |
|
||||
| [text_words_alignment](text/text_words_alignment.c) | <img src="text/text_words_alignment.png" alt="text_words_alignment" width="80"> | ⭐☆☆☆ | 6.0 | 6.0 | [JP Mortiboys](https://github.com/themushroompirates) |
|
||||
| [text_strings_management](text/text_strings_management.c) | <img src="text/text_strings_management.png" alt="text_strings_management" width="80"> | ⭐⭐⭐☆ | 6.0 | 6.0 | [David Buzatto](https://github.com/davidbuzatto) |
|
||||
| [text_animations](text/text_animations.c) | <img src="text/text_animations.png" alt="text_animations" width="80"> | ⭐☆☆☆ | 6.0 | 6.0 | [Gabriel Piangers](https://github.com/gabriel-piangers) |
|
||||
|
||||
### category: models [32]
|
||||
|
||||
|
||||
@ -152,6 +152,7 @@ text;text_codepoints_loading;★★★☆;4.2;4.2;2022;2025;"Ramon Santamaria";@
|
||||
text;text_inline_styling;★★★☆;6.0;6.0;2025;2025;"Wagner Barongello";@SultansOfCode
|
||||
text;text_words_alignment;★☆☆☆;6.0;6.0;2025;2025;"JP Mortiboys";@themushroompirates
|
||||
text;text_strings_management;★★★☆;6.0;6.0;2025;2025;"David Buzatto";@davidbuzatto
|
||||
text;text_animations;★☆☆☆;6.0;6.0;2026;2026;"Gabriel Piangers";@gabriel-piangers
|
||||
models;models_loading_iqm;★★☆☆;2.5;3.5;2019;2025;"Culacant";@culacant
|
||||
models;models_billboard_rendering;★★★☆;1.3;3.5;2015;2025;"Ramon Santamaria";@raysan5
|
||||
models;models_box_collisions;★☆☆☆;1.3;3.5;2015;2025;"Ramon Santamaria";@raysan5
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
// Module Functions Declaration
|
||||
//------------------------------------------------------------------------------------
|
||||
static bool IsUpperBodyBone(const char *boneName);
|
||||
static void UpdateModelAnimationBones(Model *model, ModelAnimation *anim1, int frame1,
|
||||
static void UpdateModelAnimationBoneCustom(Model *model, ModelAnimation *anim1, int frame1,
|
||||
ModelAnimation *anim2, int frame2, float blend, bool upperBodyBlend);
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -117,7 +117,7 @@ int main(void)
|
||||
// When upperBodyBlend is ON: upper body = attack (1.0), lower body = walk (0.0)
|
||||
// When upperBodyBlend is OFF: uniform blend at 0.5 (50% walk, 50% attack)
|
||||
float blendFactor = (upperBodyBlend? 1.0f : 0.5f);
|
||||
UpdateModelAnimationBones(&model, &anim0, animCurrentFrame0,
|
||||
UpdateModelAnimationBoneCustom(&model, &anim0, animCurrentFrame0,
|
||||
&anim1, animCurrentFrame1, blendFactor, upperBodyBlend);
|
||||
|
||||
// raylib provided animation blending function
|
||||
@ -194,7 +194,7 @@ static bool IsUpperBodyBone(const char *boneName)
|
||||
}
|
||||
|
||||
// Blend two animations per-bone with selective upper/lower body blending
|
||||
static void UpdateModelAnimationBones(Model *model, ModelAnimation *anim0, int frame0,
|
||||
static void UpdateModelAnimationBoneCustom(Model *model, ModelAnimation *anim0, int frame0,
|
||||
ModelAnimation *anim1, int frame1, float blend, bool upperBodyBlend)
|
||||
{
|
||||
// Validate inputs
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*******************************************************************************************
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [shapes] example - rlgl color wheel
|
||||
*
|
||||
@ -74,8 +74,8 @@ int main(void)
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
triangleCount += (unsigned int)GetMouseWheelMove();
|
||||
triangleCount = (unsigned int)Clamp((float)triangleCount, (float)pointsMin, (float)pointsMax);
|
||||
float wheel = roundf(GetMouseWheelMove());
|
||||
triangleCount = (unsigned int)Clamp((float)triangleCount + wheel, (float)pointsMin, (float)pointsMax);
|
||||
|
||||
Rectangle sliderRectangle = { 42.0f, 16.0f + 64.0f + 45.0f, 64.0f, 16.0f };
|
||||
Vector2 mousePosition = GetMousePosition();
|
||||
|
||||
263
examples/text/reasings.h
Normal file
263
examples/text/reasings.h
Normal file
@ -0,0 +1,263 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* reasings - raylib easings library, based on Robert Penner library
|
||||
*
|
||||
* Useful easing functions for values animation
|
||||
*
|
||||
* This header uses:
|
||||
* #define REASINGS_STATIC_INLINE // Inlines all functions code, so it runs faster.
|
||||
* // This requires lots of memory on system.
|
||||
* How to use:
|
||||
* The four inputs t,b,c,d are defined as follows:
|
||||
* t = current time (in any unit measure, but same unit as duration)
|
||||
* b = starting value to interpolate
|
||||
* c = the total change in value of b that needs to occur
|
||||
* d = total time it should take to complete (duration)
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* int currentTime = 0;
|
||||
* int duration = 100;
|
||||
* float startPositionX = 0.0f;
|
||||
* float finalPositionX = 30.0f;
|
||||
* float currentPositionX = startPositionX;
|
||||
*
|
||||
* while (currentPositionX < finalPositionX)
|
||||
* {
|
||||
* currentPositionX = EaseSineIn(currentTime, startPositionX, finalPositionX - startPositionX, duration);
|
||||
* currentTime++;
|
||||
* }
|
||||
*
|
||||
* A port of Robert Penner's easing equations to C (http://robertpenner.com/easing/)
|
||||
*
|
||||
* Robert Penner License
|
||||
* ---------------------------------------------------------------------------------
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright (c) 2001 Robert Penner. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* - Neither the name of the author nor the names of contributors may be used
|
||||
* to endorse or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ---------------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2015-2024 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose, including commercial
|
||||
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not claim that you
|
||||
* wrote the original software. If you use this software in a product, an acknowledgment
|
||||
* in the product documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
||||
* as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*
|
||||
**********************************************************************************************/
|
||||
|
||||
#ifndef REASINGS_H
|
||||
#define REASINGS_H
|
||||
|
||||
#define REASINGS_STATIC_INLINE // NOTE: By default, compile functions as static inline
|
||||
|
||||
#if defined(REASINGS_STATIC_INLINE)
|
||||
#define EASEDEF static inline
|
||||
#else
|
||||
#define EASEDEF extern
|
||||
#endif
|
||||
|
||||
#include <math.h> // Required for: sinf(), cosf(), sqrtf(), powf()
|
||||
|
||||
#ifndef PI
|
||||
#define PI 3.14159265358979323846f //Required as PI is not always defined in math.h
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { // Prevents name mangling of functions
|
||||
#endif
|
||||
|
||||
// Linear Easing functions
|
||||
EASEDEF float EaseLinearNone(float t, float b, float c, float d) { return (c*t/d + b); } // Ease: Linear
|
||||
EASEDEF float EaseLinearIn(float t, float b, float c, float d) { return (c*t/d + b); } // Ease: Linear In
|
||||
EASEDEF float EaseLinearOut(float t, float b, float c, float d) { return (c*t/d + b); } // Ease: Linear Out
|
||||
EASEDEF float EaseLinearInOut(float t, float b, float c, float d) { return (c*t/d + b); } // Ease: Linear In Out
|
||||
|
||||
// Sine Easing functions
|
||||
EASEDEF float EaseSineIn(float t, float b, float c, float d) { return (-c*cosf(t/d*(PI/2.0f)) + c + b); } // Ease: Sine In
|
||||
EASEDEF float EaseSineOut(float t, float b, float c, float d) { return (c*sinf(t/d*(PI/2.0f)) + b); } // Ease: Sine Out
|
||||
EASEDEF float EaseSineInOut(float t, float b, float c, float d) { return (-c/2.0f*(cosf(PI*t/d) - 1.0f) + b); } // Ease: Sine In Out
|
||||
|
||||
// Circular Easing functions
|
||||
EASEDEF float EaseCircIn(float t, float b, float c, float d) { t /= d; return (-c*(sqrtf(1.0f - t*t) - 1.0f) + b); } // Ease: Circular In
|
||||
EASEDEF float EaseCircOut(float t, float b, float c, float d) { t = t/d - 1.0f; return (c*sqrtf(1.0f - t*t) + b); } // Ease: Circular Out
|
||||
EASEDEF float EaseCircInOut(float t, float b, float c, float d) // Ease: Circular In Out
|
||||
{
|
||||
if ((t/=d/2.0f) < 1.0f) return (-c/2.0f*(sqrtf(1.0f - t*t) - 1.0f) + b);
|
||||
t -= 2.0f; return (c/2.0f*(sqrtf(1.0f - t*t) + 1.0f) + b);
|
||||
}
|
||||
|
||||
// Cubic Easing functions
|
||||
EASEDEF float EaseCubicIn(float t, float b, float c, float d) { t /= d; return (c*t*t*t + b); } // Ease: Cubic In
|
||||
EASEDEF float EaseCubicOut(float t, float b, float c, float d) { t = t/d - 1.0f; return (c*(t*t*t + 1.0f) + b); } // Ease: Cubic Out
|
||||
EASEDEF float EaseCubicInOut(float t, float b, float c, float d) // Ease: Cubic In Out
|
||||
{
|
||||
if ((t/=d/2.0f) < 1.0f) return (c/2.0f*t*t*t + b);
|
||||
t -= 2.0f; return (c/2.0f*(t*t*t + 2.0f) + b);
|
||||
}
|
||||
|
||||
// Quadratic Easing functions
|
||||
EASEDEF float EaseQuadIn(float t, float b, float c, float d) { t /= d; return (c*t*t + b); } // Ease: Quadratic In
|
||||
EASEDEF float EaseQuadOut(float t, float b, float c, float d) { t /= d; return (-c*t*(t - 2.0f) + b); } // Ease: Quadratic Out
|
||||
EASEDEF float EaseQuadInOut(float t, float b, float c, float d) // Ease: Quadratic In Out
|
||||
{
|
||||
if ((t/=d/2) < 1) return (((c/2)*(t*t)) + b);
|
||||
return (-c/2.0f*(((t - 1.0f)*(t - 3.0f)) - 1.0f) + b);
|
||||
}
|
||||
|
||||
// Exponential Easing functions
|
||||
EASEDEF float EaseExpoIn(float t, float b, float c, float d) { return (t == 0.0f) ? b : (c*powf(2.0f, 10.0f*(t/d - 1.0f)) + b); } // Ease: Exponential In
|
||||
EASEDEF float EaseExpoOut(float t, float b, float c, float d) { return (t == d) ? (b + c) : (c*(-powf(2.0f, -10.0f*t/d) + 1.0f) + b); } // Ease: Exponential Out
|
||||
EASEDEF float EaseExpoInOut(float t, float b, float c, float d) // Ease: Exponential In Out
|
||||
{
|
||||
if (t == 0.0f) return b;
|
||||
if (t == d) return (b + c);
|
||||
if ((t/=d/2.0f) < 1.0f) return (c/2.0f*powf(2.0f, 10.0f*(t - 1.0f)) + b);
|
||||
|
||||
return (c/2.0f*(-powf(2.0f, -10.0f*(t - 1.0f)) + 2.0f) + b);
|
||||
}
|
||||
|
||||
// Back Easing functions
|
||||
EASEDEF float EaseBackIn(float t, float b, float c, float d) // Ease: Back In
|
||||
{
|
||||
float s = 1.70158f;
|
||||
float postFix = t/=d;
|
||||
return (c*(postFix)*t*((s + 1.0f)*t - s) + b);
|
||||
}
|
||||
|
||||
EASEDEF float EaseBackOut(float t, float b, float c, float d) // Ease: Back Out
|
||||
{
|
||||
float s = 1.70158f;
|
||||
t = t/d - 1.0f;
|
||||
return (c*(t*t*((s + 1.0f)*t + s) + 1.0f) + b);
|
||||
}
|
||||
|
||||
EASEDEF float EaseBackInOut(float t, float b, float c, float d) // Ease: Back In Out
|
||||
{
|
||||
float s = 1.70158f;
|
||||
if ((t/=d/2.0f) < 1.0f)
|
||||
{
|
||||
s *= 1.525f;
|
||||
return (c/2.0f*(t*t*((s + 1.0f)*t - s)) + b);
|
||||
}
|
||||
|
||||
float postFix = t-=2.0f;
|
||||
s *= 1.525f;
|
||||
return (c/2.0f*((postFix)*t*((s + 1.0f)*t + s) + 2.0f) + b);
|
||||
}
|
||||
|
||||
// Bounce Easing functions
|
||||
EASEDEF float EaseBounceOut(float t, float b, float c, float d) // Ease: Bounce Out
|
||||
{
|
||||
if ((t/=d) < (1.0f/2.75f))
|
||||
{
|
||||
return (c*(7.5625f*t*t) + b);
|
||||
}
|
||||
else if (t < (2.0f/2.75f))
|
||||
{
|
||||
float postFix = t-=(1.5f/2.75f);
|
||||
return (c*(7.5625f*(postFix)*t + 0.75f) + b);
|
||||
}
|
||||
else if (t < (2.5/2.75))
|
||||
{
|
||||
float postFix = t-=(2.25f/2.75f);
|
||||
return (c*(7.5625f*(postFix)*t + 0.9375f) + b);
|
||||
}
|
||||
else
|
||||
{
|
||||
float postFix = t-=(2.625f/2.75f);
|
||||
return (c*(7.5625f*(postFix)*t + 0.984375f) + b);
|
||||
}
|
||||
}
|
||||
|
||||
EASEDEF float EaseBounceIn(float t, float b, float c, float d) { return (c - EaseBounceOut(d - t, 0.0f, c, d) + b); } // Ease: Bounce In
|
||||
EASEDEF float EaseBounceInOut(float t, float b, float c, float d) // Ease: Bounce In Out
|
||||
{
|
||||
if (t < d/2.0f) return (EaseBounceIn(t*2.0f, 0.0f, c, d)*0.5f + b);
|
||||
else return (EaseBounceOut(t*2.0f - d, 0.0f, c, d)*0.5f + c*0.5f + b);
|
||||
}
|
||||
|
||||
// Elastic Easing functions
|
||||
EASEDEF float EaseElasticIn(float t, float b, float c, float d) // Ease: Elastic In
|
||||
{
|
||||
if (t == 0.0f) return b;
|
||||
if ((t/=d) == 1.0f) return (b + c);
|
||||
|
||||
float p = d*0.3f;
|
||||
float a = c;
|
||||
float s = p/4.0f;
|
||||
float postFix = a*powf(2.0f, 10.0f*(t-=1.0f));
|
||||
|
||||
return (-(postFix*sinf((t*d-s)*(2.0f*PI)/p )) + b);
|
||||
}
|
||||
|
||||
EASEDEF float EaseElasticOut(float t, float b, float c, float d) // Ease: Elastic Out
|
||||
{
|
||||
if (t == 0.0f) return b;
|
||||
if ((t/=d) == 1.0f) return (b + c);
|
||||
|
||||
float p = d*0.3f;
|
||||
float a = c;
|
||||
float s = p/4.0f;
|
||||
|
||||
return (a*powf(2.0f,-10.0f*t)*sinf((t*d-s)*(2.0f*PI)/p) + c + b);
|
||||
}
|
||||
|
||||
EASEDEF float EaseElasticInOut(float t, float b, float c, float d) // Ease: Elastic In Out
|
||||
{
|
||||
if (t == 0.0f) return b;
|
||||
if ((t/=d/2.0f) == 2.0f) return (b + c);
|
||||
|
||||
float p = d*(0.3f*1.5f);
|
||||
float a = c;
|
||||
float s = p/4.0f;
|
||||
|
||||
if (t < 1.0f)
|
||||
{
|
||||
float postFix = a*powf(2.0f, 10.0f*(t-=1.0f));
|
||||
return -0.5f*(postFix*sinf((t*d-s)*(2.0f*PI)/p)) + b;
|
||||
}
|
||||
|
||||
float postFix = a*powf(2.0f, -10.0f*(t-=1.0f));
|
||||
|
||||
return (postFix*sinf((t*d-s)*(2.0f*PI)/p)*0.5f + c + b);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // REASINGS_H
|
||||
158
examples/text/text_animations.c
Normal file
158
examples/text/text_animations.c
Normal file
@ -0,0 +1,158 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [text] example - animations
|
||||
*
|
||||
* Example complexity rating: [★☆☆☆] 1/4
|
||||
*
|
||||
* Example originally created with raylib 6.0, last time updated with raylib 6.0
|
||||
*
|
||||
* Example contributed by Gabriel Piangers (@gabriel-piangers) 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) 2026 Gabriel Piangers (@gabriel-piangers)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
#include "reasings.h" // Required for: Easing functions
|
||||
#include "raymath.h" // Required for: Clamp()
|
||||
|
||||
#define MAX_TEXT_LENGTH 64
|
||||
#define TEXT_SPACING 4
|
||||
|
||||
// Animated text type
|
||||
typedef struct {
|
||||
char str[MAX_TEXT_LENGTH]; // Text to animate
|
||||
Vector2 position; // Text position on screen
|
||||
float delta; // Intensity of the effect (does not apply for flashing)
|
||||
float offset; // Time offset (in frames) between each char
|
||||
float duration; // Time duration (in frames) of the animation
|
||||
} AnimatedText;
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Program main entry point
|
||||
//------------------------------------------------------------------------------------
|
||||
int main(void)
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [text] example - animations");
|
||||
|
||||
char animations[3][MAX_TEXT_LENGTH] = { "Waving", "Flashing", "Shaking" };
|
||||
int animationsSize = sizeof(animations)/sizeof(animations[0]);
|
||||
int currentAnimation = 0;
|
||||
|
||||
AnimatedText text = { "This is an animated text!", { 200, 250 }, 24.0f, 6, 60 };
|
||||
int frameCount = 0;
|
||||
|
||||
Vector2 glyphPosition[MAX_TEXT_LENGTH] = { 0 };
|
||||
unsigned char glyphAlpha[MAX_TEXT_LENGTH] = { 0 };
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
frameCount++;
|
||||
|
||||
if (IsKeyPressed(KEY_S)) text.delta = Clamp(text.delta - 2.0f, 10.0f, 60.0f);
|
||||
else if (IsKeyPressed(KEY_W)) text.delta = Clamp(text.delta + 2.0f, 10.0f, 60.0f);
|
||||
if (IsKeyPressed(KEY_A)) text.duration = (int) Clamp((float) text.duration - 5.0f, 20.0f, 120.0f);
|
||||
else if (IsKeyPressed(KEY_D)) text.duration = (int) Clamp((float) text.duration + 5.0f, 20.0f, 120.0f);
|
||||
if (IsKeyPressed(KEY_Z)) text.offset = Clamp(text.offset - 1.0f, 0.0f, 15.0f);
|
||||
else if (IsKeyPressed(KEY_X)) text.offset = Clamp(text.offset + 1.0f, 0.0f, 15.0f);
|
||||
if (IsKeyPressed(KEY_Q)) currentAnimation = currentAnimation? currentAnimation - 1 : animationsSize - 1;
|
||||
else if (IsKeyPressed(KEY_E)) currentAnimation = (currentAnimation + 1)%animationsSize;
|
||||
|
||||
for (unsigned int i = 0, offsetX = 0; i < TextLength(text.str); i++)
|
||||
{
|
||||
// NOTE: Calculating every glyph position by its width
|
||||
glyphPosition[i] = (Vector2) { text.position.x + offsetX, text.position.y };
|
||||
glyphAlpha[i] = 255U;
|
||||
|
||||
offsetX += (MeasureText(TextSubtext(text.str, i, 1), 30) + TEXT_SPACING);
|
||||
}
|
||||
|
||||
switch (currentAnimation)
|
||||
{
|
||||
case 0: // Waving animation
|
||||
{
|
||||
for (unsigned int i = 0; i < TextLength(text.str); i++)
|
||||
{
|
||||
float time = (int) (frameCount + i*text.offset)%(int)text.duration;
|
||||
|
||||
if (time < text.duration/2) glyphPosition[i].y = EaseSineIn(time, text.position.y, text.delta, text.duration);
|
||||
else glyphPosition[i].y = EaseSineOut(time, text.position.y + text.delta, -text.delta, text.duration);
|
||||
}
|
||||
} break;
|
||||
case 1: // Flashing animation
|
||||
{
|
||||
for (unsigned int i = 0; i < TextLength(text.str); i++)
|
||||
{
|
||||
float time = (int) (frameCount + i*text.offset)%(int)text.duration;
|
||||
glyphAlpha[i] = (unsigned char) EaseSineInOut(time, 255.0f, -255.0f, text.duration);
|
||||
}
|
||||
} break;
|
||||
case 2: // Shaking animation
|
||||
{
|
||||
for (unsigned int i = 0; i < TextLength(text.str); i++)
|
||||
{
|
||||
float time = (int) (frameCount + i*text.offset)%(int)text.duration;
|
||||
float deltaX = (float) GetRandomValue(-text.delta/10, text.delta/10);
|
||||
float deltaY = (float) GetRandomValue(-text.delta/10, text.delta/10);
|
||||
|
||||
if (time < (text.duration/2))
|
||||
{
|
||||
glyphPosition[i].x = EaseLinearNone(time, glyphPosition[i].x, deltaX, text.duration/2);
|
||||
glyphPosition[i].y = EaseLinearNone(time, text.position.y, deltaY, text.duration/2);
|
||||
}
|
||||
else
|
||||
{
|
||||
glyphPosition[i].x = EaseLinearNone(time - text.duration/2, glyphPosition[i].x + deltaX, -deltaX, text.duration/2);
|
||||
glyphPosition[i].y = EaseLinearNone(time - text.duration/2, text.position.y + deltaY, -deltaY, text.duration/2);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawText(TextFormat("Duration (A | D): %d", text.duration), 20, 20, 20, GRAY);
|
||||
DrawText(TextFormat("Delta (W | S): %.1f", text.delta), 20, 50, 20, GRAY);
|
||||
DrawText(TextFormat("Offset (Z | X): %.1f", text.offset), 20, 80, 20, GRAY);
|
||||
DrawText(TextFormat("Curent Animation (Q | E): %s", animations[currentAnimation]), 20, 110, 20, GRAY);
|
||||
|
||||
for (unsigned int i = 0; i < TextLength(text.str); i++)
|
||||
{
|
||||
// NOTE: Drawing text glyph by glyph, so, spacing is actually not used
|
||||
DrawTextEx(GetFontDefault(), TextSubtext(text.str, i, 1), glyphPosition[i],
|
||||
GetFontDefault().baseSize*3.0f, 0, (Color) { 200U, 122U, 255U, glyphAlpha[i] });
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
examples/text/text_animations.png
Normal file
BIN
examples/text/text_animations.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
569
projects/VS2022/examples/text_animations.vcxproj
Normal file
569
projects/VS2022/examples/text_animations.vcxproj
Normal file
@ -0,0 +1,569 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug.DLL|ARM64">
|
||||
<Configuration>Debug.DLL</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug.DLL|Win32">
|
||||
<Configuration>Debug.DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug.DLL|x64">
|
||||
<Configuration>Debug.DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release.DLL|ARM64">
|
||||
<Configuration>Release.DLL</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release.DLL|Win32">
|
||||
<Configuration>Release.DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release.DLL|x64">
|
||||
<Configuration>Release.DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F42CD94A-7008-42AB-BABF-B2053B6E6D77}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>text_animations</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>text_animations</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\build\$(ProjectName)\obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'">
|
||||
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\..\examples\text</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
<Message>Copy Debug DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
<Message>Copy Debug DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|ARM64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
<Message>Copy Debug DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy Release DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy Release DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release.DLL|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<RemoveUnreferencedCodeData>true</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)"</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy Release DLL to output directory</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\examples\text\text_animations.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\..\examples\examples.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\raylib\raylib.vcxproj">
|
||||
<Project>{e89d61ac-55de-4482-afd4-df7242ebc859}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@ -465,6 +465,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders_lights_bloom", "exa
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audio_amp_envelope", "examples\audio_amp_envelope.vcxproj", "{B767C0BE-CE22-4683-B671-0EF4E73676A5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "text_animations", "examples\text_animations.vcxproj", "{F42CD94A-7008-42AB-BABF-B2053B6E6D77}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug.DLL|ARM64 = Debug.DLL|ARM64
|
||||
@ -5833,6 +5835,30 @@ Global
|
||||
{B767C0BE-CE22-4683-B671-0EF4E73676A5}.Release|x64.Build.0 = Release|x64
|
||||
{B767C0BE-CE22-4683-B671-0EF4E73676A5}.Release|x86.ActiveCfg = Release|Win32
|
||||
{B767C0BE-CE22-4683-B671-0EF4E73676A5}.Release|x86.Build.0 = Release|Win32
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug.DLL|ARM64.ActiveCfg = Debug.DLL|ARM64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug.DLL|ARM64.Build.0 = Debug.DLL|ARM64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug.DLL|x64.Build.0 = Debug.DLL|x64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug|x64.Build.0 = Debug|x64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Debug|x86.Build.0 = Debug|Win32
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release.DLL|ARM64.ActiveCfg = Release.DLL|ARM64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release.DLL|ARM64.Build.0 = Release.DLL|ARM64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release.DLL|x64.ActiveCfg = Release.DLL|x64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release.DLL|x64.Build.0 = Release.DLL|x64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release.DLL|x86.Build.0 = Release.DLL|Win32
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release|x64.ActiveCfg = Release|x64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release|x64.Build.0 = Release|x64
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release|x86.ActiveCfg = Release|Win32
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -5995,7 +6021,7 @@ Global
|
||||
{C54703BF-D68A-480D-BE27-49B62E45D582} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9}
|
||||
{9CD8BCAD-F212-4BCC-BA98-899743CE3279} = {CC132A4D-D081-4C26-BFB9-AB11984054F8}
|
||||
{0981CA28-E4A5-4DF1-987F-A41D09131EFC} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035}
|
||||
{6B1A933E-71B8-4C1F-9E79-02D98830E671} = {278D8859-20B1-428F-8448-064F46E1F021}
|
||||
{6B1A933E-71B8-4C1F-9E79-02D98830E671} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A}
|
||||
{6BFF72EA-7362-4A3B-B6E5-9A3655BBBDA3} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9}
|
||||
{6777EC3C-077C-42FC-B4AD-B799CE55CCE4} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A}
|
||||
{A61DAD9C-271C-4E95-81AA-DB4CD58564D4} = {6C82BAAE-BDDF-457D-8FA8-7E2490B07035}
|
||||
@ -6067,6 +6093,7 @@ Global
|
||||
{69717464-8311-4E93-8787-E9046472F120} = {AF5BEC5C-1F2B-4DA8-B12D-D09FE569237C}
|
||||
{C9B012F6-95F3-4DD5-ACCF-98283EA01D0E} = {5317807F-61D4-4E0F-B6DC-2D9F12621ED9}
|
||||
{B767C0BE-CE22-4683-B671-0EF4E73676A5} = {CC132A4D-D081-4C26-BFB9-AB11984054F8}
|
||||
{F42CD94A-7008-42AB-BABF-B2053B6E6D77} = {8D3C83B7-F1E0-4C2E-9E34-EE5F6AB2502A}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29}
|
||||
|
||||
@ -328,8 +328,9 @@
|
||||
#define SUPPORT_MESH_GENERATION 1
|
||||
#endif
|
||||
#ifndef SUPPORT_GPU_SKINNING
|
||||
// GPU skinning disabled by default, some GPUs do not support more than 8 VBOs
|
||||
#define SUPPORT_GPU_SKINNING 0
|
||||
// GPU skinning enabled by default for GL3.3+,
|
||||
// Some GPUs do not support more than 8 VBOs so you may need to disable it if you have issues loading animated models
|
||||
#define SUPPORT_GPU_SKINNING 1
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
14
src/external/rlsw.h
vendored
14
src/external/rlsw.h
vendored
@ -4931,10 +4931,16 @@ void swTexStorage2D(int width, int height, SWinternalformat format)
|
||||
case SW_R32F: pixelFormat = SW_PIXELFORMAT_COLOR_R32; break;
|
||||
case SW_RGB32F: pixelFormat = SW_PIXELFORMAT_COLOR_R32G32B32; break;
|
||||
case SW_RGBA32F: pixelFormat = SW_PIXELFORMAT_COLOR_R32G32B32A32; break;
|
||||
case SW_DEPTH_COMPONENT16: pixelFormat = SW_PIXELFORMAT_DEPTH_D16; break;
|
||||
case SW_DEPTH_COMPONENT24: pixelFormat = SW_PIXELFORMAT_DEPTH_D32; break;
|
||||
case SW_DEPTH_COMPONENT32: pixelFormat = SW_PIXELFORMAT_DEPTH_D32; break;
|
||||
case SW_DEPTH_COMPONENT32F: pixelFormat = SW_PIXELFORMAT_DEPTH_D32; break;
|
||||
case SW_DEPTH_COMPONENT16:
|
||||
case SW_DEPTH_COMPONENT24:
|
||||
case SW_DEPTH_COMPONENT32:
|
||||
case SW_DEPTH_COMPONENT32F:
|
||||
{
|
||||
pixelFormat = SW_FRAMEBUFFER_DEPTH_FORMAT;
|
||||
int requestedFormat = (format == SW_DEPTH_COMPONENT16)? SW_PIXELFORMAT_DEPTH_D16 : SW_PIXELFORMAT_DEPTH_D32;
|
||||
if (requestedFormat != pixelFormat) SW_LOG("WARNING: RLSW: Coercing depth internalformat %d to framebuffer depth format\n", format);
|
||||
break;
|
||||
}
|
||||
default: RLSW.errCode = SW_INVALID_ENUM; return;
|
||||
}
|
||||
|
||||
|
||||
@ -303,14 +303,16 @@ void ToggleBorderlessWindowed(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove undecorated flag
|
||||
// WARNING: Decorating the window resizes it, launching FramebufferSizeCallback() that
|
||||
// overwrites screen size and position, so it must be done before restoring previous values
|
||||
glfwSetWindowAttrib(platform.handle, GLFW_DECORATED, GLFW_TRUE);
|
||||
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNDECORATED);
|
||||
|
||||
// Restore previous screen values
|
||||
CORE.Window.position = CORE.Window.previousPosition;
|
||||
CORE.Window.screen = CORE.Window.previousScreen;
|
||||
|
||||
// Remove undecorated flag
|
||||
glfwSetWindowAttrib(platform.handle, GLFW_DECORATED, GLFW_TRUE);
|
||||
FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNDECORATED);
|
||||
|
||||
#if !defined(__APPLE__) && !defined(_GLFW_WAYLAND)
|
||||
// Make sure to restore size considering HighDPI scaling
|
||||
// NOTE: On Wayland, GLFW_SCALE_FRAMEBUFFER handles scaling, skip manual resize
|
||||
|
||||
@ -158,6 +158,9 @@ static PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = NULL;
|
||||
// Flags that have no operations to perform during an update
|
||||
#define FLAG_MASK_NO_UPDATE (FLAG_WINDOW_HIGHDPI | FLAG_MSAA_4X_HINT)
|
||||
|
||||
// Lowest extended-key scancode, start of keyboardKeyFromExtendedScancode[]
|
||||
#define EXTENDED_KEY_OFFSET 0x1C
|
||||
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
@ -482,190 +485,6 @@ static void *WglGetProcAddress(const char *procname)
|
||||
return proc;
|
||||
}
|
||||
|
||||
// Get key from wparam (mapping)
|
||||
static KeyboardKey GetKeyFromWparam(WPARAM wparam)
|
||||
{
|
||||
switch (wparam)
|
||||
{
|
||||
/* case VK_LBUTTON: return KEY_; */
|
||||
/* case VK_RBUTTON: return KEY_; */
|
||||
/* case VK_CANCEL: return KEY_; */
|
||||
/* case VK_MBUTTON: return KEY_; */
|
||||
/* case VK_XBUTTON1: return KEY_; */
|
||||
/* case VK_XBUTTON2: return KEY_; */
|
||||
/* case VK_BACK: return KEY_; */
|
||||
/* case VK_TAB: return KEY_; */
|
||||
/* case VK_CLEAR: return KEY_; */
|
||||
case VK_RETURN: return KEY_ENTER;
|
||||
/* case VK_SHIFT: return KEY_; */
|
||||
/* case VK_CONTROL: return KEY_; */
|
||||
/* case VK_MENU: return KEY_; */
|
||||
/* case VK_PAUSE: return KEY_; */
|
||||
/* case VK_CAPITAL: return KEY_; */
|
||||
/* case VK_KANA: return KEY_; */
|
||||
/* case VK_HANGUL: return KEY_; */
|
||||
/* case VK_IME_ON: return KEY_; */
|
||||
/* case VK_JUNJA: return KEY_; */
|
||||
/* case VK_FINAL: return KEY_; */
|
||||
/* case VK_HANJA: return KEY_; */
|
||||
/* case VK_KANJI: return KEY_; */
|
||||
/* case VK_IME_OFF: return KEY_; */
|
||||
case VK_ESCAPE: return KEY_ESCAPE;
|
||||
/* case VK_CONVERT: return KEY_; */
|
||||
/* case VK_NONCONVERT: return KEY_; */
|
||||
/* case VK_ACCEPT: return KEY_; */
|
||||
/* case VK_MODECHANGE: return KEY_; */
|
||||
case VK_SPACE: return KEY_SPACE;
|
||||
/* case VK_PRIOR: return KEY_; */
|
||||
/* case VK_NEXT: return KEY_; */
|
||||
/* case VK_END: return KEY_; */
|
||||
/* case VK_HOME: return KEY_; */
|
||||
case VK_LEFT: return KEY_LEFT;
|
||||
case VK_UP: return KEY_UP;
|
||||
case VK_RIGHT: return KEY_RIGHT;
|
||||
case VK_DOWN: return KEY_DOWN;
|
||||
/* case VK_SELECT: return KEY_; */
|
||||
/* case VK_PRINT: return KEY_; */
|
||||
/* case VK_EXECUTE: return KEY_; */
|
||||
/* case VK_SNAPSHOT: return KEY_; */
|
||||
/* case VK_INSERT: return KEY_; */
|
||||
/* case VK_DELETE: return KEY_; */
|
||||
/* case VK_HELP: return KEY_; */
|
||||
case '0': return KEY_ZERO;
|
||||
case '1': return KEY_ONE;
|
||||
case '2': return KEY_TWO;
|
||||
case '3': return KEY_THREE;
|
||||
case '4': return KEY_FOUR;
|
||||
case '5': return KEY_FIVE;
|
||||
case '6': return KEY_SIX;
|
||||
case '7': return KEY_SEVEN;
|
||||
case '8': return KEY_EIGHT;
|
||||
case '9': return KEY_NINE;
|
||||
/* case 0x3A-40: return KEY_; */
|
||||
case 'A': return KEY_A;
|
||||
case 'B': return KEY_B;
|
||||
case 'C': return KEY_C;
|
||||
case 'D': return KEY_D;
|
||||
case 'E': return KEY_E;
|
||||
case 'F': return KEY_F;
|
||||
case 'G': return KEY_G;
|
||||
case 'H': return KEY_H;
|
||||
case 'I': return KEY_I;
|
||||
case 'J': return KEY_J;
|
||||
case 'K': return KEY_K;
|
||||
case 'L': return KEY_L;
|
||||
case 'M': return KEY_M;
|
||||
case 'N': return KEY_N;
|
||||
case 'O': return KEY_O;
|
||||
case 'P': return KEY_P;
|
||||
case 'Q': return KEY_Q;
|
||||
case 'R': return KEY_R;
|
||||
case 'S': return KEY_S;
|
||||
case 'T': return KEY_T;
|
||||
case 'U': return KEY_U;
|
||||
case 'V': return KEY_V;
|
||||
case 'W': return KEY_W;
|
||||
case 'X': return KEY_X;
|
||||
case 'Y': return KEY_Y;
|
||||
case 'Z': return KEY_Z;
|
||||
//case VK_LWIN: return KEY_;
|
||||
//case VK_RWIN: return KEY_;
|
||||
//case VK_APPS: return KEY_;
|
||||
//case VK_SLEEP: return KEY_;
|
||||
//case VK_NUMPAD0: return KEY_;
|
||||
//case VK_NUMPAD1: return KEY_;
|
||||
//case VK_NUMPAD2: return KEY_;
|
||||
//case VK_NUMPAD3: return KEY_;
|
||||
//case VK_NUMPAD4: return KEY_;
|
||||
//case VK_NUMPAD5: return KEY_;
|
||||
//case VK_NUMPAD6: return KEY_;
|
||||
//case VK_NUMPAD7: return KEY_;
|
||||
//case VK_NUMPAD8: return KEY_;
|
||||
//case VK_NUMPAD9: return KEY_;
|
||||
//case VK_MULTIPLY: return KEY_;
|
||||
//case VK_ADD: return KEY_;
|
||||
//case VK_SEPARATOR: return KEY_;
|
||||
//case VK_SUBTRACT: return KEY_;
|
||||
//case VK_DECIMAL: return KEY_;
|
||||
//case VK_DIVIDE: return KEY_;
|
||||
//case VK_F1: return KEY_;
|
||||
//case VK_F2: return KEY_;
|
||||
//case VK_F3: return KEY_;
|
||||
//case VK_F4: return KEY_;
|
||||
//case VK_F5: return KEY_;
|
||||
//case VK_F6: return KEY_;
|
||||
//case VK_F7: return KEY_;
|
||||
//case VK_F8: return KEY_;
|
||||
//case VK_F9: return KEY_;
|
||||
//case VK_F10: return KEY_;
|
||||
//case VK_F11: return KEY_;
|
||||
//case VK_F12: return KEY_;
|
||||
//case VK_F13: return KEY_;
|
||||
//case VK_F14: return KEY_;
|
||||
//case VK_F15: return KEY_;
|
||||
//case VK_F16: return KEY_;
|
||||
//case VK_F17: return KEY_;
|
||||
//case VK_F18: return KEY_;
|
||||
//case VK_F19: return KEY_;
|
||||
//case VK_F20: return KEY_;
|
||||
//case VK_F21: return KEY_;
|
||||
//case VK_F22: return KEY_;
|
||||
//case VK_F23: return KEY_;
|
||||
//case VK_F24: return KEY_;
|
||||
//case VK_NUMLOCK: return KEY_;
|
||||
//case VK_SCROLL: return KEY_;
|
||||
//case VK_LSHIFT: return KEY_;
|
||||
//case VK_RSHIFT: return KEY_;
|
||||
//case VK_LCONTROL: return KEY_;
|
||||
//case VK_RCONTROL: return KEY_;
|
||||
//case VK_LMENU: return KEY_;
|
||||
//case VK_RMENU: return KEY_;
|
||||
//case VK_BROWSER_BACK: return KEY_;
|
||||
//case VK_BROWSER_FORWARD: return KEY_;
|
||||
//case VK_BROWSER_REFRESH: return KEY_;
|
||||
//case VK_BROWSER_STOP: return KEY_;
|
||||
//case VK_BROWSER_SEARCH: return KEY_;
|
||||
//case VK_BROWSER_FAVORITES: return KEY_;
|
||||
//case VK_BROWSER_HOME: return KEY_;
|
||||
//case VK_VOLUME_MUTE: return KEY_;
|
||||
//case VK_VOLUME_DOWN: return KEY_;
|
||||
//case VK_VOLUME_UP: return KEY_;
|
||||
//case VK_MEDIA_NEXT_TRACK: return KEY_;
|
||||
//case VK_MEDIA_PREV_TRACK: return KEY_;
|
||||
//case VK_MEDIA_STOP: return KEY_;
|
||||
//case VK_MEDIA_PLAY_PAUSE: return KEY_;
|
||||
//case VK_LAUNCH_MAIL: return KEY_;
|
||||
//case VK_LAUNCH_MEDIA_SELECT: return KEY_;
|
||||
//case VK_LAUNCH_APP1: return KEY_;
|
||||
//case VK_LAUNCH_APP2: return KEY_;
|
||||
//case VK_OEM_1: return KEY_;
|
||||
//case VK_OEM_PLUS: return KEY_;
|
||||
//case VK_OEM_COMMA: return KEY_;
|
||||
//case VK_OEM_MINUS: return KEY_;
|
||||
//case VK_OEM_PERIOD: return KEY_;
|
||||
//case VK_OEM_2: return KEY_;
|
||||
//case VK_OEM_3: return KEY_;
|
||||
//case VK_OEM_4: return KEY_;
|
||||
//case VK_OEM_5: return KEY_;
|
||||
//case VK_OEM_6: return KEY_;
|
||||
//case VK_OEM_7: return KEY_;
|
||||
//case VK_OEM_8: return KEY_;
|
||||
//case VK_OEM_102: return KEY_;
|
||||
//case VK_PROCESSKEY: return KEY_;
|
||||
//case VK_PACKET: return KEY_;
|
||||
//case VK_ATTN: return KEY_;
|
||||
//case VK_CRSEL: return KEY_;
|
||||
//case VK_EXSEL: return KEY_;
|
||||
//case VK_EREOF: return KEY_;
|
||||
//case VK_PLAY: return KEY_;
|
||||
//case VK_ZOOM: return KEY_;
|
||||
//case VK_NONAME: return KEY_;
|
||||
//case VK_PA1: return KEY_;
|
||||
//case VK_OEM_CLEAR: return KEY_;
|
||||
default: return KEY_NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Get cursor name
|
||||
static LPCWSTR GetCursorName(int cursor)
|
||||
{
|
||||
@ -1481,6 +1300,29 @@ void PollInputEvents(void)
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessageW(&msg);
|
||||
}
|
||||
|
||||
// Windows will miss key up events for specific keys; check them manually
|
||||
if ((GetKeyState(VK_LSHIFT) & 0x8000) == 0)
|
||||
{
|
||||
CORE.Input.Keyboard.currentKeyState[KEY_LEFT_SHIFT] = 0;
|
||||
}
|
||||
if ((GetKeyState(VK_RSHIFT) & 0x8000) == 0)
|
||||
{
|
||||
CORE.Input.Keyboard.currentKeyState[KEY_RIGHT_SHIFT] = 0;
|
||||
}
|
||||
if ((GetKeyState(VK_LWIN) & 0x8000) == 0)
|
||||
{
|
||||
CORE.Input.Keyboard.currentKeyState[KEY_LEFT_SUPER] = 0;
|
||||
}
|
||||
if ((GetKeyState(VK_RWIN) & 0x8000) == 0)
|
||||
{
|
||||
CORE.Input.Keyboard.currentKeyState[KEY_RIGHT_SUPER] = 0;
|
||||
}
|
||||
|
||||
// Windows won't send a WM_KEYDOWN event for print screen; check it manually
|
||||
bool isPrintScreenDown = ((GetAsyncKeyState(VK_SNAPSHOT) & 0x8000) != 0) && (GetForegroundWindow() == platform.hwnd);
|
||||
CORE.Input.Keyboard.currentKeyState[KEY_PRINT_SCREEN] = isPrintScreenDown;
|
||||
if (isPrintScreenDown && (CORE.Input.Keyboard.exitKey == KEY_PRINT_SCREEN)) CORE.Window.shouldClose = true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
@ -2180,8 +2022,31 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
|
||||
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
|
||||
}
|
||||
} break;
|
||||
case WM_SYSKEYDOWN:
|
||||
{
|
||||
HandleKey(wparam, lparam, 1);
|
||||
// WM_SYSKEYDOWN events should still call DefWindowProc to allow things like alt+F4 to work
|
||||
result = DefWindowProcW(hwnd, msg, wparam, lparam);
|
||||
} break;
|
||||
case WM_SYSKEYUP:
|
||||
{
|
||||
HandleKey(wparam, lparam, 0);
|
||||
result = DefWindowProcW(hwnd, msg, wparam, lparam);
|
||||
} break;
|
||||
case WM_KEYDOWN: HandleKey(wparam, lparam, 1); break;
|
||||
case WM_KEYUP: HandleKey(wparam, lparam, 0); break;
|
||||
case WM_SYSCOMMAND:
|
||||
{
|
||||
if ((wparam & 0xFFF0) == SC_KEYMENU)
|
||||
{
|
||||
// Prevent the window from freezing when pressing Alt or F10
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = DefWindowProcW(hwnd, msg, wparam, lparam);
|
||||
}
|
||||
} break;
|
||||
case WM_LBUTTONDOWN: HandleMouseButton(MOUSE_BUTTON_LEFT, 1); break;
|
||||
case WM_LBUTTONUP : HandleMouseButton(MOUSE_BUTTON_LEFT, 0); break;
|
||||
case WM_RBUTTONDOWN: HandleMouseButton(MOUSE_BUTTON_RIGHT, 1); break;
|
||||
@ -2227,23 +2092,194 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
|
||||
return result;
|
||||
}
|
||||
|
||||
// Maps scancodes to Raylib keys
|
||||
static const unsigned short keyboardKeyFromScancode[] =
|
||||
{
|
||||
[0x01] = KEY_ESCAPE,
|
||||
[0x02] = KEY_ONE,
|
||||
[0x03] = KEY_TWO,
|
||||
[0x04] = KEY_THREE,
|
||||
[0x05] = KEY_FOUR,
|
||||
[0x06] = KEY_FIVE,
|
||||
[0x07] = KEY_SIX,
|
||||
[0x08] = KEY_SEVEN,
|
||||
[0x09] = KEY_EIGHT,
|
||||
[0x0A] = KEY_NINE,
|
||||
[0x0B] = KEY_ZERO,
|
||||
[0x0C] = KEY_MINUS,
|
||||
[0x0D] = KEY_EQUAL,
|
||||
[0x0E] = KEY_BACKSPACE,
|
||||
[0x0F] = KEY_TAB,
|
||||
[0x10] = KEY_Q,
|
||||
[0x11] = KEY_W,
|
||||
[0x12] = KEY_E,
|
||||
[0x13] = KEY_R,
|
||||
[0x14] = KEY_T,
|
||||
[0x15] = KEY_Y,
|
||||
[0x16] = KEY_U,
|
||||
[0x17] = KEY_I,
|
||||
[0x18] = KEY_O,
|
||||
[0x19] = KEY_P,
|
||||
[0x1A] = KEY_LEFT_BRACKET,
|
||||
[0x1B] = KEY_RIGHT_BRACKET,
|
||||
[0x1C] = KEY_ENTER,
|
||||
[0x1D] = KEY_LEFT_CONTROL,
|
||||
[0x1E] = KEY_A,
|
||||
[0x1F] = KEY_S,
|
||||
[0x20] = KEY_D,
|
||||
[0x21] = KEY_F,
|
||||
[0x22] = KEY_G,
|
||||
[0x23] = KEY_H,
|
||||
[0x24] = KEY_J,
|
||||
[0x25] = KEY_K,
|
||||
[0x26] = KEY_L,
|
||||
[0x27] = KEY_SEMICOLON,
|
||||
[0x28] = KEY_APOSTROPHE,
|
||||
[0x29] = KEY_GRAVE,
|
||||
[0x2A] = KEY_LEFT_SHIFT,
|
||||
[0x2B] = KEY_BACKSLASH,
|
||||
[0x2C] = KEY_Z,
|
||||
[0x2D] = KEY_X,
|
||||
[0x2E] = KEY_C,
|
||||
[0x2F] = KEY_V,
|
||||
[0x30] = KEY_B,
|
||||
[0x31] = KEY_N,
|
||||
[0x32] = KEY_M,
|
||||
[0x33] = KEY_COMMA,
|
||||
[0x34] = KEY_PERIOD,
|
||||
[0x35] = KEY_SLASH,
|
||||
[0x36] = KEY_RIGHT_SHIFT,
|
||||
[0x37] = KEY_KP_MULTIPLY,
|
||||
[0x38] = KEY_LEFT_ALT,
|
||||
[0x39] = KEY_SPACE,
|
||||
[0x3A] = KEY_CAPS_LOCK,
|
||||
[0x3B] = KEY_F1,
|
||||
[0x3C] = KEY_F2,
|
||||
[0x3D] = KEY_F3,
|
||||
[0x3E] = KEY_F4,
|
||||
[0x3F] = KEY_F5,
|
||||
[0x40] = KEY_F6,
|
||||
[0x41] = KEY_F7,
|
||||
[0x42] = KEY_F8,
|
||||
[0x43] = KEY_F9,
|
||||
[0x44] = KEY_F10,
|
||||
[0x45] = KEY_PAUSE,
|
||||
[0x46] = KEY_SCROLL_LOCK,
|
||||
[0x47] = KEY_KP_7,
|
||||
[0x48] = KEY_KP_8,
|
||||
[0x49] = KEY_KP_9,
|
||||
[0x4A] = KEY_KP_SUBTRACT,
|
||||
[0x4B] = KEY_KP_4,
|
||||
[0x4C] = KEY_KP_5,
|
||||
[0x4D] = KEY_KP_6,
|
||||
[0x4E] = KEY_KP_ADD,
|
||||
[0x4F] = KEY_KP_1,
|
||||
[0x50] = KEY_KP_2,
|
||||
[0x51] = KEY_KP_3,
|
||||
[0x52] = KEY_KP_0,
|
||||
[0x53] = KEY_KP_DECIMAL,
|
||||
[0x57] = KEY_F11,
|
||||
[0x58] = KEY_F12,
|
||||
[0x59] = KEY_KP_EQUAL,
|
||||
|
||||
// Duplicate scancodes
|
||||
[0x54] = KEY_PRINT_SCREEN, // Alt+PrtSc sends the SysRq scancode
|
||||
};
|
||||
|
||||
// Maps scancodes with extended-flag set to Raylib keys; lowest key is 0x1C
|
||||
static const unsigned short keyboardKeyFromExtendedScancode[] =
|
||||
{
|
||||
[0x1C - EXTENDED_KEY_OFFSET] = KEY_KP_ENTER,
|
||||
[0x1D - EXTENDED_KEY_OFFSET] = KEY_RIGHT_CONTROL,
|
||||
[0x35 - EXTENDED_KEY_OFFSET] = KEY_KP_DIVIDE,
|
||||
[0x37 - EXTENDED_KEY_OFFSET] = KEY_PRINT_SCREEN,
|
||||
[0x38 - EXTENDED_KEY_OFFSET] = KEY_RIGHT_ALT,
|
||||
[0x45 - EXTENDED_KEY_OFFSET] = KEY_NUM_LOCK,
|
||||
[0x47 - EXTENDED_KEY_OFFSET] = KEY_HOME,
|
||||
[0x48 - EXTENDED_KEY_OFFSET] = KEY_UP,
|
||||
[0x49 - EXTENDED_KEY_OFFSET] = KEY_PAGE_UP,
|
||||
[0x4B - EXTENDED_KEY_OFFSET] = KEY_LEFT,
|
||||
[0x4D - EXTENDED_KEY_OFFSET] = KEY_RIGHT,
|
||||
[0x4F - EXTENDED_KEY_OFFSET] = KEY_END,
|
||||
[0x50 - EXTENDED_KEY_OFFSET] = KEY_DOWN,
|
||||
[0x51 - EXTENDED_KEY_OFFSET] = KEY_PAGE_DOWN,
|
||||
[0x52 - EXTENDED_KEY_OFFSET] = KEY_INSERT,
|
||||
[0x53 - EXTENDED_KEY_OFFSET] = KEY_DELETE,
|
||||
[0x5B - EXTENDED_KEY_OFFSET] = KEY_LEFT_SUPER,
|
||||
[0x5C - EXTENDED_KEY_OFFSET] = KEY_RIGHT_SUPER,
|
||||
[0x5D - EXTENDED_KEY_OFFSET] = KEY_KB_MENU,
|
||||
|
||||
// Duplicate scancodes
|
||||
[0x46 - EXTENDED_KEY_OFFSET] = KEY_PAUSE, // Ctrl+Pause sends the Break scancode
|
||||
[0x36 - EXTENDED_KEY_OFFSET] = KEY_RIGHT_SHIFT, // Some keyboards set the extended bit on Right Shift
|
||||
};
|
||||
|
||||
|
||||
// Handle keyboard input event
|
||||
static void HandleKey(WPARAM wparam, LPARAM lparam, char state)
|
||||
{
|
||||
KeyboardKey key = GetKeyFromWparam(wparam);
|
||||
bool isExtendedKey = ((HIWORD(lparam) & KF_EXTENDED) != 0);
|
||||
|
||||
// TODO: Use scancode?
|
||||
//BYTE scancode = lparam >> 16;
|
||||
//TRACELOG(LOG_INFO, "KEY key=%d vk=%lu scan=%u = %u", key, wparam, scancode, state);
|
||||
|
||||
if (key != KEY_NULL)
|
||||
WORD scancode = LOBYTE(HIWORD(lparam));
|
||||
if (scancode == 0)
|
||||
{
|
||||
CORE.Input.Keyboard.currentKeyState[key] = state;
|
||||
|
||||
if (((HIWORD(lparam) & KF_REPEAT) != 0) && (state == 1)) CORE.Input.Keyboard.keyRepeatInFrame[key] = 1;
|
||||
if ((key == CORE.Input.Keyboard.exitKey) && (state == 1)) CORE.Window.shouldClose = true;
|
||||
// Certain keys don't arrive with a scancode; fall back to virtual key mapping
|
||||
scancode = MapVirtualKeyW((UINT)wparam, MAPVK_VK_TO_VSC);
|
||||
}
|
||||
|
||||
KeyboardKey key = KEY_NULL;
|
||||
if (isExtendedKey)
|
||||
{
|
||||
unsigned int index = scancode - EXTENDED_KEY_OFFSET;
|
||||
unsigned int arrayLength = sizeof(keyboardKeyFromExtendedScancode)/sizeof(keyboardKeyFromExtendedScancode[0]);
|
||||
if (index < arrayLength)
|
||||
{
|
||||
key = keyboardKeyFromExtendedScancode[index];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int arrayLength = sizeof(keyboardKeyFromScancode)/sizeof(keyboardKeyFromScancode[0]);
|
||||
if (scancode < arrayLength)
|
||||
{
|
||||
key = keyboardKeyFromScancode[scancode];
|
||||
}
|
||||
}
|
||||
|
||||
bool ignoreKey = false;
|
||||
if ((wparam == VK_CONTROL) && !isExtendedKey)
|
||||
{
|
||||
// Pressing AltGr causes Windows to send a fake Left Ctrl message
|
||||
// GLFW does something similar in win32_window.c
|
||||
MSG next = { 0 };
|
||||
LONG time = GetMessageTime();
|
||||
|
||||
if (PeekMessageW(&next, NULL, 0, 0, PM_NOREMOVE))
|
||||
{
|
||||
// If the current message is Left Ctrl (VK_CONTROL) and the next message is AltGr (VK_MENU) with the exact same timestamp,
|
||||
// silently drop the fake control key event
|
||||
bool isNextExtendedKey = ((HIWORD(next.lParam) & KF_EXTENDED) != 0);
|
||||
if ((next.wParam == VK_MENU) && ((LONG)next.time == time) && isNextExtendedKey)
|
||||
{
|
||||
if ((next.message == WM_KEYDOWN) || (next.message == WM_SYSKEYDOWN) || (next.message == WM_KEYUP) || (next.message == WM_SYSKEYUP))
|
||||
{
|
||||
ignoreKey = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!ignoreKey)
|
||||
{
|
||||
if (key != KEY_NULL)
|
||||
{
|
||||
CORE.Input.Keyboard.currentKeyState[key] = state;
|
||||
|
||||
if (((HIWORD(lparam) & KF_REPEAT) != 0) && (state == 1)) CORE.Input.Keyboard.keyRepeatInFrame[key] = 1;
|
||||
if ((key == CORE.Input.Keyboard.exitKey) && (state == 1)) CORE.Window.shouldClose = true;
|
||||
}
|
||||
else TRACELOG(LOG_WARNING, "INPUT: Unknown (or currently unhandled) virtual keycode %d (0x%x)", wparam, wparam);
|
||||
}
|
||||
else TRACELOG(LOG_WARNING, "INPUT: Unknown (or currently unhandled) virtual keycode %d (0x%x)", wparam, wparam);
|
||||
|
||||
// TODO: Add key to the queue as well?
|
||||
}
|
||||
|
||||
134
src/rmodels.c
134
src/rmodels.c
@ -2304,11 +2304,9 @@ ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount)
|
||||
return animations;
|
||||
}
|
||||
|
||||
// Update model animation data (vertex buffers / bone matrices) for a specific pose
|
||||
// Update model animation data (bone matrices) for a specific pose
|
||||
// NOTE 1: Request frame could be fractional, using a lerp interpolation between two frames
|
||||
// NOTE 2: Updated vertex animation data is uploaded to GPU in case of CPU skinning,
|
||||
// for GPU skinning, bone matrices are uploaded to shader on DrawModelEx()
|
||||
void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
|
||||
void UpdateModelAnimationBones(Model model, ModelAnimation anim, float frame)
|
||||
{
|
||||
if (model.boneMatrices == NULL) return;
|
||||
|
||||
@ -2360,6 +2358,18 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
|
||||
model.boneMatrices[boneIndex] = MatrixMultiply(MatrixInvert(bindPoseMatrix), currentPoseMatrix);
|
||||
//-----------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update model animation data (vertex buffers / bone matrices) for a specific pose
|
||||
// NOTE 1: Request frame could be fractional, using a lerp interpolation between two frames
|
||||
// NOTE 2: Updated vertex animation data is uploaded to GPU in case of CPU skinning,
|
||||
// for GPU skinning, bone matrices are uploaded to shader on DrawModelEx()
|
||||
void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
|
||||
{
|
||||
if ((anim.keyframeCount > 0) && (model.skeleton.bones != NULL) && (anim.keyframePoses != NULL))
|
||||
{
|
||||
UpdateModelAnimationBones(model, anim, frame);
|
||||
|
||||
// CPU skinning, updates CPU buffers and uploads them to GPU
|
||||
// NOTE: On GPU skinning not supported, use CPU skinning
|
||||
@ -2367,12 +2377,10 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, float frame)
|
||||
}
|
||||
}
|
||||
|
||||
// Update model animation data (vertex buffers / bone matrices) for a specific pose,
|
||||
// Update model animation data (bone matrices) for a specific pose,
|
||||
// defined by two different animations at specific frames blended together
|
||||
// NOTE 1: Request frames could be fractional, using a lerp interpolation between two frames
|
||||
// NOTE 2: Updated vertex animation data is uploaded to GPU in case of CPU skinning,
|
||||
// for GPU skinning, bone matrices are uploaded to shader on DrawModelEx()
|
||||
void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend)
|
||||
void UpdateModelAnimationBonesEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend)
|
||||
{
|
||||
if (model.boneMatrices == NULL) return;
|
||||
|
||||
@ -2475,6 +2483,23 @@ void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, Mod
|
||||
MatrixScale(boneScale.x, boneScale.y, boneScale.z));
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update model animation data (vertex buffers / bone matrices) for a specific pose,
|
||||
// defined by two different animations at specific frames blended together
|
||||
// NOTE 1: Request frames could be fractional, using a lerp interpolation between two frames
|
||||
// NOTE 2: Updated vertex animation data is uploaded to GPU in case of CPU skinning,
|
||||
// for GPU skinning, bone matrices are uploaded to shader on DrawModelEx()
|
||||
void UpdateModelAnimationEx(Model model, ModelAnimation animA, float frameA, ModelAnimation animB, float frameB, float blend)
|
||||
{
|
||||
if (model.boneMatrices == NULL) return;
|
||||
|
||||
if ((animA.keyframeCount > 0) && (animA.keyframePoses != NULL) &&
|
||||
(animB.keyframeCount > 0) && (animB.keyframePoses != NULL) &&
|
||||
(blend >= 0.0f) && (blend <= 1.0f))
|
||||
{
|
||||
UpdateModelAnimationBonesEx(model, animA, frameA, animB, frameB, blend);
|
||||
|
||||
// CPU skinning, updates CPU buffers and uploads them to GPU (if available)
|
||||
// NOTE: Fallback in case GPU skinning is not supported or enabled
|
||||
@ -2491,10 +2516,10 @@ static void UpdateModelAnimationVertexBuffers(Model model)
|
||||
|
||||
for (int m = 0; m < model.meshCount; m++)
|
||||
{
|
||||
Mesh mesh = model.meshes[m];
|
||||
Mesh *mesh = model.meshes + m; // don't copy the mesh, we may need to allocate buffers
|
||||
Vector3 animVertex = { 0 };
|
||||
Vector3 animNormal = { 0 };
|
||||
const int vertexValuesCount = mesh.vertexCount*3;
|
||||
const int vertexValuesCount = mesh->vertexCount*3;
|
||||
|
||||
int boneIndex = 0;
|
||||
int boneCounter = 0;
|
||||
@ -2502,11 +2527,28 @@ static void UpdateModelAnimationVertexBuffers(Model model)
|
||||
bool bufferUpdateRequired = false; // Flag to check when anim vertex information is updated
|
||||
|
||||
// Skip if missing bone data or missing anim buffers initialization
|
||||
if ((mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) ||
|
||||
(mesh.animVertices == NULL) || (mesh.animNormals == NULL)) continue;
|
||||
if ((mesh->boneWeights == NULL) || (mesh->boneIndices == NULL)) continue;
|
||||
|
||||
// Skip if the shader is using the bones directly
|
||||
#if defined (SUPPORT_GPU_SKINNING)
|
||||
Material material = model.materials[model.meshMaterial[m]];
|
||||
if ((material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1) ) continue;
|
||||
#endif
|
||||
// Lazy allocation of CPU animation buffers for vertex positions and normals,
|
||||
// to be used on CPU software skinning
|
||||
if (mesh->animVertices == NULL)
|
||||
{
|
||||
mesh->animVertices = (float *)RL_CALLOC(mesh->vertexCount*3, sizeof(float));
|
||||
memcpy(mesh->animVertices, mesh->vertices, mesh->vertexCount*3*sizeof(float));
|
||||
}
|
||||
if ((mesh->normals != NULL) && (mesh->animNormals == NULL))
|
||||
{
|
||||
mesh->animNormals = (float *)RL_CALLOC(mesh->vertexCount*3, sizeof(float));
|
||||
memcpy(mesh->animNormals, mesh->normals, mesh->vertexCount*3*sizeof(float));
|
||||
}
|
||||
|
||||
// Normal matrix only depends on the bone, compute it once per bone instead of per vertex
|
||||
if ((mesh.normals != NULL) && !boneNormalsReady)
|
||||
if ((mesh->normals != NULL) && !boneNormalsReady)
|
||||
{
|
||||
memset(boneNormalMatrices, 0, 256*sizeof(Matrix));
|
||||
for (unsigned int b = 0; (b < model.skeleton.boneCount) && (b < 256); b++) boneNormalMatrices[b] = MatrixTranspose(MatrixInvert(model.boneMatrices[b]));
|
||||
@ -2515,40 +2557,40 @@ static void UpdateModelAnimationVertexBuffers(Model model)
|
||||
|
||||
for (int vCounter = 0; vCounter < vertexValuesCount; vCounter += 3)
|
||||
{
|
||||
mesh.animVertices[vCounter] = 0;
|
||||
mesh.animVertices[vCounter + 1] = 0;
|
||||
mesh.animVertices[vCounter + 2] = 0;
|
||||
if (mesh.animNormals != NULL)
|
||||
mesh->animVertices[vCounter] = 0;
|
||||
mesh->animVertices[vCounter + 1] = 0;
|
||||
mesh->animVertices[vCounter + 2] = 0;
|
||||
if (mesh->animNormals != NULL)
|
||||
{
|
||||
mesh.animNormals[vCounter] = 0;
|
||||
mesh.animNormals[vCounter + 1] = 0;
|
||||
mesh.animNormals[vCounter + 2] = 0;
|
||||
mesh->animNormals[vCounter] = 0;
|
||||
mesh->animNormals[vCounter + 1] = 0;
|
||||
mesh->animNormals[vCounter + 2] = 0;
|
||||
}
|
||||
|
||||
// Iterates over 4 bones per vertex
|
||||
for (int j = 0; j < 4; j++, boneCounter++)
|
||||
{
|
||||
boneWeight = mesh.boneWeights[boneCounter];
|
||||
boneIndex = mesh.boneIndices[boneCounter];
|
||||
boneWeight = mesh->boneWeights[boneCounter];
|
||||
boneIndex = mesh->boneIndices[boneCounter];
|
||||
|
||||
// Early stop when no transformation will be applied
|
||||
if (boneWeight == 0.0f) continue;
|
||||
animVertex = (Vector3){ mesh.vertices[vCounter], mesh.vertices[vCounter + 1], mesh.vertices[vCounter + 2] };
|
||||
animVertex = (Vector3){ mesh->vertices[vCounter], mesh->vertices[vCounter + 1], mesh->vertices[vCounter + 2] };
|
||||
animVertex = Vector3Transform(animVertex, model.boneMatrices[boneIndex]);
|
||||
mesh.animVertices[vCounter] += animVertex.x*boneWeight;
|
||||
mesh.animVertices[vCounter + 1] += animVertex.y*boneWeight;
|
||||
mesh.animVertices[vCounter + 2] += animVertex.z*boneWeight;
|
||||
mesh->animVertices[vCounter] += animVertex.x*boneWeight;
|
||||
mesh->animVertices[vCounter + 1] += animVertex.y*boneWeight;
|
||||
mesh->animVertices[vCounter + 2] += animVertex.z*boneWeight;
|
||||
bufferUpdateRequired = true;
|
||||
|
||||
// Normals processing
|
||||
// NOTE: Using meshes.baseNormals (default normal) to calculate meshes.normals (animated normals)
|
||||
if ((mesh.normals != NULL) && (mesh.animNormals != NULL ))
|
||||
if ((mesh->normals != NULL) && (mesh->animNormals != NULL ))
|
||||
{
|
||||
animNormal = (Vector3){ mesh.normals[vCounter], mesh.normals[vCounter + 1], mesh.normals[vCounter + 2] };
|
||||
animNormal = Vector3Transform(animNormal, boneNormalMatrices[boneIndex]);
|
||||
mesh.animNormals[vCounter] += animNormal.x*boneWeight;
|
||||
mesh.animNormals[vCounter + 1] += animNormal.y*boneWeight;
|
||||
mesh.animNormals[vCounter + 2] += animNormal.z*boneWeight;
|
||||
animNormal = (Vector3){ mesh->normals[vCounter], mesh->normals[vCounter + 1], mesh->normals[vCounter + 2] };
|
||||
animNormal = Vector3Transform(animNormal, MatrixTranspose(MatrixInvert(model.boneMatrices[boneIndex])));
|
||||
mesh->animNormals[vCounter] += animNormal.x*boneWeight;
|
||||
mesh->animNormals[vCounter + 1] += animNormal.y*boneWeight;
|
||||
mesh->animNormals[vCounter + 2] += animNormal.z*boneWeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2556,8 +2598,8 @@ static void UpdateModelAnimationVertexBuffers(Model model)
|
||||
if (bufferUpdateRequired)
|
||||
{
|
||||
// Update GPU vertex buffers with updated data (position + normals)
|
||||
rlUpdateVertexBuffer(mesh.vboId[SHADER_LOC_VERTEX_POSITION], mesh.animVertices, mesh.vertexCount*3*sizeof(float), 0);
|
||||
if (mesh.normals != NULL) rlUpdateVertexBuffer(mesh.vboId[SHADER_LOC_VERTEX_NORMAL], mesh.animNormals, mesh.vertexCount*3*sizeof(float), 0);
|
||||
rlUpdateVertexBuffer(mesh->vboId[SHADER_LOC_VERTEX_POSITION], mesh->animVertices, mesh->vertexCount*3*sizeof(float), 0);
|
||||
if (mesh->normals != NULL) rlUpdateVertexBuffer(mesh->vboId[SHADER_LOC_VERTEX_NORMAL], mesh->animNormals, mesh->vertexCount*3*sizeof(float), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4863,13 +4905,6 @@ static Model LoadIQM(const char *fileName)
|
||||
|
||||
model.meshes[i].triangleCount = imesh[i].num_triangles;
|
||||
model.meshes[i].indices = (unsigned short *)RL_CALLOC(model.meshes[i].triangleCount*3, sizeof(unsigned short));
|
||||
|
||||
#if !SUPPORT_GPU_SKINNING
|
||||
// Animated vertex data, processed for rendering
|
||||
// NOTE: Animated vertex should be re-uploaded to GPU (if not using GPU skinning)
|
||||
model.meshes[i].animVertices = (float *)RL_CALLOC(model.meshes[i].vertexCount*3, sizeof(float));
|
||||
model.meshes[i].animNormals = (float *)RL_CALLOC(model.meshes[i].vertexCount*3, sizeof(float));
|
||||
#endif
|
||||
}
|
||||
|
||||
// Triangles data processing
|
||||
@ -6369,13 +6404,6 @@ static Model LoadGLTF(const char *fileName)
|
||||
}
|
||||
}
|
||||
|
||||
#if !SUPPORT_GPU_SKINNING
|
||||
// Animated vertex data (CPU skinning)
|
||||
model.meshes[meshIndex].animVertices = (float *)RL_CALLOC(model.meshes[meshIndex].vertexCount*3, sizeof(float));
|
||||
memcpy(model.meshes[meshIndex].animVertices, model.meshes[meshIndex].vertices, model.meshes[meshIndex].vertexCount*3*sizeof(float));
|
||||
model.meshes[meshIndex].animNormals = (float *)RL_CALLOC(model.meshes[meshIndex].vertexCount*3, sizeof(float));
|
||||
if (model.meshes[meshIndex].normals != NULL) memcpy(model.meshes[meshIndex].animNormals, model.meshes[meshIndex].normals, model.meshes[meshIndex].vertexCount*3*sizeof(float));
|
||||
#endif
|
||||
model.meshes[meshIndex].boneCount = model.skeleton.boneCount;
|
||||
|
||||
meshIndex++; // Move to next mesh
|
||||
@ -7039,10 +7067,6 @@ static Model LoadM3D(const char *fileName)
|
||||
{
|
||||
model.meshes[k].boneIndices = (unsigned char *)RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(unsigned char));
|
||||
model.meshes[k].boneWeights = (float *)RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(float));
|
||||
#if !SUPPORT_GPU_SKINNING
|
||||
model.meshes[k].animVertices = (float *)RL_CALLOC(model.meshes[k].vertexCount*3, sizeof(float));
|
||||
model.meshes[k].animNormals = (float *)RL_CALLOC(model.meshes[k].vertexCount*3, sizeof(float));
|
||||
#endif
|
||||
}
|
||||
|
||||
model.meshMaterial[k] = mi + 1;
|
||||
@ -7245,12 +7269,6 @@ static Model LoadM3D(const char *fileName)
|
||||
for (i = 0; i < model.meshCount; i++)
|
||||
{
|
||||
model.meshes[i].boneCount = model.skeleton.boneCount;
|
||||
|
||||
#if !SUPPORT_GPU_SKINNING
|
||||
// Initialize vertex buffers for CPU skinning
|
||||
memcpy(model.meshes[i].animVertices, model.meshes[i].vertices, model.meshes[i].vertexCount*3*sizeof(float));
|
||||
memcpy(model.meshes[i].animNormals, model.meshes[i].normals, model.meshes[i].vertexCount*3*sizeof(float));
|
||||
#endif
|
||||
}
|
||||
|
||||
// Initialize runtime animation data: current pose and bone matrices
|
||||
|
||||
Reference in New Issue
Block a user