Results 1 to 2 of 2

Thread: glTexSubImage2D with pitch/stride

  1. #1
    Junior Member
    Join Date
    Mar 2010

    glTexSubImage2D with pitch/stride


    I'm working on an application where it's necessary to update sub rectangles of a big master texture. I basically have a software generated image buffer of say 1024x512 where I need to update say 128x64 subrects every now and then.

    in OpenGL I can use this code:

    char *data = + (x + y * image.width) * 4;
    glPixelStorei(GL_UNPACK_ROW_LENGTH, image.width);
    glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, data);

    How do I go about doing this in ES efficiently?

    All I can think of is to either copy the new data to a temporary buffer and update, or to update it line by line. Neither of these seems very efficient. Is there a better way?


  2. #2
    Junior Member
    Join Date
    Mar 2011

    Re: glTexSubImage2D with pitch/stride

    Yeah, I wonder how this can be done.

    I'm currently updating the whole rows which is better than updating the whole texture but I really would like to have something like the GL_UNPACK_ROW_LENGTH to just update the rect I want.

    If anybody knows for a solution it would be great to share it here

Similar Threads

  1. Speeding up glTexSubImage2D?
    By openglesuser in forum OpenGL ES
    Replies: 6
    Last Post: 01-05-2009, 08:08 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