Error in Qt 6.2.0: Qt3D.Renderer.OpenGL.Backend: bool Qt3DRender::Render::OpenGL::GraphicsContext::makeCurrent(QSurface*) makeCurrent failed
Solved
Game Development
-
Hello,
I have this error in Qt 6.2.0:
Qt3D.Renderer.OpenGL.Backend: bool Qt3DRender::Render::OpenGL::GraphicsContext::makeCurrent(QSurface*) makeCurrent failed
I created "Qt QWidgets Application". I deleted the Widget class. I added this modules in .pro:
QT += 3dcore 3dextras
main.cpp
#include <QtWidgets/QApplication> #include <Qt3DExtras/Qt3DWindow> class Widget : public Qt3DExtras::Qt3DWindow { public: Widget() { setTitle("Qt3D"); resize(500, 500); } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); }
-
When I wrote this question I understood the answer. I forgot to add activation of second video of my laptop at the beginning of main.cpp:
#ifdef _WIN32 #include <windows.h> extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001; #endif