49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
|
//
|
||
|
// Created by shaohuatong on 21.11.19.
|
||
|
//
|
||
|
#ifndef SIMPLE_DRAW_DRAWRENDER_HPP
|
||
|
#define SIMPLE_DRAW_DRAWRENDER_HPP
|
||
|
|
||
|
#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);
|
||
|
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;
|
||
|
|
||
|
std::vector<std::vector<bool>> circleAndSquareCreator(vkvm::Coordinates mousePosition, int type);
|
||
|
std::vector<std::vector<bool>> brushCreator(vkvm::Coordinates mousePosition);
|
||
|
|
||
|
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
|