Add programmatic render API and a basic test.

This commit is contained in:
yunfeibai
2016-10-20 10:56:44 -07:00
parent ad07b3cf13
commit 6ef96a4027
9 changed files with 110 additions and 6 deletions

View File

@@ -57,9 +57,12 @@ void Model::setDiffuseTextureFromData(unsigned char* textureImage,int textureWid
for (int j=0;j<textureHeight;j++)
{
TGAColor color;
color.bgra[0] = textureImage[(i+j*textureWidth)*3+0];
color.bgra[1] = textureImage[(i+j*textureWidth)*3+1];
color.bgra[2] = textureImage[(i+j*textureWidth)*3+2];
//color.bgra[0] = textureImage[(i+j*textureWidth)*3+0];
//color.bgra[1] = textureImage[(i+j*textureWidth)*3+1];
//color.bgra[2] = textureImage[(i+j*textureWidth)*3+2];
color.bgra[0] = textureImage[0];
color.bgra[1] = textureImage[1];
color.bgra[2] = textureImage[2];
color.bgra[3] = 255;
color.bytespp = 3;