This commit is contained in:
wheremyfoodat 2022-09-24 02:45:57 +03:00
parent 75070ca6ef
commit be4fae5104
33 changed files with 341 additions and 70 deletions

View file

@ -23,20 +23,29 @@ void Emulator::render() {
void Emulator::run() {
while (window.isOpen()) {
runFrame();
OpenGL::setClearColor(1.0, 0.0, 0.0, 1.0);
OpenGL::setViewport(400, 240 * 2);
// Clear window to black
OpenGL::bindScreenFramebuffer();
OpenGL::disableScissor();
OpenGL::setClearColor(0.0, 0.0, 0.0, 1.0);
OpenGL::clearColor();
gpu.getGraphicsContext(); // Give the GPU a rendering context
runFrame(); // Run 1 frame of instructions
gpu.display();
// Send VBlank interrupts
kernel.sendGPUInterrupt(GPUInterrupt::VBlank0);
kernel.sendGPUInterrupt(GPUInterrupt::VBlank1);
window.display();
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed) {
Helpers::panic("Bye :(");
printf("Bye :(\n");
window.close();
return;
}
}
window.display();
}
}