Jump to content
  • Advertisement
Sign in to follow this  
acraft

OpenGL OpenGL Initialization problem

This topic is 5104 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why the opengl window could not be created at out of the screen(desktop)? There is no problem if i use PFD_SUPPORT_GDI. But, PFD_SUPPORT_GDI and PFD_DOUBLEBUFFER flags are mutually exclusive in the current generic implementation. i would be glad if somebody help me. thanks acraft

Share this post


Link to post
Share on other sites
Advertisement
I don't know but it will be a problem becaouse GDI doesn't support double buffering so you will have fliker .
Be more specific with your initializing problem.

Share this post


Link to post
Share on other sites
i don't use PFD_SUPPORT_GDI. I mean there is no problem if i use PFD_SUPPORT_GDI.

here is my implementation

pixelDesc.dwFlags = PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL;

initialization does not work if you create window at out of the screen. I see only a black window.

Share this post


Link to post
Share on other sites
PFD_TYPE_RGBA i would add if you don't use indexed palletes but this is not it.
After creating the window did you queried ShowWindow(HWND,SW_SHOW)
Post some CODE more precisly the PIXELFORMATDESCRIPTOR initialization

you used PFD_MAIN_PLANE(main drawing layer i hope)

*Try to find the error by putting MessageBox all over to see where the initialization fails (which is the last message you see) or follow the values of HWND or HDC,HGLRC if not NULL

Share this post


Link to post
Share on other sites
all the critic stuation has being checked and work well except at out of screen.

everything is working with using PFD_SUPPORT_GDI or PFD_DOUBLEBUFFER.

at out of the screen, only PFD_SUPPORT_GDI works, PFD_DOUBLEBUFFER not..

here is my pixdesc implemantation

PIXELFORMATDESCRIPTOR pixelDesc;

pixelDesc.nSize = sizeof(PIXELFORMATDESCRIPTOR);
pixelDesc.nVersion = 1;
pixelDesc.dwFlags = PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL;
pixelDesc.iPixelType = PFD_TYPE_RGBA;
pixelDesc.cColorBits = 32;
pixelDesc.cRedBits = 0;
pixelDesc.cRedShift = 0;
pixelDesc.cGreenBits = 0;
pixelDesc.cGreenShift = 0;
pixelDesc.cBlueBits = 0;
pixelDesc.cBlueShift = 0;
pixelDesc.cAlphaBits = 0;
pixelDesc.cAlphaShift = 0;
pixelDesc.cAccumBits = 0;
pixelDesc.cAccumRedBits = 0;
pixelDesc.cAccumGreenBits = 0;
pixelDesc.cAccumBlueBits = 0;
pixelDesc.cAccumAlphaBits = 0;
pixelDesc.cDepthBits = 16;
pixelDesc.cStencilBits = 0;
pixelDesc.cAuxBuffers = 0;
pixelDesc.iLayerType = PFD_MAIN_PLANE;
pixelDesc.bReserved = 0;
pixelDesc.dwLayerMask = 0;
pixelDesc.dwVisibleMask = 0;
pixelDesc.dwDamageMask = 0;

int m_GLPixelIndex;

if ( (m_GLPixelIndex = ChoosePixelFormat( hDC, &pixelDesc )) == 0 ) // Let's choose a default index.
{ m_GLPixelIndex = 1;
if ( DescribePixelFormat( hDC, m_GLPixelIndex, sizeof(PIXELFORMATDESCRIPTOR), &pixelDesc) == 0 )
{ return FALSE;
}
}

if ( SetPixelFormat(hDC, m_GLPixelIndex, &pixelDesc) == FALSE )
{ return FALSE;
}

return TRUE;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!