| 102 | } |
| 103 | |
| 104 | void Window::Resize(vector2i_t size){ |
| 105 | Lemon::UnmapSharedMemory(windowBufferInfo, windowBufferKey); |
| 106 | |
| 107 | surface.buffer = buffer1; |
| 108 | surface.width = size.x; |
| 109 | surface.height = size.y; |
| 110 | |
| 111 | if(menuBar){ |
| 112 | rootContainer.SetBounds({{0, 16}, {size.x, size.y - WINDOW_MENUBAR_HEIGHT}}); |
| 113 | } else { |
| 114 | rootContainer.SetBounds({{0, 0}, size}); |
| 115 | } |
| 116 | |
| 117 | rootContainer.UpdateFixedBounds(); |
| 118 | |
| 119 | windowBufferKey = WMClient::Resize(size.x, size.y); |
| 120 | if(windowBufferKey <= 0){ |
| 121 | printf("[LibLemon] Warning: Window::Resize: Failed to obtain window buffer!\n"); |
| 122 | return; |
| 123 | } |
| 124 | |
| 125 | windowBufferInfo = (WindowBuffer*)Lemon::MapSharedMemory(windowBufferKey); |
| 126 | |
| 127 | windowBufferInfo->currentBuffer = 0; |
| 128 | buffer1 = ((uint8_t*)windowBufferInfo) + windowBufferInfo->buffer1Offset; |
| 129 | buffer2 = ((uint8_t*)windowBufferInfo) + windowBufferInfo->buffer2Offset; |
| 130 | |
| 131 | Paint(); |
| 132 | } |
| 133 | |
| 134 | void Window::SwapBuffers(){ |
| 135 | if(windowBufferInfo->drawing) return; |
nothing calls this directly
no test coverage detected