Skip to content

Commit

Permalink
fix minor bugs and errors (x86) for the RGFW platform, update RGFW pl…
Browse files Browse the repository at this point in the history
…atform license, update makefile info for RGFW platform
  • Loading branch information
ColleagueRiley committed May 6, 2024
1 parent d80febd commit 65e06cf
Show file tree
Hide file tree
Showing 19 changed files with 8,006 additions and 61 deletions.
34 changes: 32 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# - Windows (Win32, Win64)
# - Linux (X11/Wayland desktop mode)
# - Others (not tested)
# > PLATFORM_DESKTOP_RGFW (RGFW backend):
# - Windows (Win32, Win64)
# - Linux (X11 desktop mode)
# - macOS/OSX (x64, arm64 (not tested))
# - Others (not tested)
# > PLATFORM_WEB:
# - HTML5 (WebAssembly)
# > PLATFORM_DRM:
Expand Down Expand Up @@ -45,7 +50,7 @@
# Define required environment variables
#------------------------------------------------------------------------------------------------
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
PLATFORM ?= PLATFORM_DESKTOP
PLATFORM ?= PLATFORM_DESKTOP_RGFW

# Define required raylib variables
PROJECT_NAME ?= raylib_examples
Expand Down Expand Up @@ -86,7 +91,7 @@ BUILD_WEB_RESOURCES ?= TRUE
BUILD_WEB_RESOURCES_PATH ?= $(dir $<)resources@resources

# Determine PLATFORM_OS when required
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_DESKTOP_SDL PLATFORM_WEB))
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_DESKTOP_SDL PLATFORM_WEB PLATFORM_DESKTOP_RGFW))
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
# ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -416,6 +421,31 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
LDLIBS += -latomic
endif
endif
ifeq ($(PLATFORM),PLATFORM_DESKTOP_RGFW)
ifeq ($(PLATFORM_OS),WINDOWS)
# Libraries for Windows desktop compilation
LDLIBS = ..\src\libraylib.a -lgdi32 -lwinmm -lopengl32
endif
ifeq ($(PLATFORM_OS),LINUX)
# Libraries for Debian GNU/Linux desktop compipling
# NOTE: Required packages: libegl1-mesa-dev
LDLIBS = ../src/libraylib.a -lGL -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lm -lpthread -ldl -lrt

# Explicit link to libc
ifeq ($(RAYLIB_LIBTYPE),SHARED)
LDLIBS += -lc
endif

# NOTE: On ARM 32bit arch, miniaudio requires atomics library
LDLIBS += -latomic
endif
ifeq ($(PLATFORM_OS),OSX)
# Libraries for Debian GNU/Linux desktop compiling
# NOTE: Required packages: libegl1-mesa-dev
LDLIBS = ../src/libraylib.a -lm
LDLIBS += -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo
endif
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
# Libraries for DRM compiling
# NOTE: Required packages: libasound2-dev (ALSA)
Expand Down
1 change: 0 additions & 1 deletion examples/core/core_custom_frame_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ int main(void)

int targetFPS = 60; // Our initial target fps
//--------------------------------------------------------------------------------------

// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
Expand Down
2 changes: 1 addition & 1 deletion examples/models/models_skybox.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int s
rlEnableShader(shader.id);

// Define projection matrix and send it to shader
Matrix matFboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_CULL_DISTANCE_NEAR, RL_CULL_DISTANCE_FAR);
Matrix matFboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, rlGetCullDistanceNear(), rlGetCullDistanceFar());
rlSetUniformMatrix(shader.locs[SHADER_LOC_MATRIX_PROJECTION], matFboProjection);

// Define view matrix for every side of the cubemap
Expand Down
2 changes: 1 addition & 1 deletion examples/text/text_codepoints_loading.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(void)
// Set bilinear scale filter for better font scaling
SetTextureFilter(font.texture, TEXTURE_FILTER_BILINEAR);

SetTextLineSpacing(54); // Set line spacing for multiline text (when line breaks are included '\n')
SetTextLineSpacing(20); // Set line spacing for multiline text (when line breaks are included '\n')

// Free codepoints, atlas has already been generated
free(codepointsNoDups);
Expand Down
2 changes: 1 addition & 1 deletion examples/text/text_font_loading.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int main(void)
// NOTE: We define a font base size of 32 pixels tall and up-to 250 characters
Font fontTtf = LoadFontEx("resources/pixantiqua.ttf", 32, 0, 250);

SetTextLineSpacing(48); // Set line spacing for multiline text (when line breaks are included '\n')
SetTextLineSpacing(16); // Set line spacing for multiline text (when line breaks are included '\n')

bool useTtf = false;

