2020-11-05 13:21:59 +00:00
|
|
|
#include <iostream>
|
2020-11-05 13:58:07 +00:00
|
|
|
#include "RenderWindow.hpp"
|
2020-11-09 16:28:19 +00:00
|
|
|
#include "screens/PlotScreen.hpp"
|
2020-11-05 14:21:20 +00:00
|
|
|
#include "screens/DummyScreen.hpp"
|
2020-11-09 16:28:19 +00:00
|
|
|
#include "Signal.hpp"
|
2020-11-05 13:21:59 +00:00
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2020-11-09 16:28:19 +00:00
|
|
|
Signal sig;
|
|
|
|
|
2020-11-05 13:58:07 +00:00
|
|
|
RenderWindow* window;
|
2020-11-10 18:56:47 +00:00
|
|
|
DummyScreen* ds;
|
|
|
|
PlotScreen* ps;
|
2020-11-05 13:58:07 +00:00
|
|
|
try
|
2020-11-05 13:43:58 +00:00
|
|
|
{
|
2020-11-05 13:58:07 +00:00
|
|
|
window = new RenderWindow(800, 800);
|
2020-11-10 18:56:47 +00:00
|
|
|
|
|
|
|
ds = new DummyScreen(window->renderer, 0, 0, 800, 800);
|
|
|
|
ps = new PlotScreen(window->renderer, &sig, 50, 50, 700, 300, 0, -1.5f, 10, 1.5f);
|
|
|
|
|
|
|
|
window->AddScreen(ds);
|
|
|
|
window->AddScreen(ps);
|
2020-11-05 13:43:58 +00:00
|
|
|
}
|
2020-11-05 13:58:07 +00:00
|
|
|
catch (const std::runtime_error& e)
|
2020-11-05 13:43:58 +00:00
|
|
|
{
|
2020-11-05 13:58:07 +00:00
|
|
|
std::cerr << e.what() << std::endl;
|
|
|
|
return -1;
|
2020-11-05 13:43:58 +00:00
|
|
|
}
|
2020-11-05 13:58:07 +00:00
|
|
|
|
|
|
|
window->Run();
|
2020-11-05 13:21:59 +00:00
|
|
|
|
2020-11-10 18:56:47 +00:00
|
|
|
window->RemoveScreen(ps);
|
|
|
|
window->RemoveScreen(ds);
|
|
|
|
|
|
|
|
delete ps;
|
|
|
|
delete ds;
|
|
|
|
delete window;
|
|
|
|
|
2020-11-05 13:21:59 +00:00
|
|
|
return 0;
|
|
|
|
}
|