Results 1 to 2 of 2

Thread: Using glReadPixels and glDrawPixels

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2009
    Posts
    1

    Using glReadPixels and glDrawPixels

    Hi all, I'm new to OpenGL and learning fast

    I have a section on my screen that take allot of CPU to create.
    I would like to just calculate the drawing once and just reuse it.
    If i have to recalculate the drawing every time I render, it can max out the cpu.

    I've been looking into glReadPixel and glDrawPixel.
    I would like to grab a rectangle off the screen after the screen is drawn and just glDrawPixel it any time I want to render new objects on top of it.

    However I'm having no success and have not been able to find any examples on Google. any help is appreciated.

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Using glReadPixels and glDrawPixels

    Instead of glRead/draw pixels Youre better off creating a texture the same size as u want
    and then using
    glCopyTexSubImage2d(...) to copy from the screen into the texture + then drawing the texture to the screen subsequently.

    The reason being is drawing textures is faster/less CPU intensive than drawing pixels

Similar Threads

  1. glReadPixels, glDrawPixels
    By dabeav in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 08-30-2002, 08:07 AM
  2. glReadPixels and glDrawPixels
    By Rajiv Mishra in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-02-2001, 11:05 PM
  3. glReadPixels and glDrawPixels
    By glbeginner in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 01-29-2001, 06:22 AM
  4. glDrawPixels & glReadPixels
    By rIO in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-11-2000, 03:32 AM
  5. glReadPixels/glDrawPixels
    By weber_ofir in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 08-28-2000, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean