mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:18:12 +00:00

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. :^)
43 lines
772 B
C++
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
|
|
};
|
|
|