Merge branch 'master' of https://github.com/raysan5/raylib into dr/mini_al
This commit is contained in:
commit
1d354bc704
27 changed files with 63500 additions and 111217 deletions
22
src/CMakeLists.txt
Executable file → Normal file
22
src/CMakeLists.txt
Executable file → Normal file
|
|
@ -17,7 +17,8 @@ include_directories(SYSTEM .)
|
|||
file(GLOB raylib_sources *.c)
|
||||
list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/rglfw.c)
|
||||
|
||||
if(NOT glfw3_FOUND AND "${PLATFORM}" MATCHES "Desktop")
|
||||
# Explicitly check against "ON", because USE_EXTERNAL_GLFW is a tristate option
|
||||
if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MATCHES "Desktop")
|
||||
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
||||
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
|
|
@ -32,6 +33,8 @@ if(NOT glfw3_FOUND AND "${PLATFORM}" MATCHES "Desktop")
|
|||
include_directories(external/glfw/include)
|
||||
|
||||
list(APPEND raylib_sources $<TARGET_OBJECTS:glfw_objlib>)
|
||||
else()
|
||||
set(GLFW_PKG_DEPS glfw)
|
||||
endif()
|
||||
|
||||
include(utils)
|
||||
|
|
@ -91,7 +94,7 @@ elseif(${PLATFORM} MATCHES "Android")
|
|||
add_if_flag_compiles(-Wa,--noexecstack CMAKE_C_FLAGS)
|
||||
add_if_flag_compiles(-no-canonical-prefixes CMAKE_C_FLAGS)
|
||||
add_definitions(-DANDROID -D__ANDROID_API__=21)
|
||||
include_directories(external/android/native_app_glue )
|
||||
include_directories(external/android/native_app_glue)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate")
|
||||
|
||||
elseif(${PLATFORM} MATCHES "Raspberry Pi")
|
||||
|
|
@ -113,8 +116,8 @@ if(${SHARED})
|
|||
set(CMAKE_MACOSX_RPATH ON)
|
||||
|
||||
target_link_libraries(${RAYLIB}_shared ${LIBS_PRIVATE})
|
||||
if (${PLATFORM} MATCHES "Desktop")
|
||||
target_link_libraries(${RAYLIB}_shared glfw ${GLFW_LIBRARIES})
|
||||
if (${PLATFORM} MATCHES "PLATFORM_DESKTOP")
|
||||
target_link_libraries(${RAYLIB}_shared glfw)
|
||||
endif()
|
||||
if (UNIX AND ${FILESYSTEM_LACKS_SYMLINKS})
|
||||
MESSAGE(WARNING "Can't version UNIX shared library on file system without symlink support")
|
||||
|
|
@ -141,6 +144,8 @@ if(${SHARED})
|
|||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_test("pkg-config" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh)
|
||||
endif(${SHARED})
|
||||
|
||||
if(${STATIC})
|
||||
|
|
@ -150,8 +155,9 @@ if(${STATIC})
|
|||
|
||||
add_library(${RAYLIB} STATIC ${sources})
|
||||
|
||||
set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE})
|
||||
if (${PLATFORM} MATCHES "Desktop")
|
||||
set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${GLFW_PKG_LIBS})
|
||||
string (REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}")
|
||||
if (${PLATFORM} MATCHES "PLATFORM_DESKTOP")
|
||||
target_link_libraries(${RAYLIB} glfw ${GLFW_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
|
@ -163,6 +169,8 @@ if(${STATIC})
|
|||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
|
||||
add_test("pkg-config--static" ${PROJECT_SOURCE_DIR}/../cmake/test-pkgconfig.sh --static)
|
||||
endif(${STATIC})
|
||||
|
||||
configure_file(../raylib.pc.in raylib.pc @ONLY)
|
||||
|
|
@ -199,3 +207,5 @@ SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE.md")
|
|||
SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}")
|
||||
SET(CPACK_GENERATOR "ZIP;TGZ") # Remove this, if you want the NSIS installer on Windows
|
||||
include(CPack)
|
||||
|
||||
enable_testing()
|
||||
|
|
|
|||
32
src/Makefile
32
src/Makefile
|
|
@ -6,7 +6,7 @@
|
|||
# PLATFORM_DESKTOP: Windows (Win32, Win64)
|
||||
# PLATFORM_DESKTOP: Linux (32 and 64 bit)
|
||||
# PLATFORM_DESKTOP: OSX/macOS
|
||||
# PLATFORM_DESKTOP: FreeBSD
|
||||
# PLATFORM_DESKTOP: FreeBSD, OpenBSD, NetBSD, DragonFly
|
||||
# PLATFORM_ANDROID: Android (ARM, ARM64)
|
||||
# PLATFORM_RPI: Raspberry Pi (Raspbian)
|
||||
# PLATFORM_WEB: HTML5 (Chrome, Firefox)
|
||||
|
|
@ -111,7 +111,16 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|||
PLATFORM_OS=LINUX
|
||||
endif
|
||||
ifeq ($(UNAMEOS),FreeBSD)
|
||||
PLATFORM_OS=FREEBSD
|
||||
PLATFORM_OS=BSD
|
||||
endif
|
||||
ifeq ($(UNAMEOS),OpenBSD)
|
||||
PLATFORM_OS=BSD
|
||||
endif
|
||||
ifeq ($(UNAMEOS),NetBSD)
|
||||
PLATFORM_OS=BSD
|
||||
endif
|
||||
ifeq ($(UNAMEOS),DragonFly)
|
||||
PLATFORM_OS=BSD
|
||||
endif
|
||||
ifeq ($(UNAMEOS),Darwin)
|
||||
PLATFORM_OS=OSX
|
||||
|
|
@ -185,8 +194,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|||
ifeq ($(PLATFORM_OS),OSX)
|
||||
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/bsd
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||
|
|
@ -231,8 +240,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|||
CC = clang
|
||||
GLFW_CFLAGS = -x objective-c
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||
# FreeBSD default compiler
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
# FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
|
||||
CC = clang
|
||||
endif
|
||||
endif
|
||||
|
|
@ -309,13 +318,14 @@ endif
|
|||
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||
# Compiler flags for arquitecture (only ARM, not ARM64)
|
||||
#CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
|
||||
CFLAGS += -target aarch64 -mfix-cortex-a53-835769
|
||||
# Compilation functions attributes options
|
||||
CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIE -fPIC
|
||||
# Compiler options for the linker
|
||||
# -Werror=format-security
|
||||
CFLAGS += -Wa,--noexecstack -Wformat -no-canonical-prefixes
|
||||
# Preprocessor macro definitions
|
||||
CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=21
|
||||
CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=21 -DMAL_NO_OSS
|
||||
endif
|
||||
|
||||
# Define required compilation flags for raylib SHARED lib
|
||||
|
|
@ -345,7 +355,7 @@ endif
|
|||
INCLUDE_PATHS = -I. -Iexternal -Iexternal/glfw/include
|
||||
|
||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
INCLUDE_PATHS += -I/usr/local/include
|
||||
LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH)
|
||||
endif
|
||||
|
|
@ -415,6 +425,10 @@ ifeq ($(INCLUDE_AUDIO_MODULE),TRUE)
|
|||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||
OBJS += external/android/native_app_glue/android_native_app_glue.o
|
||||
endif
|
||||
|
||||
# Default target entry
|
||||
all: raylib
|
||||
|
||||
|
|
@ -454,7 +468,7 @@ else
|
|||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.$(RAYLIB_API_VERSION).dylib
|
||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.dylib
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
# WARNING: you should type "gmake clean" before doing this target
|
||||
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lpthread
|
||||
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!"
|
||||
|
|
|
|||
27
src/audio.c
27
src/audio.c
|
|
@ -17,7 +17,7 @@
|
|||
* Required types and functions are defined in the same module.
|
||||
*
|
||||
* #define USE_OPENAL_BACKEND
|
||||
* Use OpenAL Soft audio backend usage
|
||||
* Use OpenAL Soft audio backend
|
||||
*
|
||||
* #define SUPPORT_FILEFORMAT_WAV
|
||||
* #define SUPPORT_FILEFORMAT_OGG
|
||||
|
|
@ -73,11 +73,6 @@
|
|||
*
|
||||
**********************************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#if !defined(USE_OPENAL_BACKEND)
|
||||
#define USE_MINI_AL 1 // Set to 1 to use mini_al; 0 to use OpenAL.
|
||||
#endif
|
||||
|
||||
#if defined(AUDIO_STANDALONE)
|
||||
#include "audio.h"
|
||||
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end()
|
||||
|
|
@ -87,6 +82,10 @@
|
|||
#include "utils.h" // Required for: fopen() Android mapping
|
||||
#endif
|
||||
|
||||
#if !defined(USE_OPENAL_BACKEND)
|
||||
#define USE_MINI_AL 1 // Set to 1 to use mini_al; 0 to use OpenAL.
|
||||
#endif
|
||||
|
||||
#include "external/mini_al.h" // Implemented in mini_al.c. Cannot implement this here because it conflicts with Win32 APIs such as CloseWindow(), etc.
|
||||
|
||||
#if !defined(USE_MINI_AL) || (USE_MINI_AL == 0)
|
||||
|
|
@ -668,7 +667,7 @@ AudioBuffer *CreateAudioBuffer(mal_format format, mal_uint32 channels, mal_uint3
|
|||
mal_result resultMAL = mal_dsp_init(&dspConfig, &audioBuffer->dsp);
|
||||
if (resultMAL != MAL_SUCCESS)
|
||||
{
|
||||
TraceLog(LOG_ERROR, "LoadSoundFromWave() : Failed to create data conversion pipeline");
|
||||
TraceLog(LOG_ERROR, "CreateAudioBuffer() : Failed to create data conversion pipeline");
|
||||
free(audioBuffer);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -696,7 +695,7 @@ void DeleteAudioBuffer(AudioBuffer *audioBuffer)
|
|||
{
|
||||
if (audioBuffer == NULL)
|
||||
{
|
||||
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer");
|
||||
TraceLog(LOG_ERROR, "DeleteAudioBuffer() : No audio buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -709,7 +708,7 @@ bool IsAudioBufferPlaying(AudioBuffer *audioBuffer)
|
|||
{
|
||||
if (audioBuffer == NULL)
|
||||
{
|
||||
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer");
|
||||
TraceLog(LOG_ERROR, "IsAudioBufferPlaying() : No audio buffer");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -737,7 +736,7 @@ void StopAudioBuffer(AudioBuffer *audioBuffer)
|
|||
{
|
||||
if (audioBuffer == NULL)
|
||||
{
|
||||
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer");
|
||||
TraceLog(LOG_ERROR, "StopAudioBuffer() : No audio buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -756,7 +755,7 @@ void PauseAudioBuffer(AudioBuffer *audioBuffer)
|
|||
{
|
||||
if (audioBuffer == NULL)
|
||||
{
|
||||
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer");
|
||||
TraceLog(LOG_ERROR, "PauseAudioBuffer() : No audio buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -768,7 +767,7 @@ void ResumeAudioBuffer(AudioBuffer *audioBuffer)
|
|||
{
|
||||
if (audioBuffer == NULL)
|
||||
{
|
||||
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer");
|
||||
TraceLog(LOG_ERROR, "ResumeAudioBuffer() : No audio buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -780,7 +779,7 @@ void SetAudioBufferVolume(AudioBuffer *audioBuffer, float volume)
|
|||
{
|
||||
if (audioBuffer == NULL)
|
||||
{
|
||||
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer");
|
||||
TraceLog(LOG_ERROR, "SetAudioBufferVolume() : No audio buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -792,7 +791,7 @@ void SetAudioBufferPitch(AudioBuffer *audioBuffer, float pitch)
|
|||
{
|
||||
if (audioBuffer == NULL)
|
||||
{
|
||||
TraceLog(LOG_ERROR, "PlayAudioBuffer() : No audio buffer");
|
||||
TraceLog(LOG_ERROR, "SetAudioBufferPitch() : No audio buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -244,8 +244,8 @@ void SetCameraMode(Camera camera, int mode)
|
|||
distance.y = sqrtf(dx*dx + dy*dy);
|
||||
|
||||
// Camera angle calculation
|
||||
cameraAngle.x = asinf(fabsf(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW)
|
||||
cameraAngle.y = -asinf(fabsf(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW)
|
||||
cameraAngle.x = asinf(fabs(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW)
|
||||
cameraAngle.y = -asinf(fabs(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW)
|
||||
|
||||
// NOTE: Just testing what cameraAngle means
|
||||
//cameraAngle.x = 0.0f*DEG2RAD; // Camera angle in plane XZ (0 aligned with Z, move positive CCW)
|
||||
|
|
|
|||
51
src/core.c
51
src/core.c
|
|
@ -5,7 +5,7 @@
|
|||
* PLATFORMS SUPPORTED:
|
||||
* - PLATFORM_DESKTOP: Windows (Win32, Win64)
|
||||
* - PLATFORM_DESKTOP: Linux (X11 desktop mode)
|
||||
* - PLATFORM_DESKTOP: FreeBSD (X11 desktop)
|
||||
* - PLATFORM_DESKTOP: FreeBSD, OpenBSD, NetBSD, DragonFly (X11 desktop)
|
||||
* - PLATFORM_DESKTOP: OSX/macOS
|
||||
* - PLATFORM_ANDROID: Android 4.0 (ARM, ARM64)
|
||||
* - PLATFORM_RPI: Raspberry Pi 0,1,2,3 (Raspbian)
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* CONFIGURATION:
|
||||
*
|
||||
* #define PLATFORM_DESKTOP
|
||||
* Windowing and input system configured for desktop platforms: Windows, Linux, OSX, FreeBSD
|
||||
* Windowing and input system configured for desktop platforms: Windows, Linux, OSX, FreeBSD, OpenBSD, NetBSD, DragonFly
|
||||
* NOTE: Oculus Rift CV1 requires PLATFORM_DESKTOP for mirror rendering - View [rlgl] module to enable it
|
||||
*
|
||||
* #define PLATFORM_ANDROID
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
* Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()
|
||||
*
|
||||
* DEPENDENCIES:
|
||||
* rglfw - Manage graphic device, OpenGL context and inputs on PLATFORM_DESKTOP (Windows, Linux, OSX. FreeBSD)
|
||||
* rglfw - Manage graphic device, OpenGL context and inputs on PLATFORM_DESKTOP (Windows, Linux, OSX. FreeBSD, OpenBSD, NetBSD, DragonFly)
|
||||
* raymath - 3D math functionality (Vector2, Vector3, Matrix, Quaternion)
|
||||
* camera - Multiple 3D camera modes (free, orbital, 1st person, 3rd person)
|
||||
* gestures - Gestures system for touch-ready devices (or simulated from mouse inputs)
|
||||
|
|
@ -1884,31 +1884,30 @@ static bool InitGraphicsDevice(int width, int height)
|
|||
displayHeight = screenHeight;
|
||||
#endif // defined(PLATFORM_WEB)
|
||||
|
||||
glfwDefaultWindowHints(); // Set default windows hints
|
||||
|
||||
// Check some Window creation flags
|
||||
if (configFlags & FLAG_WINDOW_RESIZABLE) glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window
|
||||
else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable
|
||||
|
||||
if (configFlags & FLAG_WINDOW_DECORATED) glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Border and buttons on Window
|
||||
|
||||
if (configFlags & FLAG_WINDOW_TRANSPARENT)
|
||||
{
|
||||
// TODO: Enable transparent window (not ready yet on GLFW 3.2)
|
||||
}
|
||||
|
||||
if (configFlags & FLAG_MSAA_4X_HINT)
|
||||
{
|
||||
glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0
|
||||
TraceLog(LOG_INFO, "Trying to enable MSAA x4");
|
||||
}
|
||||
|
||||
glfwDefaultWindowHints(); // Set default windows hints:
|
||||
//glfwWindowHint(GLFW_RED_BITS, 8); // Framebuffer red color component bits
|
||||
//glfwWindowHint(GLFW_DEPTH_BITS, 16); // Depthbuffer bits (24 by default)
|
||||
//glfwWindowHint(GLFW_GREEN_BITS, 8); // Framebuffer green color component bits
|
||||
//glfwWindowHint(GLFW_BLUE_BITS, 8); // Framebuffer blue color component bits
|
||||
//glfwWindowHint(GLFW_ALPHA_BITS, 8); // Framebuffer alpha color component bits
|
||||
//glfwWindowHint(GLFW_DEPTH_BITS, 24); // Depthbuffer bits
|
||||
//glfwWindowHint(GLFW_REFRESH_RATE, 0); // Refresh rate for fullscreen window
|
||||
//glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); // Default OpenGL API to use. Alternative: GLFW_OPENGL_ES_API
|
||||
//glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); // OpenGL API to use. Alternative: GLFW_OPENGL_ES_API
|
||||
//glfwWindowHint(GLFW_AUX_BUFFERS, 0); // Number of auxiliar buffers
|
||||
|
||||
// Check some Window creation flags
|
||||
if (configFlags & FLAG_WINDOW_RESIZABLE) glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window
|
||||
else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable
|
||||
|
||||
if (configFlags & FLAG_WINDOW_UNDECORATED) glfwWindowHint(GLFW_DECORATED, GL_FALSE); // Border and buttons on Window
|
||||
else glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Decorated window
|
||||
|
||||
#if !defined(PLATFORM_WEB) // FLAG_WINDOW_TRANSPARENT not supported on HTML5
|
||||
if (configFlags & FLAG_WINDOW_TRANSPARENT) glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); // Transparent framebuffer
|
||||
else glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_FALSE); // Opaque framebuffer
|
||||
#endif
|
||||
|
||||
if (configFlags & FLAG_MSAA_4X_HINT) glfwWindowHint(GLFW_SAMPLES, 4); // Tries to enable multisampling x4 (MSAA), default is 0
|
||||
|
||||
// NOTE: When asking for an OpenGL context version, most drivers provide highest supported version
|
||||
// with forward compatibility to older OpenGL versions.
|
||||
// For example, if using OpenGL 1.1, driver can provide a 4.3 context forward compatible.
|
||||
|
|
@ -1926,11 +1925,11 @@ static bool InitGraphicsDevice(int width, int height)
|
|||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above!
|
||||
// Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE
|
||||
#if defined(__APPLE__)
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires fordward compatibility
|
||||
#else
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above!
|
||||
#endif
|
||||
//glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
|
||||
//glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); // Request OpenGL DEBUG context
|
||||
}
|
||||
|
||||
if (fullscreen)
|
||||
|
|
|
|||
|
|
@ -27,11 +27,6 @@ if (WIN32)
|
|||
"$ENV{VULKAN_SDK}/Bin32"
|
||||
"$ENV{VK_SDK_PATH}/Bin32")
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
find_library(VULKAN_LIBRARY vulkan.1 HINTS
|
||||
"$ENV{VULKAN_SDK}/macOS/lib")
|
||||
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
|
||||
"$ENV{VULKAN_SDK}/macOS/include")
|
||||
else()
|
||||
find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
|
||||
"$ENV{VULKAN_SDK}/include")
|
||||
|
|
|
|||
4
src/external/glfw/CMakeLists.txt
vendored
4
src/external/glfw/CMakeLists.txt
vendored
|
|
@ -327,10 +327,10 @@ endif()
|
|||
# Export GLFW library dependencies
|
||||
#--------------------------------------------------------------------
|
||||
foreach(arg ${glfw_PKG_DEPS})
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}")
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
foreach(arg ${glfw_PKG_LIBS})
|
||||
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}")
|
||||
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
|
|
|||
2
src/external/glfw/README.md
vendored
2
src/external/glfw/README.md
vendored
|
|
@ -165,6 +165,8 @@ information on what to include when reporting a bug.
|
|||
- Added `GLFW_HOVERED` window attribute for polling cursor hover state (#1166)
|
||||
- Added `GLFW_CENTER_CURSOR` window hint for controlling cursor centering
|
||||
(#749,#842)
|
||||
- Added `GLFW_FOCUS_ON_SHOW` window hint and attribute to control input focus
|
||||
on calling show window (#1189)
|
||||
- Added `GLFW_JOYSTICK_HAT_BUTTONS` init hint (#889)
|
||||
- Added `GLFW_LOCK_KEY_MODS` input mode and `GLFW_MOD_*_LOCK` mod bits (#946)
|
||||
- Added macOS specific `GLFW_COCOA_RETINA_FRAMEBUFFER` window hint
|
||||
|
|
|
|||
20
src/external/glfw/include/GLFW/glfw3.h
vendored
20
src/external/glfw/include/GLFW/glfw3.h
vendored
|
|
@ -819,6 +819,12 @@ extern "C" {
|
|||
* Mouse cursor hover [window attribute](@ref GLFW_HOVERED_attrib).
|
||||
*/
|
||||
#define GLFW_HOVERED 0x0002000B
|
||||
/*! @brief Input focus on calling show window hint and attribute
|
||||
*
|
||||
* Input focus [window hint](@ref GLFW_FOCUS_ON_SHOW_hint) or
|
||||
* [window attribute](@ref GLFW_FOCUS_ON_SHOW_attrib).
|
||||
*/
|
||||
#define GLFW_FOCUS_ON_SHOW 0x0002000C
|
||||
|
||||
/*! @brief Framebuffer bit depth hint.
|
||||
*
|
||||
|
|
@ -3085,6 +3091,11 @@ GLFWAPI void glfwMaximizeWindow(GLFWwindow* window);
|
|||
* hidden. If the window is already visible or is in full screen mode, this
|
||||
* function does nothing.
|
||||
*
|
||||
* By default, windowed mode windows are focused when shown
|
||||
* Set the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint
|
||||
* to change this behavior for all newly created windows, or change the
|
||||
* behavior for an existing window with @ref glfwSetWindowAttrib.
|
||||
*
|
||||
* @param[in] window The window to make visible.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
|
||||
|
|
@ -3132,6 +3143,10 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window);
|
|||
* initially created. Set the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to
|
||||
* disable this behavior.
|
||||
*
|
||||
* Also by default, windowed mode windows are focused when shown
|
||||
* with @ref glfwShowWindow. Set the
|
||||
* [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) to disable this behavior.
|
||||
*
|
||||
* __Do not use this function__ to steal focus from other applications unless
|
||||
* you are certain that is what the user wants. Focus stealing can be
|
||||
* extremely disruptive.
|
||||
|
|
@ -3306,8 +3321,9 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
|
|||
*
|
||||
* The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
|
||||
* [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
|
||||
* [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) and
|
||||
* [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib).
|
||||
* [GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
|
||||
* [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
|
||||
* [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib).
|
||||
*
|
||||
* Some of these attributes are ignored for full screen windows. The new
|
||||
* value will take effect if the window is later made windowed.
|
||||
|
|
|
|||
1
src/external/glfw/src/CMakeLists.txt
vendored
1
src/external/glfw/src/CMakeLists.txt
vendored
|
|
@ -163,4 +163,3 @@ if (GLFW_INSTALL)
|
|||
ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
|
||||
LIBRARY DESTINATION "lib${LIB_SUFFIX}")
|
||||
endif()
|
||||
|
||||
|
|
|
|||
5
src/external/glfw/src/input.c
vendored
5
src/external/glfw/src/input.c
vendored
|
|
@ -32,7 +32,6 @@
|
|||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
// Internal key state used for sticky keys
|
||||
#define _GLFW_STICK 3
|
||||
|
|
@ -1086,7 +1085,9 @@ GLFWAPI int glfwUpdateGamepadMappings(const char* string)
|
|||
|
||||
while (*c)
|
||||
{
|
||||
if (isxdigit(*c))
|
||||
if ((*c >= '0' && *c <= '9') ||
|
||||
(*c >= 'a' && *c <= 'f') ||
|
||||
(*c >= 'A' && *c <= 'F'))
|
||||
{
|
||||
char line[1024];
|
||||
|
||||
|
|
|
|||
2
src/external/glfw/src/internal.h
vendored
2
src/external/glfw/src/internal.h
vendored
|
|
@ -267,6 +267,7 @@ struct _GLFWwndconfig
|
|||
GLFWbool floating;
|
||||
GLFWbool maximized;
|
||||
GLFWbool centerCursor;
|
||||
GLFWbool focusOnShow;
|
||||
struct {
|
||||
GLFWbool retina;
|
||||
char frameName[256];
|
||||
|
|
@ -372,6 +373,7 @@ struct _GLFWwindow
|
|||
GLFWbool decorated;
|
||||
GLFWbool autoIconify;
|
||||
GLFWbool floating;
|
||||
GLFWbool focusOnShow;
|
||||
GLFWbool shouldClose;
|
||||
void* userPointer;
|
||||
GLFWvidmode videoMode;
|
||||
|
|
|
|||
4
src/external/glfw/src/win32_platform.h
vendored
4
src/external/glfw/src/win32_platform.h
vendored
|
|
@ -242,7 +242,9 @@ typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(
|
|||
#include "egl_context.h"
|
||||
#include "osmesa_context.h"
|
||||
|
||||
#define _GLFW_WNDCLASSNAME L"GLFW30"
|
||||
#if !defined(_GLFW_WNDCLASSNAME)
|
||||
#define _GLFW_WNDCLASSNAME L"GLFW30"
|
||||
#endif
|
||||
|
||||
#define _glfw_dlopen(name) LoadLibraryA(name)
|
||||
#define _glfw_dlclose(handle) FreeLibrary((HMODULE) handle)
|
||||
|
|
|
|||
13
src/external/glfw/src/window.c
vendored
13
src/external/glfw/src/window.c
vendored
|
|
@ -201,6 +201,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
|||
window->decorated = wndconfig.decorated;
|
||||
window->autoIconify = wndconfig.autoIconify;
|
||||
window->floating = wndconfig.floating;
|
||||
window->focusOnShow = wndconfig.focusOnShow;
|
||||
window->cursorMode = GLFW_CURSOR_NORMAL;
|
||||
|
||||
window->minwidth = GLFW_DONT_CARE;
|
||||
|
|
@ -267,6 +268,7 @@ void glfwDefaultWindowHints(void)
|
|||
_glfw.hints.window.focused = GLFW_TRUE;
|
||||
_glfw.hints.window.autoIconify = GLFW_TRUE;
|
||||
_glfw.hints.window.centerCursor = GLFW_TRUE;
|
||||
_glfw.hints.window.focusOnShow = GLFW_TRUE;
|
||||
|
||||
// The default is 24 bits of color, 24 bits of depth and 8 bits of stencil,
|
||||
// double buffered
|
||||
|
|
@ -370,6 +372,9 @@ GLFWAPI void glfwWindowHint(int hint, int value)
|
|||
case GLFW_CENTER_CURSOR:
|
||||
_glfw.hints.window.centerCursor = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
case GLFW_FOCUS_ON_SHOW:
|
||||
_glfw.hints.window.focusOnShow = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
case GLFW_CLIENT_API:
|
||||
_glfw.hints.context.client = value;
|
||||
return;
|
||||
|
|
@ -755,7 +760,9 @@ GLFWAPI void glfwShowWindow(GLFWwindow* handle)
|
|||
return;
|
||||
|
||||
_glfwPlatformShowWindow(window);
|
||||
_glfwPlatformFocusWindow(window);
|
||||
|
||||
if (window->focusOnShow)
|
||||
_glfwPlatformFocusWindow(window);
|
||||
}
|
||||
|
||||
GLFWAPI void glfwRequestWindowAttention(GLFWwindow* handle)
|
||||
|
|
@ -810,6 +817,8 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
|
|||
return _glfwPlatformWindowMaximized(window);
|
||||
case GLFW_HOVERED:
|
||||
return _glfwPlatformWindowHovered(window);
|
||||
case GLFW_FOCUS_ON_SHOW:
|
||||
return window->focusOnShow;
|
||||
case GLFW_TRANSPARENT_FRAMEBUFFER:
|
||||
return _glfwPlatformFramebufferTransparent(window);
|
||||
case GLFW_RESIZABLE:
|
||||
|
|
@ -886,6 +895,8 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value)
|
|||
if (!window->monitor)
|
||||
_glfwPlatformSetWindowFloating(window, value);
|
||||
}
|
||||
else if (attrib == GLFW_FOCUS_ON_SHOW)
|
||||
window->focusOnShow = value;
|
||||
else
|
||||
_glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib);
|
||||
}
|
||||
|
|
|
|||
5
src/external/glfw/src/x11_window.c
vendored
5
src/external/glfw/src/x11_window.c
vendored
|
|
@ -2672,8 +2672,9 @@ void _glfwPlatformPollEvents(void)
|
|||
#if defined(__linux__)
|
||||
_glfwDetectJoystickConnectionLinux();
|
||||
#endif
|
||||
int count = XPending(_glfw.x11.display);
|
||||
while (count--)
|
||||
XPending(_glfw.x11.display);
|
||||
|
||||
while (XQLength(_glfw.x11.display))
|
||||
{
|
||||
XEvent event;
|
||||
XNextEvent(_glfw.x11.display, &event);
|
||||
|
|
|
|||
2
src/external/jar_xm.h
vendored
2
src/external/jar_xm.h
vendored
|
|
@ -2365,7 +2365,7 @@ static void jar_xm_tick(jar_xm_context_t* ctx) {
|
|||
float panning, volume;
|
||||
|
||||
panning = ch->panning +
|
||||
(ch->panning_envelope_panning - .5f) * (.5f - fabsf(ch->panning - .5f)) * 2.0f;
|
||||
(ch->panning_envelope_panning - .5f) * (.5f - fabs(ch->panning - .5f)) * 2.0f;
|
||||
|
||||
if(ch->tremor_on) {
|
||||
volume = .0f;
|
||||
|
|
|
|||
|
|
@ -1837,9 +1837,9 @@ void DrawBoundingBox(BoundingBox box, Color color)
|
|||
{
|
||||
Vector3 size;
|
||||
|
||||
size.x = fabsf(box.max.x - box.min.x);
|
||||
size.y = fabsf(box.max.y - box.min.y);
|
||||
size.z = fabsf(box.max.z - box.min.z);
|
||||
size.x = fabs(box.max.x - box.min.x);
|
||||
size.y = fabs(box.max.y - box.min.y);
|
||||
size.z = fabs(box.max.z - box.min.z);
|
||||
|
||||
Vector3 center = { box.min.x + size.x/2.0f, box.min.y + size.y/2.0f, box.min.z + size.z/2.0f };
|
||||
|
||||
|
|
@ -2074,7 +2074,7 @@ RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight)
|
|||
|
||||
RayHitInfo result = { 0 };
|
||||
|
||||
if (fabsf(ray.direction.y) > EPSILON)
|
||||
if (fabs(ray.direction.y) > EPSILON)
|
||||
{
|
||||
float distance = (ray.position.y - groundHeight)/-ray.direction.y;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
* NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread)
|
||||
*
|
||||
* Use the following code to compile:
|
||||
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread -lopengl32 -lgdi32 -std=c99
|
||||
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static -lraylib -lpthread -lopengl32 -lgdi32 -std=c99
|
||||
*
|
||||
* VERY THANKS TO:
|
||||
* Ramon Santamaria (github: @raysan5)
|
||||
|
|
|
|||
76
src/raylib.h
76
src/raylib.h
|
|
@ -3,6 +3,8 @@
|
|||
* raylib - A simple and easy-to-use library to learn videogames programming (www.raylib.com)
|
||||
*
|
||||
* FEATURES:
|
||||
* - NO external dependencies, all required libraries included with raylib
|
||||
* - Multiple platforms support: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5.
|
||||
* - Written in plain C code (C99) in PascalCase/camelCase notation
|
||||
* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile)
|
||||
* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
|
||||
|
|
@ -12,10 +14,8 @@
|
|||
* - Flexible Materials system, supporting classic maps and PBR maps
|
||||
* - Shaders support, including Model shaders and Postprocessing shaders
|
||||
* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath]
|
||||
* - Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD)
|
||||
* - Multiple platforms support: Windows, Linux, FreeBSD, MacOS, UWP, Android, Raspberry Pi, HTML5.
|
||||
* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
|
||||
* - VR stereo rendering with configurable HMD device parameters
|
||||
* - NO external dependencies, all required libraries included with raylib
|
||||
* - Complete bindings to LUA (raylib-lua) and Go (raylib-go)
|
||||
*
|
||||
* NOTES:
|
||||
|
|
@ -33,14 +33,15 @@
|
|||
* stb_image_resize (Sean Barret) for image resizing algorythms [textures]
|
||||
* stb_image_write (Sean Barret) for image writting (PNG) [utils]
|
||||
* stb_truetype (Sean Barret) for ttf fonts loading [text]
|
||||
* stb_rect_pack (Sean Barret) for rectangles packing [text]
|
||||
* stb_vorbis (Sean Barret) for OGG audio loading [audio]
|
||||
* stb_perlin (Sean Barret) for Perlin noise image generation [textures]
|
||||
* par_shapes (Philip Rideout) for parametric 3d shapes generation [models]
|
||||
* jar_xm (Joshua Reisenauer) for XM audio module loading [audio]
|
||||
* jar_mod (Joshua Reisenauer) for MOD audio module loading [audio]
|
||||
* dr_flac (David Reid) for FLAC audio file loading [audio]
|
||||
* dr_mp3 (David Reid) for MP3 audio file loading [audio]
|
||||
* rgif (Charlie Tangora, Ramon Santamaria) for GIF recording [core]
|
||||
* tinfl for data decompression (DEFLATE algorithm) [rres]
|
||||
*
|
||||
*
|
||||
* LICENSE: zlib/libpng
|
||||
|
|
@ -92,7 +93,7 @@
|
|||
#define FLAG_SHOW_LOGO 1 // Set to show raylib logo at startup
|
||||
#define FLAG_FULLSCREEN_MODE 2 // Set to run program in fullscreen
|
||||
#define FLAG_WINDOW_RESIZABLE 4 // Set to allow resizable window
|
||||
#define FLAG_WINDOW_DECORATED 8 // Set to show window decoration (frame and buttons)
|
||||
#define FLAG_WINDOW_UNDECORATED 8 // Set to disable window decoration (frame and buttons)
|
||||
#define FLAG_WINDOW_TRANSPARENT 16 // Set to allow transparent window
|
||||
#define FLAG_MSAA_4X_HINT 32 // Set to try enabling MSAA 4X
|
||||
#define FLAG_VSYNC_HINT 64 // Set to try enabling V-Sync on GPU
|
||||
|
|
@ -331,6 +332,8 @@ typedef struct Vector4 {
|
|||
float w;
|
||||
} Vector4;
|
||||
|
||||
typedef Vector4 Quaternion;
|
||||
|
||||
// Matrix type (OpenGL style 4x4 - right handed, column major)
|
||||
typedef struct Matrix {
|
||||
float m0, m4, m8, m12;
|
||||
|
|
@ -389,6 +392,7 @@ typedef struct CharInfo {
|
|||
int offsetX; // Character offset X when drawing
|
||||
int offsetY; // Character offset Y when drawing
|
||||
int advanceX; // Character advance position X
|
||||
unsigned char *data; // Character pixel data (grayscale)
|
||||
} CharInfo;
|
||||
|
||||
// Font type, includes texture and charSet array data
|
||||
|
|
@ -539,12 +543,12 @@ typedef struct VrDeviceInfo {
|
|||
// Enumerators Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
// Trace log type
|
||||
typedef enum {
|
||||
typedef enum {
|
||||
LOG_INFO = 1,
|
||||
LOG_WARNING = 2,
|
||||
LOG_ERROR = 4,
|
||||
LOG_DEBUG = 8,
|
||||
LOG_OTHER = 16
|
||||
LOG_WARNING = 2,
|
||||
LOG_ERROR = 4,
|
||||
LOG_DEBUG = 8,
|
||||
LOG_OTHER = 16
|
||||
} LogType;
|
||||
|
||||
// Shader location point type
|
||||
|
|
@ -636,16 +640,16 @@ typedef enum {
|
|||
} TextureFilterMode;
|
||||
|
||||
// Texture parameters: wrap mode
|
||||
typedef enum {
|
||||
WRAP_REPEAT = 0,
|
||||
WRAP_CLAMP,
|
||||
WRAP_MIRROR
|
||||
typedef enum {
|
||||
WRAP_REPEAT = 0,
|
||||
WRAP_CLAMP,
|
||||
WRAP_MIRROR
|
||||
} TextureWrapMode;
|
||||
|
||||
// Color blending modes (pre-defined)
|
||||
typedef enum {
|
||||
BLEND_ALPHA = 0,
|
||||
BLEND_ADDITIVE,
|
||||
typedef enum {
|
||||
BLEND_ALPHA = 0,
|
||||
BLEND_ADDITIVE,
|
||||
BLEND_MULTIPLIED
|
||||
} BlendMode;
|
||||
|
||||
|
|
@ -899,6 +903,7 @@ RLAPI void UnloadImage(Image image);
|
|||
RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
|
||||
RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
|
||||
RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
|
||||
RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized)
|
||||
RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
|
||||
RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image
|
||||
RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
|
||||
|
|
@ -912,8 +917,9 @@ RLAPI void ImageAlphaClear(Image *image, Color color, float threshold);
|
|||
RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
|
||||
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
||||
RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
|
||||
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering)
|
||||
RLAPI void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm)
|
||||
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (bilinear filtering)
|
||||
RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
||||
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color
|
||||
RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image
|
||||
RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
|
||||
RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
|
||||
|
|
@ -924,11 +930,14 @@ RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fon
|
|||
RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination)
|
||||
RLAPI void ImageFlipVertical(Image *image); // Flip image vertically
|
||||
RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally
|
||||
RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg
|
||||
RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg
|
||||
RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint
|
||||
RLAPI void ImageColorInvert(Image *image); // Modify image color: invert
|
||||
RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale
|
||||
RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
|
||||
RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
|
||||
RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
|
||||
|
||||
// Image generation functions
|
||||
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
|
||||
|
|
@ -951,29 +960,30 @@ RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint);
|
|||
RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
|
||||
RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
|
||||
RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Font Loading and Text Drawing Functions (Module: text)
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
// Font loading/unloading functions
|
||||
RLAPI Font GetDefaultFont(void); // Get the default Font
|
||||
RLAPI Font LoadFont(const char *fileName); // Load Font from file into GPU memory (VRAM)
|
||||
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load Font from file with extended parameters
|
||||
RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
|
||||
RLAPI Font GetDefaultFont(void); // Get the default Font
|
||||
RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
|
||||
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load font from file with extended parameters
|
||||
RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, bool sdf); // Load font data for further use
|
||||
RLAPI Image GenImageFontAtlas(CharInfo *chars, int fontSize, int charsCount, int padding, int packMethod); // Generate image font atlas using chars info
|
||||
RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM)
|
||||
|
||||
// Text drawing functions
|
||||
RLAPI void DrawFPS(int posX, int posY); // Shows current FPS
|
||||
RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
|
||||
RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using Font and additional parameters
|
||||
RLAPI void DrawFPS(int posX, int posY); // Shows current FPS
|
||||
RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
|
||||
RLAPI void DrawTextEx(Font font, const char* text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
|
||||
|
||||
// Text misc. functions
|
||||
RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
|
||||
RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
|
||||
RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed'
|
||||
RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string
|
||||
RLAPI int GetGlyphIndex(Font font, int character); // Returns index position for a unicode character on sprite font
|
||||
RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font
|
||||
RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
|
||||
RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed'
|
||||
RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string
|
||||
RLAPI int GetGlyphIndex(Font font, int character); // Get index position for a unicode character on sprite font
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Basic 3d Shapes Drawing Functions (Module: models)
|
||||
|
|
@ -1013,7 +1023,7 @@ RLAPI void ExportMesh(const char *fileName, Mesh mesh);
|
|||
|
||||
// Mesh manipulation functions
|
||||
RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
|
||||
RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
|
||||
RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
|
||||
RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals
|
||||
|
||||
// Mesh generation functions
|
||||
|
|
|
|||
BIN
src/raylib.rc.o
Normal file
BIN
src/raylib.rc.o
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue