wh
This commit is contained in:
1 parent
1905ec7f6f
commit
804385cc28
3 files changed
+11
-18
No files matched your search
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user