implemented DisplaySDL

This commit is contained in:
2024-11-28 04:08:37 -05:00
parent e4636e4901
commit 5429c5fac1
5 changed files with 114 additions and 4 deletions

View File

@@ -2,6 +2,8 @@
#include <SDL2/SDL.h>
#include "BuzzerSDL.hpp"
#include "DisplaySDL.hpp"
#include "Peripherals.hpp"
int main(int argc, char* args[]) {
if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
@@ -9,11 +11,22 @@ int main(int argc, char* args[]) {
return 1;
}
class DisplayTest : public DisplaySDL {
public:
DisplayTest() : DisplaySDL(1280, 640, 0xff0000, 0x00ff00) {
for(int i = 0; i < chocochip8::gcHeight; i+=2) {
mpFramebuffer->at(i).set();
}
}
};
BuzzerSDL buzzer(440);
buzzer.on();
//buzzer.on();
DisplayTest display;
SDL_Event event;
while(SDL_WaitEvent(&event) && event.type != SDL_QUIT) {
display.updateWindow();
}
buzzer.off();