Skip to content

Commit fecf56e

Browse files
raysan5michaelfibercubeofborgubkp
authored
WARNING: rcore module split per-platform **BIG CHANGE** (#3388)
* Submodules (#3311) * Check in current state * Add submodules to Makefile and clean up some imports * Start moving InitGraphicsDeivce * Move android_main and CloseWindow() out of rcore * Move WindowShouldClose out of rcore * Move IsWindowHidden out of rcore * Move IsWindowMinimized out of rcore * Move IsWindowMaximized, IsWindowFocused and IsWindowResized out of rcore * Move ToggleFullscreen out of rcore * Move MaximizeWindow, MinimizeWindow and RestoreWindow out of rcore * Move 13 functions out of rcore: ToggleBorderlessWindowed SetWindowState ClearWindowState SetWindowIcon SetWindowIcons SetWindowTitle SetWindowPosition SetWindowMonitor SetWindowMinSize SetWindowMaxSize SetWindowSize SetWindowOpacity SetWindowFocused * Minor clean up, revert makefile change, include submodules directly in rcore * Fix makefile comment * Remove rcore.h from Makefile * Remove debug include * Move 18 functions from rcore to submodules GetWindowHandle GetMonitorCount GetCurrentMonitor GetMonitorPosition GetMonitorWidth GetMonitorHeight GetMonitorPhysicalHeight GetMonitorRefreshRate GetWindowPosition GetWindowScaleDPI GetMonitorName SetClipboardText GetClipboardText ShowCursor HideCursor EnableCursor DisableCursor GetTime * Move TakeScreenshot, OpenURL, GetGamepadName out of rcore into submodules * remove debugging #defines * Move GetMonitorPhysicalWidth from rcore to submodule * Move GetGamepadAxisCount from rcore * Move SetGamepadMappings out of rcore * Move GetMouseX, GetMouseY, GetMousePosition out of rcore * Move SetMousePosition out of rcore * Move GetMouseWheelMove out of rcore * Move the last functions out of rcore * Move shared function defs and some global var to rcore.h * Clean up rcore.c and rcore.h a little more * Remove unnecessary #define --------- Co-authored-by: MichaelFiber <michael@cubeofb.org> * REVIEWED: `PLATFORM_DESKTOP` Windows building * Revert "REVIEWED: `PLATFORM_DESKTOP` Windows building" This reverts commit 71a1217. * Reviewed Windows building * [split] Fix compilation for web (and desktop) (#3329) * Fix compilation for web * Remove EM_ASM_INT from core_input_gestures_web example * Fix raymath undefined symbols for desktop and web * Remove raylib_opengl_interop from examples Makefile * Revert previous commit (8651c78) * Fix TraceLog for web and desktop * [split] `rcore`, `rcore_web` and `rcore_desktop` changes (batch 2) (#3334) * Fix formatting * Reapply commit 9d230d7 (#3305) that was missing * Reapplies commits 719365f (#3309) and 8a1779b (#3312) that were missing * Reapply commit 5c9cc3f (#3323) that was missing * Reapply commit a2b3b1e that was missing * Revert commit cef25c6 to fix macro redefined warning * Move rcore.h #include to after config.h to fix macro redefinitions warnings * [split] `rcore`, `web`, `desktop`, `android` changes (batch 3) (#3338) * First pass to remove unneeded platform macros for web * Second pass to remove unneeded platform macros for web * Move GetTouchX, GetTouchY, GetTouchPosition from rcore to web, desktop, android * Move SetMouseCursor from rcore to android, desktop, web * [split] `rcore`, `web`, `desktop`, `android` changes (batch 4) (#3343) * Fix ToggleBorderlessWindowed duplicated glfwSetWindowSize calls * First pass to remove unneeded platform macros for android * Second pass to remove unneeded platform macros for android * Remove unneeded platform macros for desktop * Relocate GetGamepadName and update SetGamepadMappings on android, desktop, web * Add missing comment to web * [split] `rcore`, `web`, `desktop`, `android` changes (batch 5) (#3345) * Move SetExitKey from core to android, desktop, web * Move some callbacks from core to desktop and web * Relocate emscripten callbacks on web * Relocate android callbacks on android * Revert "Relocate android callbacks on android" This reverts commit bbdbecc. * Updates UnloadVrStereoConfig on rcore * Update SetClipboardText on android * Fix screenMin/Max default values for android * [split] `rcore`, `drm` changes (#3347) * Tweak makefiles for PLATFORM_DRM and move rcore_drm's dependencies to rcore.h * Move drm functions to rcore_drm.c * Fix a typo in rcore.c * Add SetExitKey to rcore_drm.c --------- Co-authored-by: MichaelFiber <michael@cubeofb.org> * Fix compilation for android (#3360) * Fix android include (#3364) * Reviewed platform split #3313 - Added file headers info - Added TRACELOG message for unimplemented functions - Reviewed code formatting and organization - Several code tweaks * REVIEWED: `GetDirectoryPath()` --------- Co-authored-by: MichaelFiber <42419558+michaelfiber@users.noreply.github.com> Co-authored-by: MichaelFiber <michael@cubeofb.org> Co-authored-by: ubkp <118854183+ubkp@users.noreply.github.com>
1 parent 1327b57 commit fecf56e

File tree

10 files changed

+8865
-6289
lines changed

10 files changed

+8865
-6289
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ xcschememanagement.plist
7575
xcuserdata/
7676
DerivedData/
7777

78+
# VSCode project
79+
.vscode
80+
7881
# Jetbrains project
7982
.idea/
8083
cmake-build-*/

examples/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
225225
endif
226226
endif
227227
ifeq ($(PLATFORM),PLATFORM_DRM)
228+
INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH)
228229
INCLUDE_PATHS += -I/usr/include/libdrm
229230
endif
230231

examples/core/core_input_gestures_web.c

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void Update(void)
135135
}
136136
}
137137
}
138-
138+
139139
int fillLog = 0; // Gate variable to be used to allow or not the gesture log to be filled
140140
if (currentGesture !=0)
141141
{
@@ -156,16 +156,16 @@ void Update(void)
156156
fillLog = 1;
157157
}
158158
}
159-
159+
160160
if (fillLog) // If one of the conditions from logMode was met, fill the gesture log
161161
{
162162
previousGesture = currentGesture;
163163
gestureColor = GetGestureColor(currentGesture);
164164
if (gestureLogIndex <= 0) gestureLogIndex = GESTURE_LOG_SIZE;
165165
gestureLogIndex--;
166-
166+
167167
// Copy the gesture respective name to the gesture log array
168-
TextCopy(gestureLog[gestureLogIndex], GetGestureName(currentGesture));
168+
TextCopy(gestureLog[gestureLogIndex], GetGestureName(currentGesture));
169169
}
170170

