is there any way to use PGraphics.beginDraw and PGraphics.endDraw outside of the scope of PGraphics.*() calls?
for example if i do this then nothing renders
void drawGraphics() {
//graphics.endDraw();
if (displayFPS) {
window.graphics.beginDraw();
int oldColor = window.graphics.fillColor;
window.graphics.fill(255);
window.graphics.textSize(16);
window.graphics.text("FPS: " + frameRate, 10, 20);
window.graphics.fill(oldColor);
window.graphics.endDraw();
}
//graphics.beginDraw();
graphics.image(
window.graphics,
window.x,
window.y,
window.width,
window.height
);
}
void drawWindow() {
graphics.beginDraw();
clearScreen();
if (focus) {
if (clickedOnBorder && locked) drawBordersLocked();
else drawBordersHighlighted();
} else {
drawBorders();
}
drawGraphics();
graphics.endDraw();
}
but if i do this then it renders
void drawGraphics() {
graphics.endDraw();
if (displayFPS) {
window.graphics.beginDraw();
int oldColor = window.graphics.fillColor;
window.graphics.fill(255);
window.graphics.textSize(16);
window.graphics.text("FPS: " + frameRate, 10, 20);
window.graphics.fill(oldColor);
window.graphics.endDraw();
}
graphics.beginDraw();
graphics.image(
window.graphics,
window.x,
window.y,
window.width,
window.height
);
}
void drawWindow() {
graphics.beginDraw();
clearScreen();
if (focus) {
if (clickedOnBorder && locked) drawBordersLocked();
else drawBordersHighlighted();
} else {
drawBorders();
}
drawGraphics();
graphics.endDraw();
}