2021-01-26 16:00:09 +01:00
|
|
|
#include "Default.hpp"
|
2024-11-27 12:18:52 +01:00
|
|
|
#include <libscgui.hpp>
|
2020-10-27 17:20:23 +01:00
|
|
|
#include <libscscreensaver.hpp>
|
|
|
|
|
2021-01-26 16:00:09 +01:00
|
|
|
class Default : public ScreensaverPlugin {
|
2020-10-27 17:20:23 +01:00
|
|
|
public:
|
2021-01-26 16:00:09 +01:00
|
|
|
Default() = default;
|
|
|
|
~Default() = default;
|
2020-10-27 17:20:23 +01:00
|
|
|
|
|
|
|
int fps() const override;
|
2020-11-15 13:16:49 +01:00
|
|
|
void update() override;
|
|
|
|
void render() override;
|
2020-10-27 17:20:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
ScreensaverPlugin* create_instance() {
|
2021-01-26 16:00:09 +01:00
|
|
|
return new Default;
|
2020-10-27 17:20:23 +01:00
|
|
|
}
|
2020-10-26 23:03:12 +01:00
|
|
|
|
2021-01-26 16:00:09 +01:00
|
|
|
int Default::fps() const {
|
2020-10-27 15:28:26 +01:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2021-01-26 16:00:09 +01:00
|
|
|
void Default::update() {
|
2020-11-15 13:16:49 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-01-26 16:00:09 +01:00
|
|
|
void Default::render() {
|
2020-11-24 14:50:19 +01:00
|
|
|
cairo_set_source_rgba(_c, random01(), random01(), random01(), random01());
|
2020-10-26 23:03:12 +01:00
|
|
|
cairo_rectangle_t rect {random_rect()};
|
|
|
|
cairo_rectangle(_c, rect.x, rect.y, rect.width, rect.height);
|
|
|
|
cairo_fill(_c);
|
|
|
|
}
|