當前位置: 首頁>>代碼示例>>C++>>正文


C++ GL_CALL函數代碼示例

本文整理匯總了C++中GL_CALL函數的典型用法代碼示例。如果您正苦於以下問題:C++ GL_CALL函數的具體用法?C++ GL_CALL怎麽用?C++ GL_CALL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GL_CALL函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: GL_CALL

void GrGLVertexBuffer::onRelease() {
    // make sure we've not been abandoned
    if (fBufferID) {
        GPUGL->notifyVertexBufferDelete(this);
        GL_CALL(DeleteBuffers(1, &fBufferID));
        fBufferID = 0;
    }
}
開發者ID:AliFarahnak,項目名稱:XobotOS,代碼行數:8,代碼來源:GrGLVertexBuffer.cpp

示例2: GL_CALL

void GrGLRenderTarget::onRelease() {
    if (GrBackendObjectOwnership::kBorrowed != fRTFBOOwnership) {
        if (fTexFBOID) {
            GL_CALL(DeleteFramebuffers(1, &fTexFBOID));
        }
        if (fRTFBOID && fRTFBOID != fTexFBOID) {
            GL_CALL(DeleteFramebuffers(1, &fRTFBOID));
        }
        if (fMSColorRenderbufferID) {
            GL_CALL(DeleteRenderbuffers(1, &fMSColorRenderbufferID));
        }
    }
    fRTFBOID                = 0;
    fTexFBOID               = 0;
    fMSColorRenderbufferID  = 0;
    INHERITED::onRelease();
}
開發者ID:03050903,項目名稱:skia,代碼行數:17,代碼來源:GrGLRenderTarget.cpp

示例3: GL_CALL

/*
Deletes the GL texture
*/
void Texture::deleteGLTex()
{
    if (texName)
    {
        GL_CALL(glDeleteTextures(1, &texName));//Invalid operation?
        texName = 0;        
    }
}
開發者ID:Robadob,項目名稱:sdl_exp,代碼行數:11,代碼來源:Texture.cpp

示例4: GL_CALL

void GrGLPathRendering::resetContext() {
    fHWProjectionMatrixState.invalidate();
    // we don't use the model view matrix.
    GrGLenum matrixMode =
        fGpu->glStandard() == kGLES_GrGLStandard ? GR_GL_PATH_MODELVIEW : GR_GL_MODELVIEW;
    GL_CALL(MatrixLoadIdentity(matrixMode));

    if (!caps().fragmentInputGenSupport) {
        for (int i = 0; i < fGpu->glCaps().maxFixedFunctionTextureCoords(); ++i) {
            GL_CALL(PathTexGen(GR_GL_TEXTURE0 + i, GR_GL_NONE, 0, NULL));
            fHWPathTexGenSettings[i].fMode = GR_GL_NONE;
            fHWPathTexGenSettings[i].fNumComponents = 0;
        }
        fHWActivePathTexGenSets = 0;
    }
    fHWPathStencilSettings.invalidate();
}
開發者ID:3rdexp,項目名稱:soui,代碼行數:17,代碼來源:GrGLPathRendering.cpp

示例5: GL_CALL

void GrGLRenderTarget::onRelease() {
    if (kBorrowed_LifeCycle != fRTLifecycle) {
        if (fTexFBOID) {
            GL_CALL(DeleteFramebuffers(1, &fTexFBOID));
        }
        if (fRTFBOID && fRTFBOID != fTexFBOID) {
            GL_CALL(DeleteFramebuffers(1, &fRTFBOID));
        }
        if (fMSColorRenderbufferID) {
            GL_CALL(DeleteRenderbuffers(1, &fMSColorRenderbufferID));
        }
    }
    fRTFBOID                = 0;
    fTexFBOID               = 0;
    fMSColorRenderbufferID  = 0;
    INHERITED::onRelease();
}
開發者ID:mariospr,項目名稱:chromium-browser,代碼行數:17,代碼來源:GrGLRenderTarget.cpp

示例6: GL_CALL

void GrGLPath::onRelease() {
    if (0 != fPathID && !this->isWrapped()) {
        GL_CALL(DeletePaths(fPathID, 1));
        fPathID = 0;
    }

    INHERITED::onRelease();
}
開發者ID:IllusionRom-deprecated,項目名稱:android_platform_external_chromium_org_third_party_skia_src,代碼行數:8,代碼來源:GrGLPath.cpp

