actually the code s big... i have used many classes.... this is the part where i have used wglMakeCurrent
void COpenGL::Init(HDC the_device_context)
{
// Initialise OpenGL
// Get a DC for the OpenGL render window
m_hDC = the_device_context;
// Set the pixel format for this DC
static PIXELFORMATDESCRIPTOR pfd =
{
sizeof (PIXELFORMATDESCRIPTOR), // strcut size
1, // Version number
PFD_DRAW_TO_WINDOW | // Flags, draw to a window,
PFD_SUPPORT_OPENGL | // use OpenGL
PFD_DOUBLEBUFFER, // double buffered
PFD_TYPE_RGBA, // RGBA pixel values
32, // 32-bit color
0, 0, 0, // RGB bits & shift sizes.
0, 0, 0, // Don't care about them
0, 0, // No alpha buffer info
0, 0, 0, 0, 0, // No accumulation buffer
32, // 32-bit depth buffer
0, // No stencil buffer
0, // No auxiliary buffers
PFD_MAIN_PLANE, // Layer type
0, // Reserved (must be 0)
0, // No layer mask
0, // No visible mask
0 // No damage mask
};
int nMyPixelFormatID = ChoosePixelFormat( m_hDC, &pfd );
SetPixelFormat( m_hDC, nMyPixelFormatID, &pfd );
// get a render context for OpenGL
m_hRC = wglCreateContext(m_hDC);
wglMakeCurrent (m_hDC, m_hRC);
}
this is the initialization of my opengl class........ whatelse is required please let me know....
sidv1210
Member Since 11 May 2012Offline Last Active Jun 13 2012 12:36 AM

Find content
Not Telling