initial commit
This commit is contained in:
32
src/game/visualizer.cpp
Normal file
32
src/game/visualizer.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user