2021-01-26 16:00:09 +01:00

40 lines
781 B
C++

//
// Default.cpp
// screensaver
//
// Created by Bob Polis at 2020-10-26
// Copyright (c) 2020 SwiftCoder. All rights reserved.
//
#include "Default.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);
}