示例7: GL_CALL

void GrGLVertexArray::onRelease() {
    if (0 != fID) {
        GL_CALL(DeleteVertexArrays(1, &fID));
        GPUGL->notifyVertexArrayDelete(fID);
        fID = 0;
    }
    INHERITED::onRelease();
}
開發者ID:AOSC-Dev,項目名稱:Pale-Moon,代碼行數:8,代碼來源:GrGLVertexArray.cpp

示例8: switch

void GrGpuGLShaders::flushColor(GrColor color) {
    const ProgramDesc& desc = fCurrentProgram.getDesc();
    const GrDrawState& drawState = this->getDrawState();

    if (this->getGeomSrc().fVertexLayout & kColor_VertexLayoutBit) {
        // color will be specified per-vertex as an attribute
        // invalidate the const vertex attrib color
        fHWDrawState.setColor(GrColor_ILLEGAL);
    } else {
        switch (desc.fColorInput) {
        case ProgramDesc::kAttribute_ColorInput:
            if (fHWDrawState.getColor() != color) {
                // OpenGL ES only supports the float varities of glVertexAttrib
                float c[] = GR_COLOR_TO_VEC4(color);
                GL_CALL(VertexAttrib4fv(GrGLProgram::ColorAttributeIdx(),
                                        c));
                fHWDrawState.setColor(color);
            }
            break;
        case ProgramDesc::kUniform_ColorInput:
            if (fProgramData->fColor != color) {
                // OpenGL ES only supports the float varities of glVertexAttrib
                float c[] = GR_COLOR_TO_VEC4(color);
                GrAssert(GrGLProgram::kUnusedUniform !=
                         fProgramData->fUniLocations.fColorUni);
                GL_CALL(Uniform4fv(fProgramData->fUniLocations.fColorUni,
                                   1, c));
                fProgramData->fColor = color;
            }
            break;
        case ProgramDesc::kSolidWhite_ColorInput:
        case ProgramDesc::kTransBlack_ColorInput:
            break;
        default:
            GrCrash("Unknown color type.");
        }
    }
    if (fProgramData->fUniLocations.fColorFilterUni
            != GrGLProgram::kUnusedUniform
            && fProgramData->fColorFilterColor
            != drawState.getColorFilterColor()) {
        float c[] = GR_COLOR_TO_VEC4(drawState.getColorFilterColor());
        GL_CALL(Uniform4fv(fProgramData->fUniLocations.fColorFilterUni, 1, c));
        fProgramData->fColorFilterColor = drawState.getColorFilterColor();
    }
}
開發者ID:skaslev,項目名稱:XobotOS,代碼行數:46,代碼來源:GrGpuGLShaders.cpp

示例9: set_program

static void
set_program(struct ctx *context, enum program_type type)
{
   assert(context && type >= 0 && type < PROGRAM_LAST);

   context->program = &context->programs[type];
   GL_CALL(glUseProgram(context->program->obj));
}
開發者ID:boogerlad,項目名稱:wlc,代碼行數:8,代碼來源:gles2.c

示例10: GL_CALL

GrGLProgram::~GrGLProgram() {
    if (fProgramID) {
        GL_CALL(DeleteProgram(fProgramID));
    }
    for (int i = 0; i < fFragmentProcessors.count(); ++i) {
        delete fFragmentProcessors[i];
    }
}
開發者ID:Wafflespeanut,項目名稱:gecko-dev,代碼行數:8,代碼來源:GrGLProgram.cpp

示例11: SkASSERT

