renamed RectSaver sources to Default

This commit is contained in:
Bob Polis
2021-01-26 15:58:45 +01:00
parent 86105aa0af
commit 923331acc7
2 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,39 @@
//
// RectSaver.cpp
// screensaver
//
// Created by Bob Polis at 2020-10-26
// Copyright (c) 2020 SwiftCoder. All rights reserved.
//
#include "RectSaver.hpp"
#include <libscscreensaver.hpp>
class RectSaver : public ScreensaverPlugin {
public:
RectSaver() = default;
~RectSaver() = default;
int fps() const override;
void update() override;
void render() override;
};
ScreensaverPlugin* create_instance() {
return new RectSaver;
}
int RectSaver::fps() const {
return 2;
}
void RectSaver::update() {
}
void RectSaver::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);
}