ja tenim algo de gamecontext. lo proxim va a ser fer algo per a la gestió del temps
This commit is contained in:
1 parent
9b168f02eb
commit
ffc2dee311
7 files changed
+52
-6
No files matched your search
@@ -64,4 +64,17 @@ auto Video::initSDL() -> int {
|
||||
SDL_Delay(1000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Video::clean(int color) {
|
||||
const Uint8 r = static_cast<Uint8>((color >> 16) & 0xFF);
|
||||
const Uint8 g = static_cast<Uint8>((color >> 8) & 0xFF);
|
||||
const Uint8 b = static_cast<Uint8>(color & 0xFF);
|
||||
|
||||
SDL_SetRenderDrawColor(renderer_, r, g, b, 255);
|
||||
SDL_RenderClear(renderer_);
|
||||
}
|
||||
|
||||
void Video::present() {
|
||||
SDL_RenderPresent(renderer_);
|
||||
}
|
||||
@@ -16,6 +16,9 @@ class Video {
|
||||
Video(Config config);
|
||||
~Video();
|
||||
|
||||
void clean(int color);
|
||||
void present();
|
||||
|
||||
private:
|
||||
Config config_;
|
||||
|
||||
|
||||
Reference in new issue
Block a user