• Advertisement

sidv1210

Member
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

106 Neutral

About sidv1210

  • Rank
    Newbie
  1. OpenGL OpenGL and MFC

    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....
  2. OpenGL OpenGL and MFC

    thank you for your help.... but i have already used wglMakeCurrent function.... m not facing any error... its just that i am not able to render opengl in my 2nd window....
  3. Hello, I have been trying to use opengl in a mfc dialog box. I accomplished the task in the first dialog box. But if I open another dialog box from my main dialog box, I'm not able to use opengl in it. I have used the same method for opengl in the 2nd dialog box also, but it is not displaying anything. Could anyone please help me with it. Thank you
  4. Hello, I have been trying to use opengl in a mfc dialog box. I accomplished the task in the first dialog box. But if I open another dialog box from my main dialog box, I'm not able to use opengl in it. I have used the same method for opengl in the 2nd dialog box also, but it is not displaying anything. Could anyone please help me with it. Thank you
  • Advertisement