Hi all,
Well there definitely seems to problem with OpenGL component, when using generic microsoft drivers . Problem is regenerating the bug is difficult.
You got to iterate through all pixel formats using DescribePixelFormat and choose a PixelFormat that has PFD_GENERIC_FORMAT flag set.
Now when using this pixel format you create a juce OpenGL component , it appears hollow and does not repaint.
Lots of my customers seem to have old drivers by Microsoft and are reluctant to upgrade to the latest drivers.
I am attaching a patched version of juce and juce-Demo. Changes made only to the juce_Win32_Windowing.cpp.
I would be obliged if someone would look into the code and give me pointers as to what could fix the problem.
Changes made are
[code]int totalformats = DescribePixelFormat(oc->dc,1,sizeof(PIXELFORMATDESCRIPTOR),&pfd);
int selectedFormat = -1;
while(totalformats > 0)
{
if((pfd.dwFlags & PFD_DRAW_TO_WINDOW) &&
(pfd.dwFlags & PFD_SUPPORT_OPENGL)&&
(pfd.dwFlags & PFD_DOUBLEBUFFER)&&
(pfd.dwFlags & PFD_GENERIC_FORMAT)&& // Make sure it is Microsoft Generic Driver
(pfd.iPixelType == PFD_TYPE_RGBA) &&
(pfd.cColorBits == 32) &&
(pfd.cDepthBits == 16)
)
{
selectedFormat = totalformats;
break; //We got our format ,so break.
}
DescribePixelFormat(oc->dc,totalformats,sizeof(PIXELFORMATDESCRIPTOR),&pfd);
–totalformats;
}
jassert(selectedFormat != -1) //oops! no matching format
//Finally Dont use "ChoosePixelFormat" instead use our format selected above.
SetPixelFormat (oc->dc, /*ChoosePixelFormat (oc->dc, &pfd)*/ selectedFormat, &pfd);[/code]
Link : http://www.sharebigfile.com/file/116643/juce-with-ogl-problem-zip.html
Many Thanks,
Yogesh Kini