This commit is contained in:
Shaohua Tong 2019-12-18 12:28:07 +01:00
parent 14c1335881
commit 8fab19dd26
2 changed files with 3 additions and 6 deletions

View File

@ -5,6 +5,8 @@
#include "DrawRender.hpp" #include "DrawRender.hpp"
#include <algorithm> #include <algorithm>
#include <unistd.h> #include <unistd.h>
#include <thread>
#include <chrono>
DrawRender::DrawRender(int windowWidth, int windowHeight, vkvm::Color defaultBackgroundColor, vkvm::Color penColor, int penWidth) DrawRender::DrawRender(int windowWidth, int windowHeight, vkvm::Color defaultBackgroundColor, vkvm::Color penColor, int penWidth)
: backgroundColor(defaultBackgroundColor), penColor(penColor) { : backgroundColor(defaultBackgroundColor), penColor(penColor) {
@ -125,11 +127,7 @@ void DrawRender::translateToSharedMemory(std::vector<std::vector<bool>> shape, i
currentY++; currentY++;
} }
// a violent way to delay redraw std::this_thread::sleep_for(std::chrono::milliseconds(100));
for(y = 900; y < 1000; y++) {
for(x = 900; x < 1000; x++)
vkvm::setPixel(y, x, vkvm::Color(217,217,217));
}
} }
void DrawRender::clearToSharedMemory(std::vector<std::vector<bool>> shape, int startX, int startY) { void DrawRender::clearToSharedMemory(std::vector<std::vector<bool>> shape, int startX, int startY) {

View File

@ -8,7 +8,6 @@
#include <Color.hpp> #include <Color.hpp>
#include <vkvm.hpp> #include <vkvm.hpp>
#include <iostream> #include <iostream>
#include "Font.h"
#include "vector" #include "vector"
#include "utils.hpp" #include "utils.hpp"
#include <cmath> #include <cmath>