Expand Down
10 changes: 5 additions & 5 deletions parser/output/raylib_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2957,27 +2957,27 @@
{
"name": "CAMERA_CUSTOM",
"value": 0,
"description": "Custom camera"
"description": "Camera custom, controlled by user (UpdateCamera() does nothing)"
},
{
"name": "CAMERA_FREE",
"value": 1,
"description": "Free camera"
"description": "Camera free mode"
},
{
"name": "CAMERA_ORBITAL",
"value": 2,
"description": "Orbital camera"
"description": "Camera orbital, around target, zoom supported"
},
{
"name": "CAMERA_FIRST_PERSON",
"value": 3,
"description": "First person camera"
"description": "Camera first person"
},
{
"name": "CAMERA_THIRD_PERSON",
"value": 4,
"description": "Third person camera"
"description": "Camera third person"
}
]
},
Expand Down
10 changes: 5 additions & 5 deletions parser/output/raylib_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2957,27 +2957,27 @@ return {
{
name = "CAMERA_CUSTOM",
value = 0,
description = "Custom camera"
description = "Camera custom, controlled by user (UpdateCamera() does nothing)"
},
{
name = "CAMERA_FREE",
value = 1,
description = "Free camera"
description = "Camera free mode"
},
{
name = "CAMERA_ORBITAL",
value = 2,
description = "Orbital camera"
description = "Camera orbital, around target, zoom supported"
},
{
name = "CAMERA_FIRST_PERSON",
value = 3,
description = "First person camera"
description = "Camera first person"
},
{
name = "CAMERA_THIRD_PERSON",
value = 4,
description = "Third person camera"
description = "Camera third person"
}
}
},
Expand Down
10 changes: 5 additions & 5 deletions parser/output/raylib_api.xml
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,11 @@
<Value name="GESTURE_PINCH_OUT" integer="512" desc="Pinch out gesture" />
</Enum>
<Enum name="CameraMode" valueCount="5" desc="Camera system modes">
<Value name="CAMERA_CUSTOM" integer="0" desc="Custom camera" />
<Value name="CAMERA_FREE" integer="1" desc="Free camera" />
<Value name="CAMERA_ORBITAL" integer="2" desc="Orbital camera" />
<Value name="CAMERA_FIRST_PERSON" integer="3" desc="First person camera" />
<Value name="CAMERA_THIRD_PERSON" integer="4" desc="Third person camera" />
<Value name="CAMERA_CUSTOM" integer="0" desc="Camera custom, controlled by user (UpdateCamera() does nothing)" />
<Value name="CAMERA_FREE" integer="1" desc="Camera free mode" />
<Value name="CAMERA_ORBITAL" integer="2" desc="Camera orbital, around target, zoom supported" />
<Value name="CAMERA_FIRST_PERSON" integer="3" desc="Camera first person" />
<Value name="CAMERA_THIRD_PERSON" integer="4" desc="Camera third person" />
</Enum>
<Enum name="CameraProjection" valueCount="2" desc="Camera projection">
<Value name="CAMERA_PERSPECTIVE" integer="0" desc="Perspective projection" />
Expand Down
18 changes: 16 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# - Windows (Win32, Win64)
# - Linux (X11/Wayland desktop mode)
# - Others (not tested)
# > PLATFORM_DESKTOP_RGFW (RGFW backend):
# - Windows (Win32, Win64)
# - Linux (X11 desktop mode)
# - macOS/OSX (x64, arm64 (not tested))
# - Others (not tested)
# > PLATFORM_WEB:
# - HTML5 (WebAssembly)
# > PLATFORM_DRM:
Expand Down Expand Up @@ -51,7 +56,7 @@
# Define required environment variables
#------------------------------------------------------------------------------------------------
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
PLATFORM ?= PLATFORM_DESKTOP
PLATFORM ?= PLATFORM_DESKTOP_RGFW

# Define required raylib variables
RAYLIB_VERSION = 5.0.0
Expand Down Expand Up @@ -224,6 +229,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
#GRAPHICS = GRAPHICS_API_OPENGL_43 # Uncomment to use OpenGL 4.3
#GRAPHICS = GRAPHICS_API_OPENGL_ES2 # Uncomment to use OpenGL ES 2.0 (ANGLE)
endif
ifeq ($(PLATFORM),PLATFORM_DESKTOP_RGFW)
# By default use OpenGL 3.3 on desktop platforms
GRAPHICS ?= GRAPHICS_API_OPENGL_33
#GRAPHICS = GRAPHICS_API_OPENGL_11 # Uncomment to use OpenGL 1.1
#GRAPHICS = GRAPHICS_API_OPENGL_21 # Uncomment to use OpenGL 2.1
#GRAPHICS = GRAPHICS_API_OPENGL_43 # Uncomment to use OpenGL 4.3
#GRAPHICS = GRAPHICS_API_OPENGL_ES2 # Uncomment to use OpenGL ES 2.0 (ANGLE)
endif
ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
# By default use OpenGL 3.3 on desktop platform with SDL backend
GRAPHICS ?= GRAPHICS_API_OPENGL_33
Expand Down Expand Up @@ -583,7 +596,8 @@ OBJS = rcore.o \
rshapes.o \
rtextures.o \
rtext.o \
utils.o
utils.o


ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(USE_EXTERNAL_GLFW),FALSE)
Expand Down

0 comments on commit 65e06cf

Please sign in to comment.