| 9 | |
| 10 | namespace Lemon::GUI{ |
| 11 | Window::Window(const char* title, vector2i_t size, uint32_t flags, int type, vector2i_t pos) : rootContainer({{0, 0}, size}) { |
| 12 | windowType = type; |
| 13 | this->flags = flags; |
| 14 | |
| 15 | rootContainer.window = this; |
| 16 | |
| 17 | windowBufferKey = CreateWindow(pos.x, pos.y, size.x, size.y, flags, title); |
| 18 | if(windowBufferKey <= 0){ |
| 19 | printf("[LibLemon] Warning: Window::Window: Failed to obtain window buffer!\n"); |
| 20 | return; |
| 21 | } |
| 22 | |
| 23 | windowBufferInfo = (WindowBuffer*)Lemon::MapSharedMemory(windowBufferKey); |
| 24 | |
| 25 | windowBufferInfo->currentBuffer = 0; |
| 26 | buffer1 = ((uint8_t*)windowBufferInfo) + windowBufferInfo->buffer1Offset; |
| 27 | buffer2 = ((uint8_t*)windowBufferInfo) + windowBufferInfo->buffer2Offset; |
| 28 | |
| 29 | surface.buffer = buffer1; |
| 30 | surface.width = size.x; |
| 31 | surface.height = size.y; |
| 32 | } |
| 33 | |
| 34 | Window::~Window(){ |
| 35 | DestroyWindow(); |
nothing calls this directly
no test coverage detected