#include "WSFrameBuffer.h" #include #include WSFrameBuffer* s_the; void WSFrameBuffer::initialize() { s_the = nullptr; } WSFrameBuffer& WSFrameBuffer::the() { ASSERT(s_the); return *s_the; } WSFrameBuffer::WSFrameBuffer(unsigned width, unsigned height) : WSScreen(width, height) { ASSERT(!s_the); s_the = this; } WSFrameBuffer::WSFrameBuffer(RGBA32* data, unsigned width, unsigned height) : WSScreen(width, height) , m_data(data) { ASSERT(!s_the); s_the = this; } WSFrameBuffer::~WSFrameBuffer() { } void WSFrameBuffer::show() { } RGBA32* WSFrameBuffer::scanline(int y) { unsigned pitch = sizeof(RGBA32) * width(); return reinterpret_cast(((byte*)m_data) + (y * pitch)); }