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: glDrawPixels mirror

  1. #1
    Guest

    glDrawPixels mirror

    I have a pretty straight forward rendering function that uses glDrawPixels. Problem is that the image is mirrored horizontally.
    Code :
    glDrawPixels(256, 256, GL_LUMINANCE, GL_UNSIGNED_BYTE, static_cast<const GLvoid*>(m_Data)); 
    // where m_Data is a pointer to the pixels that are unsigned BYTE's from 0-255
    TIA

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    601

    Re: glDrawPixels mirror

    My only thought is that you are using data assuming that the origin is at top left whereas in OpenGL origin is at bottom left. You will need to adjust how you populate your array.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2002
    Location
    kremnica, slovakia, europe, earth, sol :-)
    Posts
    102

    Re: glDrawPixels mirror

    or you can use glPixelZoom(1,-1)

    EDIT: errmm.. horiznally? glPixelZoom(-1,1) could be a solution but i don't have an idea what kind of mistake could result in horiznotally mirrored image. it must be something with your array (e.g. at time of loading you are filling it from last element to first). try to fix it, then you can try glPixelZoom(-1,1))

Posting Permissions

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