Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8805961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:59:50+00:00 2026-06-14T01:59:50+00:00

openGL with maya I made a openGL View with QGLWidget. It has a problem

  • 0

openGL with maya

I made a openGL View with QGLWidget. It has a problem when work with Maya. As you see in video, when I click and move on a modelPanel within Maya, the QGLWidget get broken. And I found that the marquee rectangle is shown on my QGLWidget, not Maya. Why this problem happend?

To datenwolf

I tried to edit my code as you suggested. But… it doesn’t call makeCurrent() and doneCurrent() at all. I expected that when I clicked on my maya modelPanel it could send me the message, but it didn’t. What did I miss? Sorry for that.

def makeCurrent(self):
    import OpenGL.WGL as wgl
    print "MAKE CURRENT!!!"
    self.prevHDC = wgl.wglGetCurrentDC()
    self.prevHRC = wgl.wglGetCurretnContext()
    super(GLWidget, self).makeCurrent()
        
def doneCurrent(self):
    import OpenGL.WGL as wgl
    print "DONE CURRENT!!!"
    super(GLWidget, self).doneCurrent()
    wgl.wglMakeCurrent(self.prevHDC, self.prevHRC)

I wrote just like above. But it never even show the "MESSAGE".

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:59:51+00:00Added an answer on June 14, 2026 at 1:59 am

    Most likely Qt and Maya’s event loop are battling for processing event. Qt’s paintGL does the right thing and makes the OpenGL context current whenever it is called. Maya however does not and so drawing commands of Maya end up in your OpenGL context.

    Playing along with Maya is going to be tricky, because it requires storing which OpenGL/DC context was active before switching and restoring that once finished with one own’s operations. You’ll probably have to subclass QGLWidget and QGLContext to do this.

    Update due to comment

    Derive from QGLWidget, add two members HDC m_prevHDC and HRC m_prevHRC, override makeCurrent and doneCurrent

    void QMyGLWidget::makeCurrent()
    {
        this->m_prevHDC = wglGetCurrentDC();
        this->m_prevHRC = wglGetCurrentContext();
    
        QGLWidget::makeCurrent();
    }
    
    void QMyGLWidget::doneCurrent()
    {
         QGLWidget::doneCurrent();
    
         wglMakeCurrent(this->m_prevHDC, this->m_prevHRC);
    }
    

    Then derive your actual GLWidget from this intermediary class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on parsing a Maya dae file onto OpenGL ES on the
Android opengl-es view question. So in openGL, the default position of the camera and
Most OpenGL ES tutorials for Android I've followed has its onSurfaceChanged() function like this:
OpenGL 3 Render points: The points are stored within a space partition tree. The
Using OpenGL ES 2.0 on iOS 4 . I have an OpenGL view that
In OpenGL I simply call glColor3f and then draw the texture to get it
In my simple OpenGL program I get the following error about exit redefinition: 1>c:\program
OpenGL has functions such as BufferData(int array[]) where array must be of the format
With OpenGL 4.0, shader tessellation support has been added. What is the difference between
The OpenGL ES 2.0 rendering context I get for my Android app is in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.