Merge branch 'master' into remove_platform_rpi
|
|
@ -24,6 +24,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to
|
||||||
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex |
|
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | Apache-2.0 | https://github.com/shiryel/rayex |
|
||||||
| raylib-factor | 4.0 | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor |
|
| raylib-factor | 4.0 | [Factor](https://factorcode.org/) | BSD | https://github.com/factor/factor/blob/master/extra/raylib/raylib.factor |
|
||||||
| raylib-freebasic | **4.5** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic |
|
| raylib-freebasic | **4.5** | [FreeBASIC](https://www.freebasic.net/) | MIT | https://github.com/WIITD/raylib-freebasic |
|
||||||
|
| fortran-raylib | **4.5** | [Fortran](https://fortran-lang.org/) | ISC | https://github.com/interkosmos/fortran-raylib |
|
||||||
| raylib for Pascal | **4.5** | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | Modified Zlib | https://github.com/tinyBigGAMES/raylib |
|
| raylib for Pascal | **4.5** | [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) | Modified Zlib | https://github.com/tinyBigGAMES/raylib |
|
||||||
| raylib-go | 4.5 | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go |
|
| raylib-go | 4.5 | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go |
|
||||||
| raylib-guile | **auto** | [Guile](https://www.gnu.org/software/guile/) | Zlib | https://github.com/petelliott/raylib-guile |
|
| raylib-guile | **auto** | [Guile](https://www.gnu.org/software/guile/) | Zlib | https://github.com/petelliott/raylib-guile |
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,15 @@ cmake_dependent_option(SUPPORT_MODULE_RAUDIO "Include module: raudio" ON CUSTOMI
|
||||||
cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (rcamera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (rcamera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_SSH_KEYBOARD_RPI "Reconfigure standard input to receive key inputs, works with SSH connection" OFF CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_SSH_KEYBOARD_RPI "Reconfigure standard input to receive key inputs, works with SSH connection" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" OFF CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_EVENTS_WAITING "Wait for events passively (sleeping while no events) instead of polling them actively every frame" OFF CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_WINMM_HIGHRES_TIMER "Setting a higher resolution can improve the accuracy of time-out intervals in wait functions" OFF CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_WINMM_HIGHRES_TIMER "Setting a higher resolution can improve the accuracy of time-out intervals in wait functions" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_COMPRESSION_API "Support for compression API" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_COMPRESSION_API "Support for compression API" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_EVENTS_AUTOMATION "Support automatic generated events, loading and recording of those events when required" OFF CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_CUSTOM_FRAME_CONTROL "Enabling this flag allows manual control of the frame processes, use at your own risk" OFF CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_CUSTOM_FRAME_CONTROL "Enabling this flag allows manual control of the frame processes, use at your own risk" OFF CUSTOMIZE_BUILD OFF)
|
||||||
|
|
||||||
# rshapes.c
|
# rshapes.c
|
||||||
|
|
@ -58,17 +59,19 @@ cmake_dependent_option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editin
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_PNM "Support loading PNM as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PIC "Support loading PIC as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PNM "Support loading PNM as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_QOI "Support loading QOI as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_QOI "Support loading QOI as textures" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_SVG "Support loading SVG as textures" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
|
||||||
# rtext.c
|
# rtext.c
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
@ -83,6 +86,7 @@ cmake_dependent_option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format"
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_IQM "Support loading IQM file format" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_IQM "Support loading IQM file format" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_GLTF "Support loading GLTF file format" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_GLTF "Support loading GLTF file format" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_VOX "Support loading VOX file format" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_VOX "Support loading VOX file format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_M3D "Support loading M3D file format" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
||||||
# raudio.c
|
# raudio.c
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
|
|
@ -90,6 +94,7 @@ cmake_dependent_option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" O
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" ON CUSTOMIZE_BUILD ON)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
|
cmake_dependent_option(SUPPORT_FILEFORMAT_QOA "Support loading QOA for sound" ON CUSTOMIZE_BUILD ON)
|
||||||
cmake_dependent_option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF} CUSTOMIZE_BUILD OFF)
|
cmake_dependent_option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||||
|
|
||||||
# utils.c
|
# utils.c
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
**raylib is a simple and easy-to-use library to enjoy videogames programming.**
|
**raylib is a simple and easy-to-use library to enjoy videogames programming.**
|
||||||
|
|
||||||
raylib is highly inspired by Borland BGI graphics lib and by XNA framework and it's specially well suited for prototyping, tooling, graphical applications, embedded systems and education.
|
raylib is highly inspired by Borland BGI graphics lib and by XNA framework and it's especially well suited for prototyping, tooling, graphical applications, embedded systems and education.
|
||||||
|
|
||||||
*NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.*
|
*NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.*
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ if (${CUSTOMIZE_BUILD})
|
||||||
define_if("raylib" SUPPORT_EVENTS_WAITING)
|
define_if("raylib" SUPPORT_EVENTS_WAITING)
|
||||||
define_if("raylib" SUPPORT_WINMM_HIGHRES_TIMER)
|
define_if("raylib" SUPPORT_WINMM_HIGHRES_TIMER)
|
||||||
define_if("raylib" SUPPORT_COMPRESSION_API)
|
define_if("raylib" SUPPORT_COMPRESSION_API)
|
||||||
|
define_if("raylib" SUPPORT_EVENTS_AUTOMATION)
|
||||||
define_if("raylib" SUPPORT_CUSTOM_FRAME_CONTROL)
|
define_if("raylib" SUPPORT_CUSTOM_FRAME_CONTROL)
|
||||||
define_if("raylib" SUPPORT_QUADS_DRAW_MODE)
|
define_if("raylib" SUPPORT_QUADS_DRAW_MODE)
|
||||||
define_if("raylib" SUPPORT_IMAGE_EXPORT)
|
define_if("raylib" SUPPORT_IMAGE_EXPORT)
|
||||||
|
|
@ -36,6 +37,7 @@ if (${CUSTOMIZE_BUILD})
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_PNG)
|
define_if("raylib" SUPPORT_FILEFORMAT_PNG)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_DDS)
|
define_if("raylib" SUPPORT_FILEFORMAT_DDS)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_HDR)
|
define_if("raylib" SUPPORT_FILEFORMAT_HDR)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_PIC)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_PNM)
|
define_if("raylib" SUPPORT_FILEFORMAT_PNM)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_KTX)
|
define_if("raylib" SUPPORT_FILEFORMAT_KTX)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_ASTC)
|
define_if("raylib" SUPPORT_FILEFORMAT_ASTC)
|
||||||
|
|
@ -47,6 +49,7 @@ if (${CUSTOMIZE_BUILD})
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_PSD)
|
define_if("raylib" SUPPORT_FILEFORMAT_PSD)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_PKM)
|
define_if("raylib" SUPPORT_FILEFORMAT_PKM)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_PVR)
|
define_if("raylib" SUPPORT_FILEFORMAT_PVR)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_SVG)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_FNT)
|
define_if("raylib" SUPPORT_FILEFORMAT_FNT)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_TTF)
|
define_if("raylib" SUPPORT_FILEFORMAT_TTF)
|
||||||
define_if("raylib" SUPPORT_TEXT_MANIPULATION)
|
define_if("raylib" SUPPORT_TEXT_MANIPULATION)
|
||||||
|
|
@ -56,11 +59,13 @@ if (${CUSTOMIZE_BUILD})
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_IQM)
|
define_if("raylib" SUPPORT_FILEFORMAT_IQM)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_GLTF)
|
define_if("raylib" SUPPORT_FILEFORMAT_GLTF)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_VOX)
|
define_if("raylib" SUPPORT_FILEFORMAT_VOX)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_M3D)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_WAV)
|
define_if("raylib" SUPPORT_FILEFORMAT_WAV)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_OGG)
|
define_if("raylib" SUPPORT_FILEFORMAT_OGG)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_XM)
|
define_if("raylib" SUPPORT_FILEFORMAT_XM)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_MOD)
|
define_if("raylib" SUPPORT_FILEFORMAT_MOD)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_MP3)
|
define_if("raylib" SUPPORT_FILEFORMAT_MP3)
|
||||||
|
define_if("raylib" SUPPORT_FILEFORMAT_QOA)
|
||||||
define_if("raylib" SUPPORT_FILEFORMAT_FLAC)
|
define_if("raylib" SUPPORT_FILEFORMAT_FLAC)
|
||||||
define_if("raylib" SUPPORT_STANDARD_FILEIO)
|
define_if("raylib" SUPPORT_STANDARD_FILEIO)
|
||||||
define_if("raylib" SUPPORT_TRACELOG)
|
define_if("raylib" SUPPORT_TRACELOG)
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,7 @@ install(
|
||||||
# PKG_CONFIG_LIBS_PRIVATE is used in raylib.pc.in
|
# PKG_CONFIG_LIBS_PRIVATE is used in raylib.pc.in
|
||||||
if (NOT BUILD_SHARED_LIBS)
|
if (NOT BUILD_SHARED_LIBS)
|
||||||
include(LibraryPathToLinkerFlags)
|
include(LibraryPathToLinkerFlags)
|
||||||
library_path_to_linker_flags(__PKG_CONFIG_LIBS_PRIVATE "${LIBS_PRIVATE}")
|
set(PKG_CONFIG_LIBS_PRIVATE ${GLFW_PKG_LIBS})
|
||||||
set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${GLFW_PKG_LIBS})
|
|
||||||
string(REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}")
|
string(REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}")
|
||||||
elseif (BUILD_SHARED_LIBS)
|
elseif (BUILD_SHARED_LIBS)
|
||||||
set(PKG_CONFIG_LIBS_EXTRA "")
|
set(PKG_CONFIG_LIBS_EXTRA "")
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,11 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
|
||||||
INCLUDE_PATHS += -I/usr/include/libdrm
|
INCLUDE_PATHS += -I/usr/include/libdrm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Include GLFW required for examples/others/rlgl_standalone.c
|
||||||
|
ifeq ($(USE_EXTERNAL_GLFW),FALSE)
|
||||||
|
all others: INCLUDE_PATHS += -I$(RAYLIB_PATH)/src/external/glfw/include
|
||||||
|
endif
|
||||||
|
|
||||||
# Define library paths containing required libs: LDFLAGS
|
# Define library paths containing required libs: LDFLAGS
|
||||||
#------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------
|
||||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
|
|
@ -426,7 +431,8 @@ TEXTURES = \
|
||||||
textures/textures_draw_tiled \
|
textures/textures_draw_tiled \
|
||||||
textures/textures_polygon \
|
textures/textures_polygon \
|
||||||
textures/textures_gif_player \
|
textures/textures_gif_player \
|
||||||
textures/textures_fog_of_war
|
textures/textures_fog_of_war \
|
||||||
|
textures/textures_svg_loading
|
||||||
|
|
||||||
TEXT = \
|
TEXT = \
|
||||||
text/text_raylib_fonts \
|
text/text_raylib_fonts \
|
||||||
|
|
@ -480,6 +486,7 @@ SHADERS = \
|
||||||
shaders/shaders_simple_mask \
|
shaders/shaders_simple_mask \
|
||||||
shaders/shaders_spotlight \
|
shaders/shaders_spotlight \
|
||||||
shaders/shaders_hot_reloading \
|
shaders/shaders_hot_reloading \
|
||||||
|
shaders/shaders_lightmap \
|
||||||
shaders/shaders_mesh_instancing \
|
shaders/shaders_mesh_instancing \
|
||||||
shaders/shaders_multi_sample2d \
|
shaders/shaders_multi_sample2d \
|
||||||
shaders/shaders_write_depth \
|
shaders/shaders_write_depth \
|
||||||
|
|
|
||||||
|
|
@ -406,7 +406,8 @@ TEXTURES = \
|
||||||
textures/textures_draw_tiled \
|
textures/textures_draw_tiled \
|
||||||
textures/textures_polygon \
|
textures/textures_polygon \
|
||||||
textures/textures_gif_player \
|
textures/textures_gif_player \
|
||||||
textures/textures_fog_of_war
|
textures/textures_fog_of_war \
|
||||||
|
textures/textures_svg_loading
|
||||||
|
|
||||||
TEXT = \
|
TEXT = \
|
||||||
text/text_raylib_fonts \
|
text/text_raylib_fonts \
|
||||||
|
|
@ -460,6 +461,7 @@ SHADERS = \
|
||||||
shaders/shaders_simple_mask \
|
shaders/shaders_simple_mask \
|
||||||
shaders/shaders_spotlight \
|
shaders/shaders_spotlight \
|
||||||
shaders/shaders_hot_reloading \
|
shaders/shaders_hot_reloading \
|
||||||
|
shaders/shaders_lightmap \
|
||||||
shaders/shaders_mesh_instancing \
|
shaders/shaders_mesh_instancing \
|
||||||
shaders/shaders_multi_sample2d \
|
shaders/shaders_multi_sample2d \
|
||||||
shaders/shaders_write_depth \
|
shaders/shaders_write_depth \
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ int main(void)
|
||||||
{
|
{
|
||||||
StopMusicStream(music);
|
StopMusicStream(music);
|
||||||
PlayMusicStream(music);
|
PlayMusicStream(music);
|
||||||
|
pause = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pause/Resume music playing
|
// Pause/Resume music playing
|
||||||
|
|
@ -134,6 +135,14 @@ int main(void)
|
||||||
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, MAROON);
|
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, MAROON);
|
||||||
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY);
|
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY);
|
||||||
|
|
||||||
|
// Draw help instructions
|
||||||
|
DrawRectangle(20, 20, 425, 145, WHITE);
|
||||||
|
DrawRectangleLines(20, 20, 425, 145, GRAY);
|
||||||
|
DrawText("PRESS SPACE TO RESTART MUSIC", 40, 40, 20, BLACK);
|
||||||
|
DrawText("PRESS P TO PAUSE/RESUME", 40, 70, 20, BLACK);
|
||||||
|
DrawText("PRESS UP/DOWN TO CHANGE SPEED", 40, 100, 20, BLACK);
|
||||||
|
DrawText(TextFormat("SPEED: %f", pitch), 40, 130, 20, MAROON);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
@ -148,4 +157,4 @@ int main(void)
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 44 KiB |
BIN
examples/audio/audio_sound_multi.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
|
@ -4,9 +4,9 @@
|
||||||
*
|
*
|
||||||
* LIMITATIONS:
|
* LIMITATIONS:
|
||||||
* - Only supports 1 armature per file, and skips loading it if there are multiple armatures
|
* - Only supports 1 armature per file, and skips loading it if there are multiple armatures
|
||||||
* - Only supports linear interpolation (default method in Blender when checked
|
* - Only supports linear interpolation (default method in Blender when checked
|
||||||
* "Always Sample Animations" when exporting a GLTF file)
|
* "Always Sample Animations" when exporting a GLTF file)
|
||||||
* - Only supports translation/rotation/scale animation channel.path,
|
* - Only supports translation/rotation/scale animation channel.path,
|
||||||
* weights not considered (i.e. morph targets)
|
* weights not considered (i.e. morph targets)
|
||||||
*
|
*
|
||||||
* Example originally created with raylib 3.7, last time updated with raylib 4.2
|
* Example originally created with raylib 3.7, last time updated with raylib 4.2
|
||||||
|
|
@ -42,7 +42,7 @@ int main(void)
|
||||||
|
|
||||||
// Load gltf model
|
// Load gltf model
|
||||||
Model model = LoadModel("resources/models/gltf/robot.glb");
|
Model model = LoadModel("resources/models/gltf/robot.glb");
|
||||||
|
|
||||||
// Load gltf model animations
|
// Load gltf model animations
|
||||||
unsigned int animsCount = 0;
|
unsigned int animsCount = 0;
|
||||||
unsigned int animIndex = 0;
|
unsigned int animIndex = 0;
|
||||||
|
|
@ -63,9 +63,9 @@ int main(void)
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
UpdateCamera(&camera, CAMERA_THIRD_PERSON);
|
UpdateCamera(&camera, CAMERA_THIRD_PERSON);
|
||||||
// Select current animation
|
// Select current animation
|
||||||
if (IsKeyPressed(KEY_UP)) animIndex = (animIndex + 1)%animsCount;
|
if (IsMouseButtonPressed(MOUSE_BUTTON_RIGHT)) animIndex = (animIndex + 1)%animsCount;
|
||||||
else if (IsKeyPressed(KEY_DOWN)) animIndex = (animIndex + animsCount - 1)%animsCount;
|
else if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) animIndex = (animIndex + animsCount - 1)%animsCount;
|
||||||
|
|
||||||
// Update model animation
|
// Update model animation
|
||||||
ModelAnimation anim = modelAnimations[animIndex];
|
ModelAnimation anim = modelAnimations[animIndex];
|
||||||
animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount;
|
animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount;
|
||||||
|
|
@ -85,7 +85,7 @@ int main(void)
|
||||||
|
|
||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
|
||||||
DrawText("Use the UP/DOWN arrow keys to switch animation", 10, 10, 20, GRAY);
|
DrawText("Use the LEFT/RIGHT mouse buttons to switch animation", 10, 10, 20, GRAY);
|
||||||
DrawText(TextFormat("Animation: %s", anim.name), 10, GetScreenHeight() - 20, 10, DARKGRAY);
|
DrawText(TextFormat("Animation: %s", anim.name), 10, GetScreenHeight() - 20, 10, DARKGRAY);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 26 KiB |
|
|
@ -40,7 +40,7 @@ int main(void)
|
||||||
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type
|
||||||
|
|
||||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||||
|
|
||||||
char modelFileName[128] = "resources/models/m3d/cesium_man.m3d";
|
char modelFileName[128] = "resources/models/m3d/cesium_man.m3d";
|
||||||
bool drawMesh = 1;
|
bool drawMesh = 1;
|
||||||
bool drawSkeleton = 1;
|
bool drawSkeleton = 1;
|
||||||
|
|
@ -72,27 +72,27 @@ int main(void)
|
||||||
if (IsKeyDown(KEY_SPACE) || IsKeyPressed(KEY_N))
|
if (IsKeyDown(KEY_SPACE) || IsKeyPressed(KEY_N))
|
||||||
{
|
{
|
||||||
animFrameCounter++;
|
animFrameCounter++;
|
||||||
|
|
||||||
if (animFrameCounter >= anims[animId].frameCount) animFrameCounter = 0;
|
if (animFrameCounter >= anims[animId].frameCount) animFrameCounter = 0;
|
||||||
|
|
||||||
UpdateModelAnimation(model, anims[animId], animFrameCounter);
|
UpdateModelAnimation(model, anims[animId], animFrameCounter);
|
||||||
animPlaying = true;
|
animPlaying = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select animation by pressing A
|
// Select animation by pressing C
|
||||||
if (IsKeyPressed(KEY_A))
|
if (IsKeyPressed(KEY_C))
|
||||||
{
|
{
|
||||||
animFrameCounter = 0;
|
animFrameCounter = 0;
|
||||||
animId++;
|
animId++;
|
||||||
|
|
||||||
if (animId >= animsCount) animId = 0;
|
if (animId >= animsCount) animId = 0;
|
||||||
UpdateModelAnimation(model, anims[animId], 0);
|
UpdateModelAnimation(model, anims[animId], 0);
|
||||||
animPlaying = true;
|
animPlaying = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggle skeleton drawing
|
// Toggle skeleton drawing
|
||||||
if (IsKeyPressed(KEY_S)) drawSkeleton ^= 1;
|
if (IsKeyPressed(KEY_B)) drawSkeleton ^= 1;
|
||||||
|
|
||||||
// Toggle mesh drawing
|
// Toggle mesh drawing
|
||||||
if (IsKeyPressed(KEY_M)) drawMesh ^= 1;
|
if (IsKeyPressed(KEY_M)) drawMesh ^= 1;
|
||||||
|
|
@ -112,19 +112,19 @@ int main(void)
|
||||||
// Draw the animated skeleton
|
// Draw the animated skeleton
|
||||||
if (drawSkeleton)
|
if (drawSkeleton)
|
||||||
{
|
{
|
||||||
// Loop to (boneCount - 1) because the last one is a special "no bone" bone,
|
// Loop to (boneCount - 1) because the last one is a special "no bone" bone,
|
||||||
// needed to workaround buggy models
|
// needed to workaround buggy models
|
||||||
// without a -1, we would always draw a cube at the origin
|
// without a -1, we would always draw a cube at the origin
|
||||||
for (int i = 0; i < model.boneCount - 1; i++)
|
for (int i = 0; i < model.boneCount - 1; i++)
|
||||||
{
|
{
|
||||||
// By default the model is loaded in bind-pose by LoadModel().
|
// By default the model is loaded in bind-pose by LoadModel().
|
||||||
// But if UpdateModelAnimation() has been called at least once
|
// But if UpdateModelAnimation() has been called at least once
|
||||||
// then the model is already in animation pose, so we need the animated skeleton
|
// then the model is already in animation pose, so we need the animated skeleton
|
||||||
if (!animPlaying || !animsCount)
|
if (!animPlaying || !animsCount)
|
||||||
{
|
{
|
||||||
// Display the bind-pose skeleton
|
// Display the bind-pose skeleton
|
||||||
DrawCube(model.bindPose[i].translation, 0.04f, 0.04f, 0.04f, RED);
|
DrawCube(model.bindPose[i].translation, 0.04f, 0.04f, 0.04f, RED);
|
||||||
|
|
||||||
if (model.bones[i].parent >= 0)
|
if (model.bones[i].parent >= 0)
|
||||||
{
|
{
|
||||||
DrawLine3D(model.bindPose[i].translation,
|
DrawLine3D(model.bindPose[i].translation,
|
||||||
|
|
@ -135,7 +135,7 @@ int main(void)
|
||||||
{
|
{
|
||||||
// Display the frame-pose skeleton
|
// Display the frame-pose skeleton
|
||||||
DrawCube(anims[animId].framePoses[animFrameCounter][i].translation, 0.05f, 0.05f, 0.05f, RED);
|
DrawCube(anims[animId].framePoses[animFrameCounter][i].translation, 0.05f, 0.05f, 0.05f, RED);
|
||||||
|
|
||||||
if (anims[animId].bones[i].parent >= 0)
|
if (anims[animId].bones[i].parent >= 0)
|
||||||
{
|
{
|
||||||
DrawLine3D(anims[animId].framePoses[animFrameCounter][i].translation,
|
DrawLine3D(anims[animId].framePoses[animFrameCounter][i].translation,
|
||||||
|
|
@ -149,9 +149,10 @@ int main(void)
|
||||||
|
|
||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
|
||||||
DrawText("PRESS SPACE to PLAY MODEL ANIMATION", 10, GetScreenHeight() - 60, 10, MAROON);
|
DrawText("PRESS SPACE to PLAY MODEL ANIMATION", 10, GetScreenHeight() - 80, 10, MAROON);
|
||||||
DrawText("PRESS A to CYCLE THROUGH ANIMATIONS", 10, GetScreenHeight() - 40, 10, DARKGRAY);
|
DrawText("PRESS N to STEP ONE ANIMATION FRAME", 10, GetScreenHeight() - 60, 10, DARKGRAY);
|
||||||
DrawText("PRESS M to toggle MESH, S to toggle SKELETON DRAWING", 10, GetScreenHeight() - 20, 10, DARKGRAY);
|
DrawText("PRESS C to CYCLE THROUGH ANIMATIONS", 10, GetScreenHeight() - 40, 10, DARKGRAY);
|
||||||
|
DrawText("PRESS M to toggle MESH, B to toggle SKELETON DRAWING", 10, GetScreenHeight() - 20, 10, DARKGRAY);
|
||||||
DrawText("(c) CesiumMan model by KhronosGroup", GetScreenWidth() - 210, GetScreenHeight() - 20, 10, GRAY);
|
DrawText("(c) CesiumMan model by KhronosGroup", GetScreenWidth() - 210, GetScreenHeight() - 20, 10, GRAY);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 25 KiB |
|
|
@ -108,7 +108,7 @@ int main(void)
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [easings] example - easings testbed");
|
InitWindow(screenWidth, screenHeight, "raylib [easings] example - easings testbed");
|
||||||
|
|
||||||
Vector2 ballPosition = { 100.0f, 200.0f };
|
Vector2 ballPosition = { 100.0f, 100.0f };
|
||||||
|
|
||||||
float t = 0.0f; // Current time (in any unit measure, but same unit as duration)
|
float t = 0.0f; // Current time (in any unit measure, but same unit as duration)
|
||||||
float d = 300.0f; // Total time it should take to complete (duration)
|
float d = 300.0f; // Total time it should take to complete (duration)
|
||||||
|
|
@ -180,8 +180,8 @@ int main(void)
|
||||||
// Movement computation
|
// Movement computation
|
||||||
if (!paused && ((boundedT && t < d) || !boundedT))
|
if (!paused && ((boundedT && t < d) || !boundedT))
|
||||||
{
|
{
|
||||||
ballPosition.x = Easings[easingX].func(t, 100.0f, 700.0f - 100.0f, d);
|
ballPosition.x = Easings[easingX].func(t, 100.0f, 700.0f - 170.0f, d);
|
||||||
ballPosition.y = Easings[easingY].func(t, 100.0f, 400.0f - 100.0f, d);
|
ballPosition.y = Easings[easingY].func(t, 100.0f, 400.0f - 170.0f, d);
|
||||||
t += 1.0f;
|
t += 1.0f;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
@ -193,15 +193,15 @@ int main(void)
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
// Draw information text
|
// Draw information text
|
||||||
DrawText(TextFormat("Easing x: %s", Easings[easingX].name), 0, FONT_SIZE*2, FONT_SIZE, LIGHTGRAY);
|
DrawText(TextFormat("Easing x: %s", Easings[easingX].name), 20, FONT_SIZE, FONT_SIZE, LIGHTGRAY);
|
||||||
DrawText(TextFormat("Easing y: %s", Easings[easingY].name), 0, FONT_SIZE*3, FONT_SIZE, LIGHTGRAY);
|
DrawText(TextFormat("Easing y: %s", Easings[easingY].name), 20, FONT_SIZE*2, FONT_SIZE, LIGHTGRAY);
|
||||||
DrawText(TextFormat("t (%c) = %.2f d = %.2f", (boundedT == true)? 'b' : 'u', t, d), 0, FONT_SIZE*4, FONT_SIZE, LIGHTGRAY);
|
DrawText(TextFormat("t (%c) = %.2f d = %.2f", (boundedT == true)? 'b' : 'u', t, d), 20, FONT_SIZE*3, FONT_SIZE, LIGHTGRAY);
|
||||||
|
|
||||||
// Draw instructions text
|
// Draw instructions text
|
||||||
DrawText("Use ENTER to play or pause movement, use SPACE to restart", 0, GetScreenHeight() - FONT_SIZE*2, FONT_SIZE, LIGHTGRAY);
|
DrawText("Use ENTER to play or pause movement, use SPACE to restart", 20, GetScreenHeight() - FONT_SIZE*2, FONT_SIZE, LIGHTGRAY);
|
||||||
DrawText("Use D and W or A and S keys to change duration", 0, GetScreenHeight() - FONT_SIZE*3, FONT_SIZE, LIGHTGRAY);
|
DrawText("Use Q and W or A and S keys to change duration", 20, GetScreenHeight() - FONT_SIZE*3, FONT_SIZE, LIGHTGRAY);
|
||||||
DrawText("Use LEFT or RIGHT keys to choose easing for the x axis", 0, GetScreenHeight() - FONT_SIZE*4, FONT_SIZE, LIGHTGRAY);
|
DrawText("Use LEFT or RIGHT keys to choose easing for the x axis", 20, GetScreenHeight() - FONT_SIZE*4, FONT_SIZE, LIGHTGRAY);
|
||||||
DrawText("Use UP or DOWN keys to choose easing for the y axis", 0, GetScreenHeight() - FONT_SIZE*5, FONT_SIZE, LIGHTGRAY);
|
DrawText("Use UP or DOWN keys to choose easing for the y axis", 20, GetScreenHeight() - FONT_SIZE*5, FONT_SIZE, LIGHTGRAY);
|
||||||
|
|
||||||
// Draw ball
|
// Draw ball
|
||||||
DrawCircleV(ballPosition, 16.0f, MAROON);
|
DrawCircleV(ballPosition, 16.0f, MAROON);
|
||||||
|
|
@ -226,4 +226,4 @@ static float NoEase(float t, float b, float c, float d)
|
||||||
d += burn;
|
d += burn;
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
|
@ -10,7 +10,7 @@ varying vec4 fragColor;
|
||||||
uniform sampler2D texture0;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 colDiffuse;
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
uniform float secondes;
|
uniform float seconds;
|
||||||
|
|
||||||
uniform vec2 size;
|
uniform vec2 size;
|
||||||
|
|
||||||
|
|
@ -29,8 +29,8 @@ void main() {
|
||||||
float boxTop = 0.0;
|
float boxTop = 0.0;
|
||||||
|
|
||||||
vec2 p = fragTexCoord;
|
vec2 p = fragTexCoord;
|
||||||
p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (secondes * speedX)) * ampX * pixelWidth;
|
p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (seconds * speedX)) * ampX * pixelWidth;
|
||||||
p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (secondes * speedY)) * ampY * pixelHeight;
|
p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (seconds * speedY)) * ampY * pixelHeight;
|
||||||
|
|
||||||
gl_FragColor = texture2D(texture0, p)*colDiffuse*fragColor;
|
gl_FragColor = texture2D(texture0, p)*colDiffuse*fragColor;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ uniform vec4 colDiffuse;
|
||||||
// Output fragment color
|
// Output fragment color
|
||||||
out vec4 finalColor;
|
out vec4 finalColor;
|
||||||
|
|
||||||
uniform float secondes;
|
uniform float seconds;
|
||||||
|
|
||||||
uniform vec2 size;
|
uniform vec2 size;
|
||||||
|
|
||||||
|
|
@ -30,8 +30,8 @@ void main() {
|
||||||
float boxTop = 0.0;
|
float boxTop = 0.0;
|
||||||
|
|
||||||
vec2 p = fragTexCoord;
|
vec2 p = fragTexCoord;
|
||||||
p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (secondes * speedX)) * ampX * pixelWidth;
|
p.x += cos((fragTexCoord.y - boxTop) * freqX / ( pixelWidth * 750.0) + (seconds * speedX)) * ampX * pixelWidth;
|
||||||
p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (secondes * speedY)) * ampY * pixelHeight;
|
p.y += sin((fragTexCoord.x - boxLeft) * freqY * aspect / ( pixelHeight * 750.0) + (seconds * speedY)) * ampY * pixelHeight;
|
||||||
|
|
||||||
finalColor = texture(texture0, p)*colDiffuse*fragColor;
|
finalColor = texture(texture0, p)*colDiffuse*fragColor;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,18 +37,18 @@ int main(void)
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - Apply an outline to a texture");
|
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - Apply an outline to a texture");
|
||||||
|
|
||||||
Texture2D texture = LoadTexture("resources/fudesumi.png");
|
Texture2D texture = LoadTexture("resources/fudesumi.png");
|
||||||
|
|
||||||
Shader shdrOutline = LoadShader(0, TextFormat("resources/shaders/glsl%i/outline.fs", GLSL_VERSION));
|
Shader shdrOutline = LoadShader(0, TextFormat("resources/shaders/glsl%i/outline.fs", GLSL_VERSION));
|
||||||
|
|
||||||
float outlineSize = 2.0f;
|
float outlineSize = 2.0f;
|
||||||
float outlineColor[4] = { 1.0f, 0.0f, 0.0f, 1.0f }; // Normalized RED color
|
float outlineColor[4] = { 1.0f, 0.0f, 0.0f, 1.0f }; // Normalized RED color
|
||||||
float textureSize[2] = { (float)texture.width, (float)texture.height };
|
float textureSize[2] = { (float)texture.width, (float)texture.height };
|
||||||
|
|
||||||
// Get shader locations
|
// Get shader locations
|
||||||
int outlineSizeLoc = GetShaderLocation(shdrOutline, "outlineSize");
|
int outlineSizeLoc = GetShaderLocation(shdrOutline, "outlineSize");
|
||||||
int outlineColorLoc = GetShaderLocation(shdrOutline, "outlineColor");
|
int outlineColorLoc = GetShaderLocation(shdrOutline, "outlineColor");
|
||||||
int textureSizeLoc = GetShaderLocation(shdrOutline, "textureSize");
|
int textureSizeLoc = GetShaderLocation(shdrOutline, "textureSize");
|
||||||
|
|
||||||
// Set shader values (they can be changed later)
|
// Set shader values (they can be changed later)
|
||||||
SetShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, SHADER_UNIFORM_FLOAT);
|
SetShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, SHADER_UNIFORM_FLOAT);
|
||||||
SetShaderValue(shdrOutline, outlineColorLoc, outlineColor, SHADER_UNIFORM_VEC4);
|
SetShaderValue(shdrOutline, outlineColorLoc, outlineColor, SHADER_UNIFORM_VEC4);
|
||||||
|
|
@ -64,7 +64,7 @@ int main(void)
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
outlineSize += GetMouseWheelMove();
|
outlineSize += GetMouseWheelMove();
|
||||||
if (outlineSize < 1.0f) outlineSize = 1.0f;
|
if (outlineSize < 1.0f) outlineSize = 1.0f;
|
||||||
|
|
||||||
SetShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, SHADER_UNIFORM_FLOAT);
|
SetShaderValue(shdrOutline, outlineSizeLoc, &outlineSize, SHADER_UNIFORM_FLOAT);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -75,13 +75,13 @@ int main(void)
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
BeginShaderMode(shdrOutline);
|
BeginShaderMode(shdrOutline);
|
||||||
|
|
||||||
DrawTexture(texture, GetScreenWidth()/2 - texture.width/2, -30, WHITE);
|
DrawTexture(texture, GetScreenWidth()/2 - texture.width/2, -30, WHITE);
|
||||||
|
|
||||||
EndShaderMode();
|
EndShaderMode();
|
||||||
|
|
||||||
DrawText("Shader-based\ntexture\noutline", 10, 10, 20, GRAY);
|
DrawText("Shader-based\ntexture\noutline", 10, 10, 20, GRAY);
|
||||||
|
DrawText("Scroll mouse wheel to\nchange outline size", 10, 72, 20, GRAY);
|
||||||
DrawText(TextFormat("Outline size: %i px", (int)outlineSize), 10, 120, 20, MAROON);
|
DrawText(TextFormat("Outline size: %i px", (int)outlineSize), 10, 120, 20, MAROON);
|
||||||
|
|
||||||
DrawFPS(710, 10);
|
DrawFPS(710, 10);
|
||||||
|
|
@ -99,4 +99,4 @@ int main(void)
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||