cocos2d-x 获取纹理数据
作者:互联网
s = Sprite::create("res/GIRE.png");
s->setPosition(visibleSize / 2);
this->addChild(s);
auto id = s->getTexture()->getName();
//int format,width,height;
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height);
//glGetTexImage(GL_TEXTURE_2D, 0, format, GL_UNSIGNED_BYTE, void*);
//这是不现实的
标签:glGetTexLevelParameteriv,height,format,TEXTURE,纹理,2D,获取,cocos2d,GL 来源: https://www.cnblogs.com/YZFHKMS-X/p/14385862.html