initial commit

This commit is contained in:
2021-12-03 19:45:52 -05:00
commit 7b2a0719b1
17 changed files with 297 additions and 0 deletions

32
src/game/visualizer.cpp Normal file
View File

@@ -0,0 +1,32 @@
//
// Created by m on 12/3/21.
//
#include "visualizer.hpp"
#define TITLE "test"
#define WIN_WIDTH 800
#define WIN_HEIGHT 600
#define TARGET_FPS 60
bool Visualizer::update() {
this->x += 1;
if(this->x > WIN_WIDTH) {
this->x = 0;
return true;
}
return false;
}
RendererParams Visualizer::get_renderer_params() {
return {.title = TITLE, .width = WIN_WIDTH, .height = WIN_HEIGHT};
}
unsigned int Visualizer::get_framerate() {
return TARGET_FPS;
}
void Visualizer::render(Renderer *renderer) {
Color color = Color(255, 255, 255, 255);
for(int y=0;y<WIN_HEIGHT;y++) {
renderer->draw_point(this->x, y, color);
}
}