Posts

Showing posts from 2025

An issue with embedding in Qt, an external window

Another very specific issue that I encountered while working on tooling for White Rabbit Engine. This one cost me three evenings to figure out :(  For a while in the tooling, we are using a multi-process approach: Hub (Qt application) <-> Client (Qt application) Hub is the main process using QT. Inside it, we have QMainWindow to which we embed the client window. The code to do that is very simple: auto clientWindow = QWindow::fromWinId(clientWindowsId); auto widget = QWidget::createWindowContainer( clientWindow , this); setCenterWidget(widget); You can find this example almost everywhere. The problem I encountered was that my client window had keyboard input only once when a window was created. If I lost focus nothing related to the keyboard worked. Neither shortcuts, neither textboxes, nothing.  While investigating I noticed that  QWidget::createWindowContainer  internally created QWindowContainer that never received QEvent::FocusIn which I assumed was a prob...

OpenGL - Sparse Textures

If you work with OpenGL (like me) you sometimes find it hard to get some more modern examples of code. I recently was looking around for an example of ARB_bindless_texture and never really found it. And because I managed to write one I will share it:  GLuint hwTexture; GLint patchSize = 1024;    // Size of single patch GLint pageSizesCount = 1; // Number of page sizes to choose from  GLint pageSizeX = 0, pageSizeY = 0, pageSizeZ = 0; // Size of page. // Create texture and mark it as sparse glCreateTextures(GL_TEXTURE_2D, 1, &hwTexture); glTextureParameteri(hwTexture, GL_TEXTURE_SPARSE_ARB, GL_TRUE); // Get numbers of available  VIRTUAL_PAGE_SIZE_...   glGetInternalformativ(GL_TEXTURE_2D, GL_RGBA8, GL_NUM_VIRTUAL_PAGE_SIZES_ARB, 1, & pageSizesCount ); // For simplicity of example I get here only the first one.   glGetInternalformativ(GL_TEXTURE_2D, GL_RGBA8, GL_VIRTUAL_PAGE_SIZE_X_ARB, 1, &pageSizeX); glGetInternalformativ(GL_TEX...

Mixing libraries

Image
Let us try blogging again. If you search L.B.A. Tribute news you can find them at coffemonsters.com Here we will be focusing on more technical stuff.   These days I'm tracking some delay in the processing of interaction between my UI (Qt) and Backend (custom code). Generally still far from resolving issues but slowly digging through problems. One of them hit me as an interesting one: QtTimer. I'm using them because they are the most efficient way of injecting some processing into Qt. If this claim is true I'm not sure but they for sure work better than anything I tested so far.  Generally, my whole tooling is based on multiple processes that communicate with each other. I got a little bit more into the details in the presentation that I did recently: This setup result that I have multiple Qt event queues processing at the same time. One in the base process and one in the sub-process. It is really important, that they are processed efficiently because I discovered the hard...