本文整理汇总了C++中GL_CALL函数的典型用法代码示例。如果您正苦于以下问题:C++ GL_CALL函数的具体用法?C++ GL_CALL怎么用?C++ GL_CALL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GL_CALL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GL_CALL
GrGLProgram::~GrGLProgram() {
if (fVShaderID) {
GL_CALL(DeleteShader(fVShaderID));
}
if (fGShaderID) {
GL_CALL(DeleteShader(fGShaderID));
}
if (fFShaderID) {
GL_CALL(DeleteShader(fFShaderID));
}
if (fProgramID) {
GL_CALL(DeleteProgram(fProgramID));
}
for (int i = 0; i < GrDrawState::kNumStages; ++i) {
delete fProgramStage[i];
}
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:18,代码来源:GrGLProgram.cpp
示例17: GL_CALL
void GrGLRenderTarget::onRelease() {
if (!fIsWrapped) {
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;
fIsWrapped = false;
INHERITED::onRelease();
}
开发者ID:mto,项目名称:skia,代码行数:18,代码来源:GrGLRenderTarget.cpp
示例18: SetAttributes
void Mesh::Render(Renderer &renderer, bool ignore_material, size_t instances) {
SetAttributes(vbo_, format_, static_cast<int>(vertex_size_), nullptr);
for (auto it = indices_.begin(); it != indices_.end(); ++it) {
if (!ignore_material) it->mat->Set(renderer);
GL_CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, it->ibo));
DrawElement(renderer, it->count, static_cast<int32_t>(instances));
}
UnSetAttributes(format_);
}
开发者ID:ezhangle,项目名称:fplbase,代码行数:9,代码来源:mesh.cpp
示例19: GL_CALL
void GrGLVertexBuilder::bindVertexAttributes(GrGLuint programID) {
const GrPrimitiveProcessor& primProc = fProgramBuilder->primitiveProcessor();
int vaCount = primProc.numAttribs();
for (int i = 0; i < vaCount; i++) {
GL_CALL(BindAttribLocation(programID, i, primProc.getAttrib(i).fName));
}
return;
}
开发者ID:Arternis,项目名称:skia,代码行数:9,代码来源:GrGLVertexShaderBuilder.cpp
示例20: ASSERT
void BufferObject::FreeBufferObject()
{
ASSERT(m_bufferId != 0);
GL_CALL(glDeleteBuffers(1, &m_bufferId));
m_bufferId = 0;
m_isDirty = false;
m_sizeInBytes = 0;
}
开发者ID:gered,项目名称:MyGameFramework,代码行数:9,代码来源:bufferobject.cpp
注:本文中的GL_CALL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论