diff options
Diffstat (limited to 'src/screen.c')
| -rw-r--r-- | src/screen.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c index 24a1eb8..d312a8d 100644 --- a/src/screen.c +++ b/src/screen.c @@ -12,7 +12,8 @@ void ScreenInit(int width, int height){ Screen.originX=(width-64*Screen.pixel)/2; Screen.originY=(height-32*Screen.pixel)/2; ScreenClear(); - + + SetTraceLogLevel(LOG_ERROR); // Disable anoying raylib logs InitWindow(width, height, "Chip-8 Emulator"); SetTargetFPS(60); // Set game to run at 60 frames-per-second } @@ -43,6 +44,13 @@ void ScreenSetPixel(int x, int y, unsigned char state){ Screen.pixels[x+y*64]=(state==0) ? 0: 1; } +void ScreenPixelFlip(int x, int y){ + if(Screen.pixels[x+y*64]==0) + Screen.pixels[x+y*64]=1; + else + Screen.pixels[x+y*64]=0; +} + void ScreenClose(){ CloseWindow(); // Close window and OpenGL context } |
