From 804385cc288b82718d22a48ae56a2e390218f588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Sun, 25 Oct 2026 07:02:43 +0300 Subject: [PATCH] wh --- components/raybri/raybri.c | 23 +++++++++-------------- components/raybri/raybri.h | 3 +-- components/render/renderAux.swift | 3 +-- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/components/raybri/raybri.c b/components/raybri/raybri.c index ccdf8f6..e27ad28 100644 --- a/components/raybri/raybri.c +++ b/components/raybri/raybri.c @@ -3,8 +3,6 @@ #include "raybriConst.h" #include "rlgl.h" -static int sr_width = 1; -static int sr_height = 1; static int sr_ready = 0; void raybriInit(void) { @@ -20,25 +18,22 @@ void raybriInit(void) { sr_ready = 1; } -void raybriResize(int width, int height) -{ - if (width > 0) sr_width = width; - if (height > 0) sr_height = height; -} +void raybriRender(int width, int height) { + if (!sr_ready) { + return; + } -void raybriRender(void) -{ - if (!sr_ready) return; - - rlViewport(0, 0, sr_width, sr_height); + rlViewport(0, 0, width, height); rlClearScreenBuffers(); rlDrawRenderBatchActive(); } void raybriShutdown(void) { - if (!sr_ready) return; + if (!sr_ready) { + return; + } + sr_ready = 0; rlglClose(); - sr_ready = 0; } diff --git a/components/raybri/raybri.h b/components/raybri/raybri.h index 6a98d2d..902f706 100644 --- a/components/raybri/raybri.h +++ b/components/raybri/raybri.h @@ -2,8 +2,7 @@ #define RAYBRI_H void raybriInit(void); -void raybriRender(void); -void raybriResize(int width, int height); +void raybriRender(int width, int height); void raybriShutdown(void); #endif // RAYBRI_H diff --git a/components/render/renderAux.swift b/components/render/renderAux.swift index ebaa6b1..cd5d82a 100644 --- a/components/render/renderAux.swift +++ b/components/render/renderAux.swift @@ -3,8 +3,7 @@ import RaylibBridge func renderDraw(_ vm: RenderVM) { vm.glView.openGLContext?.makeCurrentContext() - raybriResize(vm.pixelSize[0], vm.pixelSize[1]) - raybriRender() + raybriRender(vm.pixelSize[0], vm.pixelSize[1]) vm.glView.openGLContext?.flushBuffer() }