Reduce ogs-blue/ver-mac to blue background #6
No files matched your search
@@ -3,8 +3,6 @@
|
|||||||
#include "raybriConst.h"
|
#include "raybriConst.h"
|
||||||
#include "rlgl.h"
|
#include "rlgl.h"
|
||||||
|
|
||||||
static int sr_width = 1;
|
|
||||||
static int sr_height = 1;
|
|
||||||
static int sr_ready = 0;
|
static int sr_ready = 0;
|
||||||
|
|
||||||
void raybriInit(void) {
|
void raybriInit(void) {
|
||||||
@@ -20,25 +18,22 @@ void raybriInit(void) {
|
|||||||
sr_ready = 1;
|
sr_ready = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void raybriResize(int width, int height)
|
void raybriRender(int width, int height) {
|
||||||
{
|
if (!sr_ready) {
|
||||||
if (width > 0) sr_width = width;
|
return;
|
||||||
if (height > 0) sr_height = height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void raybriRender(void)
|
rlViewport(0, 0, width, height);
|
||||||
{
|
|
||||||
if (!sr_ready) return;
|
|
||||||
|
|
||||||
rlViewport(0, 0, sr_width, sr_height);
|
|
||||||
rlClearScreenBuffers();
|
rlClearScreenBuffers();
|
||||||
rlDrawRenderBatchActive();
|
rlDrawRenderBatchActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
void raybriShutdown(void)
|
void raybriShutdown(void)
|
||||||
{
|
{
|
||||||
if (!sr_ready) return;
|
if (!sr_ready) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sr_ready = 0;
|
||||||
|
|
||||||
rlglClose();
|
rlglClose();
|
||||||
sr_ready = 0;
|
|
||||||
}
|
}
|
||||||
@@ -2,8 +2,7 @@
|
|||||||
#define RAYBRI_H
|
#define RAYBRI_H
|
||||||
|
|
||||||
void raybriInit(void);
|
void raybriInit(void);
|
||||||
void raybriRender(void);
|
void raybriRender(int width, int height);
|
||||||
void raybriResize(int width, int height);
|
|
||||||
void raybriShutdown(void);
|
void raybriShutdown(void);
|
||||||
|
|
||||||
#endif // RAYBRI_H
|
#endif // RAYBRI_H
|
||||||
@@ -3,8 +3,7 @@ import RaylibBridge
|
|||||||
|
|
||||||
func renderDraw(_ vm: RenderVM) {
|
func renderDraw(_ vm: RenderVM) {
|
||||||
vm.glView.openGLContext?.makeCurrentContext()
|
vm.glView.openGLContext?.makeCurrentContext()
|
||||||
raybriResize(vm.pixelSize[0], vm.pixelSize[1])
|
raybriRender(vm.pixelSize[0], vm.pixelSize[1])
|
||||||
raybriRender()
|
|
||||||
vm.glView.openGLContext?.flushBuffer()
|
vm.glView.openGLContext?.flushBuffer()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user