48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
/*
|
|
The GPLv3 License (GPLv3)
|
|
|
|
Copyright (c) 2022 Akos Horvath
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include "utils.h"
|
|
#include "mandelbrot.h"
|
|
|
|
using namespace Util;
|
|
|
|
namespace Mandelbrot {
|
|
|
|
class Graphics {
|
|
public:
|
|
std::string title;
|
|
int w, h;
|
|
SDL_Window *window;
|
|
SDL_Renderer *renderer;
|
|
Vec2mp from;
|
|
Vec2mp to;
|
|
bool running;
|
|
|
|
Graphics(int w, int h, std::string title);
|
|
void plot(Mandelbrotc const &m);
|
|
void mainLoop();
|
|
void drawPoint(const Vec2i &pos, const rgb &col);
|
|
};
|
|
} // namespace Mandelbrot
|