PDA

View Full Version : how can i upload a sub rect of pbo to a texture?



wellbye
07-25-2011, 05:54 PM
hi,all
i just want to upload from pbo within a sub rect instead of all,
but the glCompressedTexSubImage2D has only 4 parameters for dest rect,
are there any other api for setting the source rect?
thanks a lot~

Alfonse Reinheart
07-25-2011, 06:30 PM
but the glCompressedTexSubImage2D has only 4 parameters for dest rect,

You have the X, Y in the texture. And you have the width/height of the rectangle you're uploading. What more parameters do you need?

wellbye
07-25-2011, 11:35 PM
hello alfonse,
the X,Y,W,H all apply to the dest texture, and it will upload the whole source texture(data),
i want to specify the rect in the source texture, inspite of whether it's an raw data or a pbo.
is it possible?