diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2023-12-25 09:11:45 +0100 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2023-12-25 09:11:45 +0100 |
| commit | 16f7128a0c81a508940ee1a8e8d1b8fe36f83259 (patch) | |
| tree | 690523d91c2b66d804e9db98143ff716ef1bba89 /src/screen.c | |
| parent | 14e9dd9258eaf62dba3867bb6edc9cd8687125c4 (diff) | |
Minor changes
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 } |
