J'y arrive PAS! Voilà ce que je fais et ça passe pas en plein écran:
void InitGL(HDC* dc, HGLRC* rc, HWND hGlWnd)
{
PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
32,
0, 0, 0, 0, 0, 0,
0, 0,
0, 0, 0, 0, 0,
32,
0,
0,
0,
0,
0,
0,
0
};
int PixelFormat;
DEVMODE devmode;
ZeroMemory(&devmode,sizeof(DEVMODE));
devmode.dmSize=sizeof(DEVMODE);
devmode.dmBitsPerPel=32;
devmode.dmPaperWidth=640;
devmode.dmPelsHeight=480;
devmode.dmFields=DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
if(ChangeDisplaySettings(&devmode,CDS_FULLSCREEN)
!=DISP_CHANGE_SUCCESSFUL)
MessageBox(hGlWnd,"Impossible de Passer en FullScreen","Erreur",MB_OK);
*dc=GetDC(hGlWnd);
PixelFormat = ChoosePixelFormat(*dc, &pfd);
if(!PixelFormat)
{
MessageBox( hGlWnd,
"Mode Graphique Non supporté",
"Problème",
MB_ICONERROR | MB_OK );
exit(1);
}
if(!SetPixelFormat(*dc, PixelFormat,&pfd))
{
MessageBox( hGlWnd,
"Mode graphique Non supporté",
"Problème",
MB_ICONERROR | MB_OK );
exit(1);
}
*rc=wglCreateContext(*dc);
wglMakeCurrent(*dc, *rc);
glClearColor(.5,.5,.5,0);
glEnable(GL_TEXTURE_2D);
glEnable(GL_DEPTH_TEST);
}