#include <smk/BlendMode.hpp>
#include <smk/Color.hpp>
#include <smk/Framebuffer.hpp>
#include <smk/Input.hpp>
#include <smk/Shape.hpp>
#include <smk/Sprite.hpp>
#include <smk/Window.hpp>
int main() {
int dim = 512;
int center = dim / 2;
auto window =
smk::Window(dim, dim,
"Framebufer example");
window.ExecuteMainLoop([&] {
window.PoolEvents();
sprite.SetCenter(center, center);
sprite.SetPosition(center, center);
window.Draw(sprite);
window.Display();
sprite.SetScale(0.5, 0.5);
sprite.SetColor({0.6f, 0.7f, 1.f, 1.f});
sprite.SetPosition(center, dim * 0.25);
framebuffer_2.Draw(sprite);
sprite.SetPosition(dim * 0.25, dim * 0.75);
framebuffer_2.Draw(sprite);
sprite.SetPosition(dim * 0.75, dim * 0.75);
framebuffer_2.Draw(sprite);
circle.SetPosition(window.input().cursor());
framebuffer_2.Draw(circle);
std::swap(framebuffer_1, framebuffer_2);
});
return EXIT_SUCCESS;
}
An off-screen drawable area. You can also draw it later in a smk::Sprite.
static Transformable Circle(float radius)
Return a circle.
A window. You can draw objects on the window.
const glm::vec4 Black
Black.
static const BlendMode Add
destination += source.