Results 1 to 2 of 2

Thread: Prgram crashes with nvoglnt.dll

  1. #1
    Member Contributor
    Join Date
    Feb 2004
    Location
    Gainesville, Florida
    Posts
    51

    Prgram crashes with nvoglnt.dll

    Hey guys,

    I'm trying out ogl with vc++ 6.0 and i'm reating a MFC application with multiple viewports. Everything seemed to work properly until i worked on with picking. Thr program crashes with saying abt invalid reference in memory. I debugged my code and I couldnt really find out where it crashes because it crashes at different places at different times and it refered to nvoglnt.dll. It sometimes crashes when redrawing the model. I keep the models in a linked list and everytime i draw the scene, i just draw the models one by one in the list. And it crashes at glVetex3f() or sometimes at glLoadMatrix().

    Can anyone tell me what I can do fix this problem?

    The thing i noticed is that, without the selection routines the code works well. But I dont see any fault in the routines.

    Below I'm pasting the main portions of selection that I'm doing...I've taken it from http://www.lighthouse3d.com/opengl/picking/

    BOOL COpenGLView::StartPicking(CPoint CurrentPoint)
    {
    GLint Viewport[4] ;

    ::glSelectBuffer(m_PickBufferSize , m_pPickBuffer) ;
    ::glGetIntegerv(GL_VIEWPORT , Viewport) ;

    ::glRenderMode(GL_SELECT) ;
    ::glMatrixMode(GL_PROJECTION) ;
    ::glPushMatrix() ;
    ::glLoadIdentity() ;

    ::gluPickMatrix(CurrentPoint.x , Viewport[3] - CurrentPoint.y , 5 , 5 , Viewport) ;
    ::gluPerspective(45.0f , ((Viewport[2] + 0.0) / Viewport[3]) , 0.1f , 1000.0f) ;
    ::glMatrixMode(GL_MODELVIEW) ;
    ::glInitNames() ;

    return TRUE ;
    }

    BOOL COpenGLView::StopPicking()
    {
    ::glMatrixMode(GL_PROJECTION) ;
    ::glPopMatrix() ;
    ::glMatrixMode(GL_MODELVIEW) ;
    ::glFlush() ;

    m_nHits =::glRenderMode(GL_RENDER) ;
    if(-1 != m_nHits)
    Proces****s(m_nHits , m_pPickBuffer) ;

    // if(0 == m_nHits || -1 == m_nHits)
    // GetDocument()->m_pCurrentObjModel = NULL ;

    m_iMode = RENDER_MODE ;
    m_nHits = -1 ;
    m_pPickBuffer = NULL ;

    return TRUE ;
    }


    void CPerspective::OnDraw(CDC* pDC)
    {
    CDocument* pDoc = GetDocument();
    // TODO: add draw code here

    MakeCurrentRC() ;
    ::glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ;

    ::glLoadIdentity() ;

    ::glTranslatef(0.0f , 0.0f , 1.0f) ;
    ::glRotatef(-10 , 1.0f , 0.0f , 0.0f) ;

    //The whole scene is gonna get effected in the steps below.
    ::glPushMatrix() ;

    ::glTranslatef(m_xPos , -m_yPos , -m_Zoom) ;

    ::glPushMatrix() ;
    ::glDisable(GL_LIGHTING) ;
    ::glMultMatrixf(Transform.M) ;
    DrawGrid(m_lGridListIndex) ;
    ::glEnable(GL_LIGHTING) ;
    ::glPopMatrix() ;

    ::glPushMatrix() ;
    ::glMultMatrixf(Transform.M) ;
    ::glTranslatef(0.0f , 1.0f , 0.0f) ;

    if(m_iMode == SELECT_MODE)
    {
    CPoint aPoint = GetCurrentCursorPos() ;
    StartPicking(aPoint) ;
    }

    RenderScene() ;

    ::glPopMatrix() ;



    ::glPopMatrix() ;

    // ::glFinish() ;
    if(m_iMode == SELECT_MODE)
    StopPicking() ;
    else
    SwapBuffers() ;
    }

    And the mode for selection is set when is depress the Left mouse button down and the rendering mode is set when the mouse button is released.

    Hope you guys can help me out.

  2. #2
    Guest

    Re: Prgram crashes with nvoglnt.dll

    does lighthouse demo work for you?

Similar Threads

  1. my prgram isn't drawing anything
    By Zedidiah in forum OpenGL: User Software
    Replies: 0
    Last Post: 01-24-2015, 10:58 PM
  2. glut, nvoglnt
    By Muhson in forum OpenGL: General
    Replies: 2
    Last Post: 12-12-2003, 10:06 PM
  3. help .net nvoglnt
    By Muhson in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 12-10-2003, 08:50 PM
  4. nvoglnt.dll errors with gf3
    By in forum OpenGL: User Software
    Replies: 1
    Last Post: 05-06-2003, 04:01 PM
  5. nvoglnt.dll error
    By surfer02 in forum OpenGL: User Software
    Replies: 0
    Last Post: 09-22-2002, 12:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean