コード例 #1
0
void GLBackend::do_setStateDepthTest(State::DepthTest test) {
    const auto& current = _pipeline._stateCache.depthTest;
    if (current != test) {
        if (test.isEnabled()) {
            glEnable(GL_DEPTH_TEST);
        } else {
            glDisable(GL_DEPTH_TEST);
        }
        if (test.getWriteMask() != current.getWriteMask()) {
            glDepthMask(test.getWriteMask());
        }
        if (test.getFunction() != current.getFunction()) {
            glDepthFunc(COMPARISON_TO_GL[test.getFunction()]);
        }
        if (CHECK_GL_ERROR()) {
            qDebug() << "DepthTest" << (test.isEnabled() ? "Enabled" : "Disabled")
                << "Mask=" << (test.getWriteMask() ? "Write" : "no Write")
                << "Func=" << test.getFunction()
                << "Raw=" << test.getRaw();
        }
        _pipeline._stateCache.depthTest = test;
    }
}
コード例 #2
0
ファイル: GLState.cpp プロジェクト: AndrewMeadows/hifi
void generateDepthTest(GLState::Commands& commands, const State::DepthTest& test) {
    commands.push_back(std::make_shared<CommandDepthTest>(&GLBackend::do_setStateDepthTest, int32(test.getRaw())));
}
コード例 #3
0
ファイル: GLBackendState.cpp プロジェクト: DaveDubUK/hifi
void generateDepthTest(GLBackend::GLState::Commands& commands, const State::DepthTest& test) {
    commands.push_back(CommandPointer(new CommandDepthTest(&GLBackend::do_setStateDepthTest, int32(test.getRaw()))));
}