Qt 5.5 and OpenGL: Retrieving device info

后端 未结 1 1262
攒了一身酷
攒了一身酷 2021-01-21 22:42

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 m

相关标签:
1条回答
  • 2021-01-21 23:10
    • 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...

    0 讨论(0)
提交回复
热议问题