Question

I will be grateful for advice, how to update this code from cocos2dx 2.2.1 to 3.0:

ccTexParams tp = {GL_LINEAR, GL_LINEAR,GL_REPEAT , GL_REPEAT};
sprite->getTexture()->setTexParameters(&tp);

Now I got an error that ccTexParams is unknown type.

Was it helpful?

Solution

Remove the cc. It is just TexParams now. They moved the TexParams typedef inside the Texture2D class in Cocos2D-X 3.0 so you will need to change your code like so:

Texture2D::TexParams tp = {GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT};

Cocos2D-X 3.0 has pretty much removed the CC prefix from their naming conventions. You can check out the documentation at http://www.cocos2d-x.org/reference/native-cpp/V3.0beta2/d4/d2c/struct_tex_params.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top