Reputation: 946
I've written a Qt 5.5 application that uses OpenGL in the form of a QOpenGLWidget. Now I'd like it so that the user can see their device info from the application. By this I mean something along the lines of:
So far, I myself have been unable to find any relating functions. Although I am aware that this can be done by making calls to OpenGL, I'd much rather keep all the code relatively high-level. I found this very old post from 2004 stating that Qt does not have this feature, but maybe times have changed?
Upvotes: 3
Views: 3694
Reputation: 22826
Card name: no cross-platform way of getting it. It may be returned as part of glGetString(GL_RENDERER)
, for instance on NVIDIA I get
GeForce GTX 980 PCIe/SSE2
Vendor: glGetString(GL_VENDOR)
NVIDIA Corporation
Total GPU memory: absolutely not cross platform. Use GL_NVX_gpu_memory_info
for NVIDIA, AMD_gpu_association
(platform dependent) or GL_ATI_meminfo
for AMD/ATI. Note that knowing the amount of VRAM is almost useless, you have several sublimits for any particular object you will try to create (maximum VBO size, maximum texture size, texture level size, renderbuffer size...).
Driver version: absolutely not cross platform, may be included as part of glGetString(GL_VERSION)
(which allows for vendor-specific info at the end), otherwise you'll need once more to go platform-specific:
4.5.0 NVIDIA 346.87
Extensions list: with Qt, QOpenGLContext::extensions()
, hasExtension()
, plus the resolved function pointer helpers (getProcAddress()
, QOpenGLFunctions
, QOpenGLVersionFunctions
, etc.). Any other GL resolver (e.g. GLEW) has equivalent methods. And you want to use resolvers and not go down to the platform specific again...
Upvotes: 5