Hi, i’m trying to create a fragment shader and apply it to a sprite but the problem is this code that converts a file path to frag shader to a programState that i can apply to a Node
backend::ProgramState* CreateProgramStateFromFragment(const std::string& fragmentShaderPath)
{
const auto fileUtils = cocos2d::FileUtils::getInstance();
const auto fragmentFullPath = fileUtils->fullPathForFilename(fragmentShaderPath);
const auto fragSource = fileUtils->getStringFromFile(fragmentFullPath);
const auto program = backend::Device::getInstance()->newProgram(cocos2d::positionTextureColor_vert, fragSource);
const auto programState = new (std::nothrow) backend::ProgramState(program);
// Program must be released if no longer used, since it is not auto-released
CC_SAFE_RELEASE(program);
return programState;
}
backend::Device doesn’t exist am i messing something?
Thanks for reading <3