Exemple #1
0
	void VideoDriverGLES20::setShaderProgram(ShaderProgram* prog_)
	{
        CHECKGL();
		ShaderProgramGL* prog = safeCast<ShaderProgramGL*>(prog_);
		unsigned int id = prog->getID();
		glUseProgram(id);
		_program = id;

		int gl_error = glGetError();
        if (gl_error != GL_NO_ERROR)
        {
            log::error("OpenGL error: %#x\n", gl_error);

			char buf[1024];
			GLsizei len;
			glGetProgramInfoLog(id, sizeof(buf)-1, &len, buf);
			buf[len] = 0;
			log::error("OpenGL error: %s\n", buf);

            if (gl_error == GL_OUT_OF_MEMORY)
            {
                exit(0);
            }
        }
		// CHECKGL();
	}
 void VideoDriverGLES20::setShaderProgram(ShaderProgram* prog_)
 {
     CHECKGL();
     ShaderProgramGL* prog = safeCast<ShaderProgramGL*>(prog_);
     unsigned int id = prog->getID();
     oxglUseProgram(id);
     _program = id;
     CHECKGL();
 }