PDA

View Full Version : compatibility problem on vista and seven



giuseppe500
11-02-2011, 04:59 AM
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.

Alfonse Reinheart
11-02-2011, 11:57 AM
Could you clarify what problem you're actually having? Can you explain it in greater detail?

giuseppe500
11-03-2011, 03:40 AM
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

BionicBytes
11-03-2011, 08:51 AM
what happens if you maximimise the child mdi window?

V-man
11-03-2011, 04:51 PM
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.

giuseppe500
11-08-2011, 09:20 AM
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?

BionicBytes
11-09-2011, 03:17 AM
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.

giuseppe500
11-16-2011, 04:50 AM
thanks to all.
i think that my problem is in this function:


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.

BionicBytes
11-17-2011, 11:01 AM
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.