mirror of https://github.com/axmolengine/axmol.git
fix #51
This commit is contained in:
parent
2d3e162e21
commit
f36d21c9bf
|
@ -288,7 +288,7 @@ LayerColor::LayerColor()
|
||||||
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
|
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
|
||||||
|
|
||||||
auto& pipelineDescriptor = _customCommand.getPipelineDescriptor();
|
auto& pipelineDescriptor = _customCommand.getPipelineDescriptor();
|
||||||
auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_COLOR);
|
auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_COLOR); // TODO: noMVP?
|
||||||
_programState = new (std::nothrow) backend::ProgramState(program);
|
_programState = new (std::nothrow) backend::ProgramState(program);
|
||||||
pipelineDescriptor.programState = _programState;
|
pipelineDescriptor.programState = _programState;
|
||||||
|
|
||||||
|
|
|
@ -414,7 +414,7 @@ bool BoneNode::init()
|
||||||
updateColor();
|
updateColor();
|
||||||
|
|
||||||
auto& pipelineDescriptor = _customCommand.getPipelineDescriptor();
|
auto& pipelineDescriptor = _customCommand.getPipelineDescriptor();
|
||||||
auto* program = cocos2d::backend::Program::getBuiltinProgram(cocos2d::backend::ProgramType::POSITION);
|
auto* program = cocos2d::backend::Program::getBuiltinProgram(cocos2d::backend::ProgramType::POSITION_COLOR); // TODO: noMVP?
|
||||||
_programState = new (std::nothrow) cocos2d::backend::ProgramState(program);
|
_programState = new (std::nothrow) cocos2d::backend::ProgramState(program);
|
||||||
pipelineDescriptor.programState = _programState;
|
pipelineDescriptor.programState = _programState;
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ bool SkeletonNode::init()
|
||||||
|
|
||||||
// init _customCommand
|
// init _customCommand
|
||||||
auto& pipelineDescriptor = _customCommand.getPipelineDescriptor();
|
auto& pipelineDescriptor = _customCommand.getPipelineDescriptor();
|
||||||
auto* program = cocos2d::backend::Program::getBuiltinProgram(cocos2d::backend::ProgramType::POSITION);
|
auto* program = cocos2d::backend::Program::getBuiltinProgram(cocos2d::backend::ProgramType::POSITION_COLOR); // TODO: noMVP?
|
||||||
_programState = new (std::nothrow) cocos2d::backend::ProgramState(program);
|
_programState = new (std::nothrow) cocos2d::backend::ProgramState(program);
|
||||||
pipelineDescriptor.programState = _programState;
|
pipelineDescriptor.programState = _programState;
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,6 @@ bool ProgramCache::init()
|
||||||
addProgram(ProgramType::POSITION_COLOR_LENGTH_TEXTURE);
|
addProgram(ProgramType::POSITION_COLOR_LENGTH_TEXTURE);
|
||||||
addProgram(ProgramType::POSITION_COLOR_TEXTURE_AS_POINTSIZE);
|
addProgram(ProgramType::POSITION_COLOR_TEXTURE_AS_POINTSIZE);
|
||||||
addProgram(ProgramType::POSITION_COLOR);
|
addProgram(ProgramType::POSITION_COLOR);
|
||||||
addProgram(ProgramType::POSITION);
|
|
||||||
addProgram(ProgramType::LAYER_RADIA_GRADIENT);
|
addProgram(ProgramType::LAYER_RADIA_GRADIENT);
|
||||||
addProgram(ProgramType::POSITION_TEXTURE);
|
addProgram(ProgramType::POSITION_TEXTURE);
|
||||||
addProgram(ProgramType::POSITION_TEXTURE_COLOR_ALPHA_TEST);
|
addProgram(ProgramType::POSITION_TEXTURE_COLOR_ALPHA_TEST);
|
||||||
|
@ -156,8 +155,6 @@ void ProgramCache::addProgram(ProgramType type)
|
||||||
case ProgramType::POSITION_COLOR:
|
case ProgramType::POSITION_COLOR:
|
||||||
program = backend::Device::getInstance()->newProgram(positionColor_vert, positionColor_frag);
|
program = backend::Device::getInstance()->newProgram(positionColor_vert, positionColor_frag);
|
||||||
break;
|
break;
|
||||||
case ProgramType::POSITION:
|
|
||||||
program = backend::Device::getInstance()->newProgram(position_vert, positionColor_frag);
|
|
||||||
break;
|
break;
|
||||||
case ProgramType::LAYER_RADIA_GRADIENT:
|
case ProgramType::LAYER_RADIA_GRADIENT:
|
||||||
program = backend::Device::getInstance()->newProgram(position_vert, layer_radialGradient_frag);
|
program = backend::Device::getInstance()->newProgram(position_vert, layer_radialGradient_frag);
|
||||||
|
|
|
@ -331,7 +331,6 @@ enum class ProgramType : size_t
|
||||||
POSITION_COLOR_LENGTH_TEXTURE, //positionColorLengthTexture_vert, positionColorLengthTexture_frag
|
POSITION_COLOR_LENGTH_TEXTURE, //positionColorLengthTexture_vert, positionColorLengthTexture_frag
|
||||||
POSITION_COLOR_TEXTURE_AS_POINTSIZE, //positionColorTextureAsPointsize_vert, positionColor_frag
|
POSITION_COLOR_TEXTURE_AS_POINTSIZE, //positionColorTextureAsPointsize_vert, positionColor_frag
|
||||||
POSITION_COLOR, //positionColor_vert, positionColor_frag
|
POSITION_COLOR, //positionColor_vert, positionColor_frag
|
||||||
POSITION, //position_vert, positionColor_frag
|
|
||||||
POSITION_UCOLOR, //positionUColor_vert, positionUColor_frag
|
POSITION_UCOLOR, //positionUColor_vert, positionUColor_frag
|
||||||
POSITION_TEXTURE, //positionTexture_vert, positionTexture_frag
|
POSITION_TEXTURE, //positionTexture_vert, positionTexture_frag
|
||||||
POSITION_TEXTURE_COLOR, //positionTextureColor_vert, positionTextureColor_frag
|
POSITION_TEXTURE_COLOR, //positionTextureColor_vert, positionTextureColor_frag
|
||||||
|
|
|
@ -127,7 +127,15 @@ void ProgramGL::compileProgram()
|
||||||
glGetProgramiv(_program, GL_LINK_STATUS, &status);
|
glGetProgramiv(_program, GL_LINK_STATUS, &status);
|
||||||
if (GL_FALSE == status)
|
if (GL_FALSE == status)
|
||||||
{
|
{
|
||||||
printf("cocos2d: ERROR: %s: failed to link program ", __FUNCTION__);
|
GLint errorInfoLen = 0;
|
||||||
|
glGetProgramiv(_program, GL_INFO_LOG_LENGTH, &errorInfoLen);
|
||||||
|
if (errorInfoLen) {
|
||||||
|
std::string errorInfo(errorInfoLen, '\0');
|
||||||
|
glGetProgramInfoLog(_program, errorInfoLen, NULL, &errorInfo.front());
|
||||||
|
log("cocos2d: ERROR: %s: failed to link program: %s ", __FUNCTION__, errorInfo.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
log("cocos2d: ERROR: %s: failed to link program ", __FUNCTION__);
|
||||||
glDeleteProgram(_program);
|
glDeleteProgram(_program);
|
||||||
_program = 0;
|
_program = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue