Example #1
0
bool ShaderNode::initWithVertex(const std::string &vs, const std::string &fs)
{
    loadShaderVertex(vs, fs);

    _vertFileName = vs;
    _fragFileName = fs;

    return true;
}
Example #2
0
bool ShaderNode::initWithVertex(const char *vert, const char *frag)
{
	loadShaderVertex(vert, frag);
	m_texture = CCTextureCache::sharedTextureCache()->addImage("supercell.png")->getName();

	setContentSize(CCSizeMake(1024, 768));
	setColor(ccc4f(0.5, 0.5, 1, 1));
	m_time = 0;
	scheduleUpdate();
	return true;
}
Example #3
0
bool ShaderNode::initWithVertex(const char *vert, const char *frag)
{

    loadShaderVertex(vert, frag);

    m_time = 0;
    m_resolution = vertex2(SIZE_X, SIZE_Y);

    scheduleUpdate();

    setContentSize(CCSizeMake(SIZE_X, SIZE_Y));
    setAnchorPoint(ccp(0.5f, 0.5f));

    return true;
}
Example #4
0
bool ShaderNode::initWithVertex(const char *vert, const char *frag)
{
    CCNotificationCenter::sharedNotificationCenter()->addObserver(this,
                                                                  callfuncO_selector(ShaderNode::listenBackToForegrouScut),
                                                                  EVENT_COME_TO_FOREGROUScut,
                                                                  NULL);

    loadShaderVertex(vert, frag);

    m_time = 0;
    m_resolution = vertex2(SIZE_X, SIZE_Y);

    scheduleUpdate();

    setContentSize(CCSizeMake(SIZE_X, SIZE_Y));
    setAnchorPoint(ccp(0.5f, 0.5f));
    
    m_vertFileName = vert;
    m_fragFileName = frag;

    return true;
}
Example #5
0
void ShaderNode::listenBackToForegrouScut(CCObject *obj)
{
    this->setShaderProgram(NULL);
    loadShaderVertex(m_vertFileName.c_str(), m_fragFileName.c_str());
}