1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:18:12 +00:00
serenity/Widgets/FrameBuffer.h
Andreas Kling f6d2c3ed87 Hook everything up to run the GUI on top of the kernel.
Okay things kinda sorta work. Both Bochs and QEMU now boot into GUI mode.
There's a ton of stuff that doesn't make sense and so many things to rework.

Still it's quite cool to have made it this far. :^)
2019-01-10 23:19:29 +01:00

43 lines
772 B
C++

#pragma once
#include "AbstractScreen.h"
#include "Color.h"
#ifdef USE_SDL
#include <SDL.h>
#endif
class GraphicsBitmap;
class FrameBuffer final : public AbstractScreen {
public:
FrameBuffer(unsigned width, unsigned height);
FrameBuffer(RGBA32*, unsigned width, unsigned height);
virtual ~FrameBuffer() override;
void show();
#ifdef USE_SDL
SDL_Surface* surface() { return m_surface; }
#endif
static FrameBuffer& the();
RGBA32* scanline(int y);
void blit(const Point&, GraphicsBitmap&);
void flush();
static void initialize();
private:
#ifdef USE_SDL
void initializeSDL();
SDL_Window* m_window { nullptr };
SDL_Surface* m_surface { nullptr };
#endif
#ifdef SERENITY
RGBA32* m_data { nullptr };
#endif
};