octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63748] Qt graphics toolkit cannot create Open


From: anonymous
Subject: [Octave-bug-tracker] [bug #63748] Qt graphics toolkit cannot create OpenGL rendering context
Date: Sun, 5 Feb 2023 10:21:17 -0500 (EST)

Follow-up Comment #11, bug #63748 (project octave):

This function is related to context management, It may need a reveiw:
libgui/graphics/GLCanvas.cc

bool
GLCanvas::begin_rendering (void)
{
  bool retval = true;

  if (! isValid ())
    {
#  if defined (HAVE_QT_OFFSCREEN)
      static bool os_ctx_ok = true;
      if (os_ctx_ok && ! m_os_context.isValid ())
        {
          // Try to initialize offscreen context
          m_os_surface.create ();
          if (! m_os_context.create ())
            {
              os_ctx_ok = false;
              return false;
            }
        }

      retval = m_os_context.makeCurrent (&m_os_surface);
#  else
      retval = false;
#  endif
    }
  else
    makeCurrent ();

  return retval;
}


I don't know much about Qt but in a tutorial [1] it is pointed out that a
context should be created as:


    if (!m_context) {
        m_context = new QOpenGLContext(this);
        m_context->setFormat(requestedFormat());
        m_context->create();


Also using the static method


QOpenGLContext::currentContext()


may be useful to get the last context which called makeCurrent in the current
thread, or nullptr, if no context is current.


[1] https://doc.qt.io/qt-5/qtgui-openglwindow-example.html


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63748>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]