cocos2d-x pix
const int w = 100;
const int h = 100;
const int size = w * h * 4;
unsigned char data[size] = { 0 };
for (int i = 0; i < size; i += 4)
{
data[i] = 255;//r
data[i + 1] = 0;//g
data[i + 2] = 0;//b
data[i + 3] = 80;//a
}
auto texture = new (std::nothrow) Texture2D();
texture->initWithData(data, size, Texture2D::PixelFormat::RGBA8888, w, h, Size(100, 100));