implemented DisplaySDL
This commit is contained in:
15
main.cpp
15
main.cpp
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user