-1

I searched along the documentation and found nothing, then after searching on google i found this glReadPixels and i guess i may be able to take screenshots.

I need to create a facebookdialog with an image so im using this lines:

static s3eFBRequest* req = s3eFBRequest_WithGraphPath(MultiLoginScene::getSession(), "me/photos", "POST");
s3eFBRequest_AddParamString(req, "picture", XXX);

XXX is a const char* that would be this screenshot I need to take and then i will just send the request.

How can I do that?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user3481379
  • 11
  • 1
  • 6

2 Answers2

1

Marmalade website is gone. Unfortunate the answer wasn't posted here, but briefly:

int w = s3eSurfaceGetInt(S3E_SURFACE_WIDTH);
int h = s3eSurfaceGetInt(S3E_SURFACE_HEIGHT);

int dataSize = w * h * 3;
unsigned char *framebuffer = (unsigned char *) malloc(dataSize * sizeof(unsigned char));
glReadPixels(0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, framebuffer);
flipVertical(framebuffer, w, h);

CIwImage image;
image.SetFormat(CIwImage::BGR_888);
image.SetWidth(w);
image.SetHeight(h);
image.SetBuffers(framebuffer, dataSize);
image.SavePng(filename);

free(framebuffer);
Mark
  • 11
  • 1
0

You have to search on marmalade site for these kinda feature first. There's already a very nice written answer here.

PS: Please stop posting multiple questions asking same thing.

0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184