bool GrGLShaderBuilder::finish() {
    SkASSERT(0 == fOutput.fProgramID);
    GL_CALL_RET(fOutput.fProgramID, CreateProgram());
    if (!fOutput.fProgramID) {
        return false;
    }

    SkTDArray<GrGLuint> shadersToDelete;

    if (!this->compileAndAttachShaders(fOutput.fProgramID, &shadersToDelete)) {
        GL_CALL(DeleteProgram(fOutput.fProgramID));
        return false;
    }

    this->bindProgramLocations(fOutput.fProgramID);
    if (fUniformManager->isUsingBindUniform()) {
        fUniformManager->getUniformLocations(fOutput.fProgramID, fUniforms);
    }

    GL_CALL(LinkProgram(fOutput.fProgramID));

    // Calling GetProgramiv is expensive in Chromium. Assume success in release builds.
    bool checkLinked = !fGpu->ctxInfo().isChromium();
#ifdef SK_DEBUG
    checkLinked = true;
#endif
    if (checkLinked) {
        GrGLint linked = GR_GL_INIT_ZERO;
        GL_CALL(GetProgramiv(fOutput.fProgramID, GR_GL_LINK_STATUS, &linked));
        if (!linked) {
            GrGLint infoLen = GR_GL_INIT_ZERO;
            GL_CALL(GetProgramiv(fOutput.fProgramID, GR_GL_INFO_LOG_LENGTH, &infoLen));
            SkAutoMalloc log(sizeof(char)*(infoLen+1));  // outside if for debugger
            if (infoLen > 0) {
                // retrieve length even though we don't need it to workaround
                // bug in chrome cmd buffer param validation.
                GrGLsizei length = GR_GL_INIT_ZERO;
                GL_CALL(GetProgramInfoLog(fOutput.fProgramID,
                                          infoLen+1,
                                          &length,
                                          (char*)log.get()));
                GrPrintf((char*)log.get());
            }
            SkDEBUGFAIL("Error linking program");
            GL_CALL(DeleteProgram(fOutput.fProgramID));
            fOutput.fProgramID = 0;
            return false;
        }
    }

    if (!fUniformManager->isUsingBindUniform()) {
        fUniformManager->getUniformLocations(fOutput.fProgramID, fUniforms);
    }

    for (int i = 0; i < shadersToDelete.count(); ++i) {
      GL_CALL(DeleteShader(shadersToDelete[i]));
    }

    return true;
}
開發者ID:cnh,項目名稱:skia,代碼行數:60,代碼來源:GrGLShaderBuilder.cpp

示例12: switch

void Mesh::UnSetAttributes(const Attribute *attributes) {
  for (;;) {
    switch (*attributes++) {
      case kPosition3f:
        GL_CALL(glDisableVertexAttribArray(kAttributePosition));
        break;
      case kNormal3f:
        GL_CALL(glDisableVertexAttribArray(kAttributeNormal));
        break;
      case kTangent4f:
        GL_CALL(glDisableVertexAttribArray(kAttributeTangent));
        break;
      case kTexCoord2f:
        GL_CALL(glDisableVertexAttribArray(kAttributeTexCoord));
        break;
      case kColor4ub:
        GL_CALL(glDisableVertexAttribArray(kAttributeColor));
        break;
      case kBoneIndices4ub:
        GL_CALL(glDisableVertexAttribArray(kAttributeBoneIndices));
        break;
      case kBoneWeights4ub:
        GL_CALL(glDisableVertexAttribArray(kAttributeBoneWeights));
        break;
      case kEND:
        return;
    }
  }
}
開發者ID:ezhangle,項目名稱:fplbase,代碼行數:29,代碼來源:mesh.cpp

示例13: GL_CALL

void GrGLUniformHandler::bindUniformLocations(GrGLuint programID, const GrGLCaps& caps) {
    if (caps.bindUniformLocationSupport()) {
        int count = fUniforms.count();
        for (int i = 0; i < count; ++i) {
            GL_CALL(BindUniformLocation(programID, i, fUniforms[i].fVariable.c_str()));
            fUniforms[i].fLocation = i;
        }
    }
}
開發者ID:Crawping,項目名稱:chromium_extract,代碼行數:9,代碼來源:GrGLUniformHandler.cpp

示例14: GrAssert

void GrGLIndexBuffer::unlock() {
    GrAssert(fBufferID);
    GrAssert(isLocked());
    GrAssert(this->getGpu()->getCaps().fBufferLockSupport);

    this->bind();
    GL_CALL(UnmapBuffer(GR_GL_ELEMENT_ARRAY_BUFFER));
    fLockPtr = NULL;
}
開發者ID:0omega,項目名稱:platform_external_skia,代碼行數:9,代碼來源:GrGLIndexBuffer.cpp

示例15: GL_CALL

void GrGLTexture::onRelease() {
    if (fInfo.fID) {
        if (GrBackendObjectOwnership::kBorrowed != fTextureIDOwnership) {
            GL_CALL(DeleteTextures(1, &fInfo.fID));
        }
        fInfo.fID = 0;
    }
    INHERITED::onRelease();
}
開發者ID:aseprite,項目名稱:skia,代碼行數:9,代碼來源:GrGLTexture.cpp


注:本文中的GL_CALL函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。