make sure attributes greater than 8 before use normal map

This commit is contained in:
yangxiao 2015-12-02 12:03:31 +08:00
parent ebd5c1cca7
commit bb23015f73
1 changed files with 4 additions and 0 deletions

View File

@ -2529,6 +2529,10 @@ Sprite3DNormalMappingTest::Sprite3DNormalMappingTest()
addChild(sprite); addChild(sprite);
} }
int maxAttributes;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttributes);
CCASSERT(maxAttributes > 8, "attributes supported must be greater than 8");
if (maxAttributes > 8)
{ {
auto sprite = Sprite3D::create("Sprite3DTest/sphere_bumped.c3b"); auto sprite = Sprite3D::create("Sprite3DTest/sphere_bumped.c3b");
sprite->setPosition(Vec2(30, 0)); sprite->setPosition(Vec2(30, 0));