Bob Polis 8dd1a0f44f Adapt to moved Color class
Color moved from libscscreensaver to libscgui, because it's more
generic than for just screensavers. This forced me to add a libscgui
dependency to all plugins.
2024-11-27 12:18:52 +01:00

33 lines
672 B
C++

#include "Default.hpp"
#include <libscgui.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;
}
int Default::fps() const {
return 2;
}
void Default::update() {
}
void Default::render() {
cairo_set_source_rgba(_c, random01(), random01(), random01(), random01());
cairo_rectangle_t rect {random_rect()};
cairo_rectangle(_c, rect.x, rect.y, rect.width, rect.height);
cairo_fill(_c);
}