Hello le peuple,
J'ai fait une petite horloge en openGL et j'aimerais pouvoir la mettre à la place de l'arrière plan. Je pense qu'il faut que je lie mon HDC avec le celui du bureau mais je sais pas comment faire.
Pour le moment mon application s'affiche dans une fenêtre. Voilà la partie du code, qui à mon avis doit être modifié. Pourriez vous me dire comment ??
void EnableOpenGL (HWND hWnd, HDC *hDC, HGLRC *hRC){
PIXELFORMATDESCRIPTOR pfd;
int iFormat;
/* get the device context (DC) */
*hDC = GetDC (hWnd);
/* set the pixel format for the DC */
ZeroMemory (&pfd, sizeof (pfd));
pfd.nSize = sizeof (pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
pfd.cDepthBits = 16;
pfd.iLayerType = PFD_MAIN_PLANE;
iFormat = ChoosePixelFormat (*hDC, &pfd);
SetPixelFormat (*hDC, iFormat, &pfd);
/* create and enable the render context (RC) */
*hRC = wglCreateContext( *hDC );
wglMakeCurrent( *hDC, *hRC );
// Initialisation d'OpenGL
glClearColor(0.0,0.0,0.0,0.0);
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing (important)
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glEnable(GL_COLOR_MATERIAL);
ReSizeGLScene(wx,wy);
}