Hofmann.Florian Posted June 24, 2019 Share Posted June 24, 2019 Hi, we currently try to use the unigine render context to render a external symbology to a texture within the same graphics context. To achive this we need to get the current context of the Unigine Render engine. We've tried to use the Unigine::RenderContext class by getting it from the App like this. App::get()->getGLContext() We've been also able to get the ogengl name of that context and the void* returned is not null. We currently have trouble interpreting the return value, as there is no further information. In a current setup that we use, we use glfw in the backend that allows to access the native contexts via the following methods for Linux and Windows. The methods glfwGetGLXContext and glfwGetWGLContext described here https://www.glfw.org/docs/latest/group__native.html define the interface that we currently would expect. Is there already something in Unigine that we could use to access the native OS's rendering context? Best regards Florian Link to comment
andrey-kozlov Posted June 25, 2019 Share Posted June 25, 2019 Hello, App::getGLContext returns HGLRC for Windows and GLXContext for Linux. So you can cast it back from void* and get appropriate handle. 1 Link to comment
Hofmann.Florian Posted June 26, 2019 Author Share Posted June 26, 2019 Hi, after a little deeper investigation the current problem actually isn't the OpenGLContext, but the QGuiApplication that is constructed in the backend. Whenever calling #include <UnigineEngine.h> #include <UnigineApp.h> #include "AppEditorLogic.h" #include "AppSystemLogic.h" #include "AppWorldLogic.h" #include <QApplication> #ifdef _WIN32 int wmain(int argc, wchar_t *argv[]) #else int main(int argc, char *argv[]) #endif { QApplication app(argc, argv); the QApplication Constructor like in the example above. It terminates with an SEGFAULT and the coredump points to: QXcbConnection::QXcbConnection(QXcbNativeInterface*, bool, unsigned int, char const*) () from /home/user/projects/Unigine/IG_Test2/bin/libQt5XcbQpa.so.5 with no further information. Do you maybe know a solution or a cause for this behaviour? Thanks a lot! Link to comment
morbid Posted June 26, 2019 Share Posted June 26, 2019 Hello Florian, I suggest checking Qt dependencies. Are you running the application with the exact libraries it was compiled with? Please, check and let us know if that was the issue. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts