Search code examples
c++linuxgraphicswindowrenderer

Portable real time renderer window without graphical API


I am writing a renderer on CPU and GPU (using Cuda) using C++. I do not use DirectX, Vulkan or OpenGL, I am writing the whole rendering pipeline myself as an exercise. For the moment, the result of the rendering is saved as a PNG file.

However, I would like to display the result of the rendering in real time in a window but I do not know how to do it. For example, in the Nvidia OptiX examples (https://github.com/nvpro-samples/optix_advanced_samples), they create a window using glfw3 and then they create an OpenGL context and they display the result of the OptiX rendering on a simple texture inside the OpenGL context. I would like to do the same, but I do not want to create an OpenGL context because I want to have a portable solution (Windows and Linux) which do not use any graphical API. I do not want to rely on OpenGL, especially if it is only for the display.

Is there a portable C++ library for managing a window and displaying in real time a texture without using any major graphical API (DirectX, Vulkan, OpenGL) ?

Edit: Thank you for your answers. I was probably not so clear in my initial question. I want to use a GUI but I do not want to use a hardware accelerated API such as OpenGL. Because 60 times per second I refresh a buffer in memory which contains the rendering of my scene (an array of 8 bits unsigned int, with a simple RGB representation, 3 values per pixel), and I just want to display this buffer inside a window 60 times per second.


Solution

  • There are standalone libraries like Window-API that will provide cross-platform window management (Linux + Windows, in that case).

    There are frameworks like Qt and wxWidgets that do that and much more, like providing you a kitchen sink, refrigerator, backyard rocket launching pad, etc.

    You're still going to need to talk to a "graphical" API or framework of some sort (hence GUI, graphical user interface) but you can certainly display images, animations, videos, etc, outside of hardware-accelerated 3D graphical rendering contexts like OpenGL, Vulkan, or DirectX.