mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 09:35:09 +00:00
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. :^)
This commit is contained in:
parent
8626e95509
commit
f6d2c3ed87
17 changed files with 117 additions and 23 deletions
|
@ -2,7 +2,12 @@
|
|||
#include "GraphicsBitmap.h"
|
||||
#include <AK/Assertions.h>
|
||||
|
||||
FrameBuffer* s_the = nullptr;
|
||||
FrameBuffer* s_the;
|
||||
|
||||
void FrameBuffer::initialize()
|
||||
{
|
||||
s_the = nullptr;
|
||||
}
|
||||
|
||||
FrameBuffer& FrameBuffer::the()
|
||||
{
|
||||
|
@ -20,6 +25,17 @@ FrameBuffer::FrameBuffer(unsigned width, unsigned height)
|
|||
#endif
|
||||
}
|
||||
|
||||
FrameBuffer::FrameBuffer(RGBA32* data, unsigned width, unsigned height)
|
||||
: AbstractScreen(width, height)
|
||||
#ifdef SERENITY
|
||||
, m_data(data)
|
||||
#endif
|
||||
{
|
||||
ASSERT(!s_the);
|
||||
s_the = this;
|
||||
}
|
||||
|
||||
|
||||
FrameBuffer::~FrameBuffer()
|
||||
{
|
||||
#ifdef USE_SDL
|
||||
|
@ -68,6 +84,10 @@ RGBA32* FrameBuffer::scanline(int y)
|
|||
#ifdef USE_SDL
|
||||
return reinterpret_cast<RGBA32*>(((byte*)m_surface->pixels) + (y * m_surface->pitch));
|
||||
#endif
|
||||
#ifdef SERENITY
|
||||
unsigned pitch = sizeof(RGBA32) * width();
|
||||
return reinterpret_cast<RGBA32*>(((byte*)m_data) + (y * pitch));
|
||||
#endif
|
||||
}
|
||||
|
||||
void FrameBuffer::blit(const Point& position, GraphicsBitmap& bitmap)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue