Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: compatibility problem on vista and seven

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2010
    Posts
    127

    compatibility problem on vista and seven

    hello.
    I have some problems with the distribution of a project that uses opengl.
    The project is an mfc program.
    I use opengl with immediate mode and on vista and seven on some machines see some incompatibility , like the position of the opengl model inside an mfc window for example.
    How i can test and find the compatibility problems of opengl ?
    I have these problem only on vista and seven.

    I use opengl 2 an include these libs :

    opengl32.lib
    glu32.lib
    glaux.lib

    and include some of these files :

    #include "gl\gl.h"
    #include "gl\glu.h"
    #include "gl\glaux.h"

    thanks.

  2. #2
    Senior Member OpenGL Lord
    Join Date
    May 2009
    Posts
    6,008

    Re: compatibility problem on vista and seven

    Could you clarify what problem you're actually having? Can you explain it in greater detail?

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2010
    Posts
    127

    Re: compatibility problem on vista and seven

    Thanks alfonse
    I have an opengl instance in a mfc mdi child window in my company project.
    In almost all customer wit almost all operating system and opengl driver all work fine , but in some win 7 64 bit, if i have a model in child window, the model is moved to the left bottom corner of the child window and scaled.
    Is like if the camera changes it's parameters, but i don't understand why.
    thanks

  4. #4
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,161

    Re: compatibility problem on vista and seven

    what happens if you maximimise the child mdi window?

  5. #5
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,256

    Re: compatibility problem on vista and seven

    The operating system doesn't matter. GL is implemented at the graphics driver level. You might want to update your graphics card drivers. If it is Intel, it is highly likely to be buggy (They have a reputation for their lousy GL drivers).

    Those lib files and headers files you mentions do not matter either.

    How i can test and find the compatibility problems of opengl ?
    You buy the video card. Install it. Run your program and watch or perhaps you write a program that analyzes the output. Of course, there are a lot of video cards and a lot of OSes and drivers version to test.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  6. #6
    Junior Member Regular Contributor
    Join Date
    Apr 2010
    Posts
    127

    Re: compatibility problem on vista and seven

    Quote Originally Posted by BionicBytes
    what happens if you maximimise the child mdi window?
    thanks BionicBytes , if maximize the child mdi window the model and the visualization return correct.
    thanks.
    What can be?

  7. #7
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,161

    Re: compatibility problem on vista and seven

    Can you not ensure the child window remains maximised?
    Otherwise you will have to compensate for the fact that windows is altering the transformation to NDC space based on the size if the child window.

  8. #8
    Junior Member Regular Contributor
    Join Date
    Apr 2010
    Posts
    127

    Re: compatibility problem on vista and seven

    thanks to all.
    i think that my problem is in this function:
    Code :
    void CGLView::OnSize(UINT nType, int cx, int cy) 
    {
    	CView::OnSize(nType, cx, cy);
     
    	// TODO: Add your message handler code here
     
    	//uncomment
    	//cx=130;
    	//cy=130;
     
    	if ( 0 >= cx || 0 >= cy )
            {
            return;
            }
     
    	// save the width and height of the current window
    	m_WindowWidth = cx;
    	m_WindowHeight = cy;
     
        // compute the aspect ratio
        // this will keep all dimension scales equal
        m_AspectRatio = (GLdouble)m_WindowWidth/(GLdouble)m_WindowHeight;
     
    }
    i see that in the inizialization i get values from 20 to 30 for(cx and cy)before the correct values , that are the values of the size of the window,and i think that is wrong, if i start or pass in the maximized mode these values are always correct and the window size and his visualizing is correct.
    In the code i see that these values (cx and cy) are stored in m_WindowWidth and m_WindowHeight and used in all my opengl dialogs that use opengl.
    may be?

    thanks.

  9. #9
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,161

    Re: compatibility problem on vista and seven

    yep, you'll need to use a debugger to see what's going on here.
    You need to be certain of the window sizes and which variable is holding the size of the child windows before calling the function which sets the GL context window size.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •