Quote Originally Posted by ART_Adventures View Post
It seems a blank surface can be created as follows (If I'm wrong, please tell me)...

Code:
Pixels = new CL_PixelBuffer(512, 512, 1024, CL_PixelFormat::rgba8888);
m_Surface = new CL_Surface(*Pixels);
Given that in the real apps, a pixel buffer could be any size and may have any number of differently sized images draw onto it, does anybody know to what value I should set pitch?
That's right, except In your example code, you're setting the pitch incorrectly. You probably want to set this to 512*4; the exact space a row of pixels will take on the X axis. (CL_PixelFormat::rgba8888()->get_depth()/8) will show the size to be 4 bytes, ie, 32 bits per pixel)

Example:

Code:
int sizeX = 512;
int sizeY = 512;
Pixels = new CL_PixelBuffer(sizeX, sizeY, sizeX*4, CL_PixelFormat::rgba8888, NULL);
Now, this is just sitting in system memory for you to tweak or do whatever to. (you have access to the pure data if you want)

When you do "m_Surface = new CL_Surface(*Pixels);" it creates a surface on the video card for optimized drawing speed (it copies the pixel buffer over to the card), the original pixel buffer isn't used again in this case.