simple-draw/src/DrawRender.hpp

49 lines
1.2 KiB
C++
Raw Normal View History

2019-11-22 19:45:52 +01:00
//
// Created by shaohuatong on 21.11.19.
//
#ifndef SIMPLE_DRAW_DRAWRENDER_HPP
#define SIMPLE_DRAW_DRAWRENDER_HPP
2019-11-22 19:45:52 +01:00
#include <string>
#include <Color.hpp>
#include <vkvm.hpp>
#include <iostream>
#include "Font.h"
#include "vector"
#define CIRCLE 0
#define SQUARE 1
#define BRUSH 2
class DrawRender {
public:
DrawRender(int windowWidth, int windowHeight, vkvm::Color defaultBackgroundColor, vkvm::Color penColor, int penWidth);
void setType();
void update(vkvm::Coordinates mousePosition, int type);
2019-11-22 19:45:52 +01:00
void clear();
private:
vkvm::Coordinates mousePosition;
vkvm::Color backgroundColor;
vkvm::Color penColor;
int type;
int penWidth;
int windowWidth;
int windowHeight;
int graphicsHeight;
int graphicsWidth;
int radius;
int startX;
int startY;
bool turnOnBrush;
2019-11-22 19:45:52 +01:00
std::vector<std::vector<bool>> circleAndSquareCreator(vkvm::Coordinates mousePosition, int type);
std::vector<std::vector<bool>> brushCreator(vkvm::Coordinates mousePosition);
2019-11-22 19:45:52 +01:00
int squareOfDistance(vkvm::Coordinates x, vkvm::Coordinates y);
void translateToSharedMemory(std::vector<std::vector<bool>> graphics, int startX, int startY, int Type);
};
#endif //SIMPLE_DRAW_DRAWRENDER_HPP