Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Trouble with glDrawPiexls

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2004
    Posts
    16

    Trouble with glDrawPiexls

    I learn to use glDrawPiexls to draw a bitmap on a top main window, and it works well.
    But when I use the same code on a ChildView of a main window, It doesn't work, so I wonder why? Can "glDrawPiexls" be used on a child window?

    The calling is simple as below:
    glRasterPos2i(0, 0);
    glPixelZoom(1.0f, -1.0f);
    glDrawPixels(640, 480, GL_RGBA, GL_UNSIGNED_BYTE, m_pImageData);

    And the pixel format as:
    PIXELFORMATDESCRIPTOR pfd =
    {
    sizeof(PIXELFORMATDESCRIPTOR),
    1,
    PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
    PFD_TYPE_RGBA,
    16,
    0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0,
    16,
    0,
    0,
    PFD_MAIN_PLANE,
    0,
    0, 0, 0,
    };

    My env is Windows2000, Vs.net7.1,opengl1.0

    And if anyboady have a sample code which show the usage of glDrawPixels on a child window, please let me know.
    Thanks advanced.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: Trouble with glDrawPiexls

    Hi !

    make sure you have switched the OpenGl context to the child window (wglMakeCurrent...)

    Mikael

  3. #3
    Guest

    Re: Trouble with glDrawPiexls

    Of course I do.
    I am sure to create the opengl context on the childview, And other opengl render functions work well on this childview except the DAMN glDrawPixels.
    You can try it yourself, The test is simple,just show me a working glDrawPixels on a child window.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •