Skip to content

Commit

Permalink
update upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
planetis-m committed Dec 25, 2024
1 parent 615526c commit e98d9cb
Show file tree
Hide file tree
Showing 25 changed files with 1,863 additions and 1,490 deletions.
2 changes: 1 addition & 1 deletion naylib.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "24.49.0"
version = "24.52.0"
author = "Antonis Geralis"
description = "Raylib Nim wrapper"
license = "MIT"
Expand Down
5 changes: 5 additions & 0 deletions src/raylib.nim
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ type
VertexBoneids ## Shader location: vertex attribute: boneIds
VertexBoneweights ## Shader location: vertex attribute: boneWeights
BoneMatrices ## Shader location: array of matrices uniform: boneMatrices
VertexInstanceTx ## Shader location: vertex attribute: instanceTransform

ShaderUniformDataType* {.size: sizeof(int32).} = enum ## Shader uniform data type
Float ## Shader uniform type: float
Expand All @@ -375,6 +376,10 @@ type
Ivec2 ## Shader uniform type: ivec2 (2 int)
Ivec3 ## Shader uniform type: ivec3 (3 int)
Ivec4 ## Shader uniform type: ivec4 (4 int)
Uint ## Shader uniform type: unsigned int
Uivec2 ## Shader uniform type: uivec2 (2 unsigned int)
Uivec3 ## Shader uniform type: uivec3 (3 unsigned int)
Uivec4 ## Shader uniform type: uivec4 (4 unsigned int)
Sampler2d ## Shader uniform type: sampler2d

ShaderAttributeDataType* {.size: sizeof(int32).} = enum ## Shader attribute data types
Expand Down
1 change: 1 addition & 0 deletions src/raylib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ endif()
# Used as public API to be included into other projects
set(raylib_public_headers
raylib.h
rcamera.h
rlgl.h
raymath.h
)
Expand Down
30 changes: 15 additions & 15 deletions src/raylib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# - Linux (X11 desktop mode)
# - macOS/OSX (x64, arm64 (not tested))
# - Others (not tested)
# > PLATFORM_WEB_RGFW:
# - HTML5 (WebAssembly)
# > PLATFORM_WEB:
# - HTML5 (WebAssembly)
# > PLATFORM_DRM:
Expand Down Expand Up @@ -59,11 +61,10 @@
#------------------------------------------------------------------------------------------------
# Define target platform
PLATFORM ?= PLATFORM_DESKTOP

ifeq ($(PLATFORM), PLATFORM_DESKTOP)
TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW
TARGET_PLATFORM = PLATFORM_DESKTOP_GLFW
else
TARGET_PLATFORM = $(PLATFORM)
TARGET_PLATFORM = $(PLATFORM)
endif

# Define required raylib variables
Expand Down Expand Up @@ -120,7 +121,6 @@ SDL_INCLUDE_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/include
SDL_LIBRARY_PATH ?= $(RAYLIB_SRC_PATH)/external/SDL2/lib
SDL_LIBRARIES ?= -lSDL2 -lSDL2main


# Determine if the file has root access (only required to install raylib)
# "whoami" prints the name of the user that calls him (so, if it is the root user, "whoami" prints "root")
ROOT = $(shell whoami)
Expand All @@ -130,7 +130,7 @@ HOST_PLATFORM_OS ?= WINDOWS
PLATFORM_OS ?= WINDOWS

# Determine PLATFORM_OS when required
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_ANDROID))
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW PLATFORM_WEB PLATFORM_WEB_RGFW PLATFORM_ANDROID))
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
# ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -172,15 +172,15 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
PLATFORM_SHELL = sh
endif
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(PLATFORM_OS),LINUX)
ifndef PLATFORM_SHELL
PLATFORM_SHELL = sh
endif
endif
endif

ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
ifeq ($(PLATFORM_OS), WINDOWS)
# Emscripten required variables
EMSDK_PATH ?= C:/raylib/emsdk
Expand Down Expand Up @@ -254,7 +254,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
# On DRM OpenGL ES 2.0 must be used
GRAPHICS = GRAPHICS_API_OPENGL_ES2
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# On HTML5 OpenGL ES 2.0 is used, emscripten translates it to WebGL 1.0
GRAPHICS = GRAPHICS_API_OPENGL_ES2
#GRAPHICS = GRAPHICS_API_OPENGL_ES3
Expand Down Expand Up @@ -288,7 +288,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
AR = $(RPI_TOOLCHAIN)/bin/$(RPI_TOOLCHAIN_NAME)-ar
endif
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# HTML5 emscripten compiler
CC = emcc
AR = emar
Expand Down Expand Up @@ -331,7 +331,7 @@ ifneq ($(RAYLIB_CONFIG_FLAGS), NONE)
CFLAGS += -DEXTERNAL_CONFIG_FLAGS $(RAYLIB_CONFIG_FLAGS)
endif

ifeq ($(TARGET_PLATFORM), PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# NOTE: When using multi-threading in the user code, it requires -pthread enabled
CFLAGS += -std=gnu99
else
Expand All @@ -347,7 +347,7 @@ ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
endif

ifeq ($(RAYLIB_BUILD_MODE),RELEASE)
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
CFLAGS += -Os
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
Expand All @@ -366,7 +366,7 @@ endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
CFLAGS += -Werror=implicit-function-declaration
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# -Os # size optimization
# -O2 # optimization level 2, if used, also set --memory-init-file 0
# -sUSE_GLFW=3 # Use glfw3 library (context/input management) -> Only for linker!
Expand Down Expand Up @@ -659,11 +659,11 @@ all: raylib
# Compile raylib library
# NOTE: Release directory is created if not exist
raylib: $(OBJS)
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# Compile raylib libray for web
#$(CC) $(OBJS) -r -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc
$(AR) rcs $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(OBJS)
@echo "raylib library generated (lib$(RAYLIB_LIB_NAME).a)!"
$(AR) rcs $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).web.a $(OBJS)
@echo "raylib library generated (lib$(RAYLIB_LIB_NAME).web.a)!"
else
ifeq ($(RAYLIB_LIBTYPE),SHARED)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW))
Expand Down
2 changes: 2 additions & 0 deletions src/raylib/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS 7
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS 8
#endif
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCE_TX 9


// Default shader vertex attribute names to set location points
// NOTE: When a new shader is loaded, the following locations are tried to be set for convenience
Expand Down
Loading

0 comments on commit e98d9cb

Please sign in to comment.