Results 1 to 4 of 4

Thread: how to copy a portion of raw image into portion of opengl image

  1. #1

    how to copy a portion of raw image into portion of opengl image

    hi, i have this problem with opengl, i have a raw 32 bit image data and a opengl image object, now i want to copy portions of raw data image into opengl image like this:


    if you cannot see the image click here

    i setup the skip_rows and skip_pixels but none of these seem to do
    anything what the opengl documents say, here is my code:

    glBindTexture(gl_texture_2d, car_tex);

    glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
    glPixelStorei(GL_PACK_SKIP_PIXELS, 10);
    glPixelStorei(GL_PACK_ROW_LENGTH, 64);

    glTexSubImage2D(gl_texture_2d, 0, deltarects[car_clear].rect.Left,
    deltarects[car_clear].rect.Top, deltarects[car_clear].rect.Right -
    deltarects[car_clear].rect.left, deltarects[car_clear].rect.bottom -
    deltarects[car_clear].rect.top, GL_bgra_ext, GL_UNSIGNED_BYTE,
    pointer(integer(ms.memory) + integer(deltarects[car_clear].dataptr)));

    the data passed to glTexSubImage2D is correct, so there is no
    problem with data, can someone please explain how to tell me how to do this properly in opengl?

  2. #2

    Re: how to copy a portion of raw image into portion of opengl image

    okay, this problem then remains impossible to solve.

  3. #3
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: how to copy a portion of raw image into portion of opengl image

    And what about describing your actual problem ?

  4. #4

    Re: how to copy a portion of raw image into portion of opengl image

    i did, i have a image that is data and a opengl image, now i want to read a subimage of data into subimage of opengl data, i read the books and they say to set GL_UNPACK_ALIGNMENT, GL_PACK_SKIP_PIXELS and GL_PACK_ROW_LENGTH, i did but opengl won't budge.

Similar Threads

  1. copy 2d image to the OpenCL 3D image object
    By sajis997 in forum OpenCL
    Replies: 0
    Last Post: 06-02-2013, 06:13 PM
  2. To cutoff portion from a object
    By deepa in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 10-10-2004, 10:15 PM
  3. how to clear portion of screen
    By rohit in forum OpenGL: Windows
    Replies: 1
    Last Post: 09-17-2004, 05:21 AM
  4. GL not rendering to a portion of the viewport
    By harishc in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 10-20-2000, 09:07 PM
  5. Not touching a portion of the screen.
    By Divide Overflow in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-14-2000, 05:22 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