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: Image Blitting

  1. #1

    Image Blitting

    What I would like to do is take a simple array of RGB values (eg. "unsigned char image[xsize * ysize * 3];")
    and be able to copy it directly on the screen.

    Is there a simple way of doing this? I tried doing so using glDrawPixels but to no avail - I don't quite understand what format the data needs to be in.

    Thanks in advance

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    839

    Re: Image Blitting

    glDrawpixels will work with your data.

    (the type is GL_UNSIGNED_BYTE and your format is GL_RGB).

    cheers,
    John

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    668

    Re: Image Blitting

    GLUbyte *data;

    /* data = malloc..... */

    glDrawPixels(......, data);

Posting Permissions

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