171171
// Handle protractor
@@ -182,14 +182,14 @@ void Update(void)
182182
{
183183
currentAngleDegrees = 0.0f;
184184
}
185-
185+
186186
float currentAngleRadians = ((currentAngleDegrees +90.0f)*PI/180); // Convert the current angle to Radians
187187
finalVector = (Vector2){ (angleLength*sinf(currentAngleRadians)) + protractorPosition.x, (angleLength*cosf(currentAngleRadians)) + protractorPosition.y }; // Calculate the final vector for display
188188

189189
// Handle touch and mouse pointer points
190190
//--------------------------------------------------------------------------------------
191191
#define MAX_TOUCH_COUNT 32
192-
192+
193193
Vector2 touchPosition[MAX_TOUCH_COUNT] = { 0 };
194194
Vector2 mousePosition = {0, 0};
195195
if (currentGesture != GESTURE_NONE)
@@ -204,7 +204,7 @@ void Update(void)
204204
// Draw
205205
//--------------------------------------------------------------------------------------
206206
BeginDrawing();
207-
207+
208208
ClearBackground(RAYWHITE);
209209

210210
// Draw common
@@ -235,7 +235,7 @@ void Update(void)
235235
// Draw gesture log
236236
//--------------------------------------------------------------------------------------
237237
DrawText("Log", gestureLogPosition.x, gestureLogPosition.y, 20, BLACK);
238-
238+
239239
// Loop in both directions to print the gesture log array in the inverted order (and looping around if the index started somewhere in the middle)
240240
for (i = 0, ii = gestureLogIndex; i < GESTURE_LOG_SIZE; i++, ii = (ii + 1) % GESTURE_LOG_SIZE) DrawText(gestureLog[ii], gestureLogPosition.x, gestureLogPosition.y + 410 - i*20, 20, (i == 0 ? gestureColor : LIGHTGRAY));
241241
Color logButton1Color, logButton2Color;
@@ -286,7 +286,7 @@ void Update(void)
286286
DrawCircleV(touchPosition[i], 50.0f, Fade(gestureColor, 0.5f));
287287
DrawCircleV(touchPosition[i], 5.0f, gestureColor);
288288
}
289-
289+
290290
if (touchCount == 2) DrawLineEx(touchPosition[0], touchPosition[1], ((currentGesture == 512)? 8 : 12), gestureColor);
291291
}
292292
else
@@ -308,14 +308,6 @@ int main(void)
308308
{
309309
// Initialization
310310
//--------------------------------------------------------------------------------------
311-
#if defined( PLATFORM_WEB )
312-
// Using Emscripten EM_ASM_INT macro, get the page canvas width
313-
const int canvasWidth = EM_ASM_INT( return document.getElementById('canvas').getBoundingClientRect().width; );
314-
315-
if (canvasWidth > 400) screenWidth = canvasWidth;
316-
else screenWidth = 400; // Set a minimum width for the screen
317-
#endif
318-
319311
InitWindow(screenWidth, screenHeight, "raylib [core] example - input gestures web");
320312
//--------------------------------------------------------------------------------------
321313

src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
384384
# without EGL_NO_X11 eglplatform.h tears Xlib.h in which tears X.h in
385385
# which contains a conflicting type Font
386386
CFLAGS += -DEGL_NO_X11
387+
CFLAGS += -Werror=implicit-function-declaration
387388
endif
388389
# Use Wayland display on Linux desktop
389390
ifeq ($(PLATFORM),PLATFORM_DESKTOP)

0 commit comments

Comments
 (0)