13 template<
typename Pixel>
15 :
Layer(COVER_FULL, Z_BACKGROUND)
24 template<
typename Pixel>
28 std::uniform_int_distribution<int> distribution(0, 255);
30 auto& output = checked_cast<SDLOutputSurface&>(output_);
32 auto pixelAccess = output.getDirectPixelAccess();
33 auto [width, height] = output.getLogicalSize();
34 for (
int y = 0; y < height; y += 2) {
35 auto* p0 = pixelAccess.getLinePtr<
Pixel>(y + 0);
36 auto* p1 = pixelAccess.getLinePtr<
Pixel>(y + 1);
37 for (
int x = 0;
x < width;
x += 2) {
38 p0[
x + 0] = p0[
x + 1] = gray[distribution(generator)];
40 memcpy(p1, p0, width *
sizeof(
Pixel));
43 output.flushFrameBuffer();
45 display.repaintDelayed(100 * 1000);
Represents the output window/screen of openMSX.
Interface for display layers.
A frame buffer where pixels can be written to.
uint32_t mapRGB255(gl::ivec3 rgb) const
Same as mapRGB, but RGB components are in range [0..255].
Snow effect for background layer.
void paint(OutputSurface &output) override
Paint this layer.
SDLSnow(OutputSurface &output, Display &display)
constexpr auto enumerate(Iterable &&iterable)
Heavily inspired by Nathan Reed's blog post: Python-Like enumerate() In C++17 http://reedbeta....
This file implemented 3 utility functions:
constexpr KeyMatrixPosition x
Keyboard bindings.
auto & global_urng()
Return reference to a (shared) global random number generator.