| 298 | } |
| 299 | |
| 300 | int dequeue() { |
| 301 | auto &io = im::GetIO(); |
| 302 | if (s_width != io.DisplaySize.x || s_height != io.DisplaySize.y) { |
| 303 | s_width = io.DisplaySize.x; |
| 304 | s_height = io.DisplaySize.y; |
| 305 | rebuildSwapchain(s_width, s_height); |
| 306 | } |
| 307 | |
| 308 | // get image from queue |
| 309 | auto slot = s_queue.acquireImage(s_swapchain); |
| 310 | s_cmdBuf.clear(); |
| 311 | s_cmdBuf.addMemory(s_cmdMemBlock, slot * CMDBUF_SIZE, CMDBUF_SIZE); |
| 312 | s_cmdBufFences[slot].wait(); |
| 313 | |
| 314 | return slot; |
| 315 | } |
| 316 | |
| 317 | void render(int slot) { |
| 318 | im::Render(); |
no test coverage detected