33 lines
674 B
C++
Raw Normal View History

#include "Default.hpp"
#include <libsccolor.hpp>
#include <libscscreensaver.hpp>
class Default : public ScreensaverPlugin {
public:
Default() = default;
~Default() = default;
int fps() const override;
void update() override;
void render() override;
};
ScreensaverPlugin* create_instance() {
return new Default;
}
2020-10-26 23:03:12 +01:00
int Default::fps() const {
return 2;
}
void Default::update() {
}
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);
}