当前位置: 首页>>代码示例>>C++>>正文


C++ COGLGraphicsContext::getMaxAnisotropicFiltering方法代码示例

本文整理汇总了C++中COGLGraphicsContext::getMaxAnisotropicFiltering方法的典型用法代码示例。如果您正苦于以下问题:C++ COGLGraphicsContext::getMaxAnisotropicFiltering方法的具体用法?C++ COGLGraphicsContext::getMaxAnisotropicFiltering怎么用?C++ COGLGraphicsContext::getMaxAnisotropicFiltering使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在COGLGraphicsContext的用法示例。


在下文中一共展示了COGLGraphicsContext::getMaxAnisotropicFiltering方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: EndUpdate

void COGLTexture::EndUpdate(DrawInfo *di)
{
    COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext); // we need this to check if the GL extension is avaible

    glBindTexture(GL_TEXTURE_2D, m_dwTextureName);
    OPENGL_CHECK_ERRORS;

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    OPENGL_CHECK_ERRORS;

    // mipmap support
    if(options.mipmapping)
    {
        int m_maximumAnistropy = pcontext->getMaxAnisotropicFiltering(); //if getMaxAnisotropicFiltering() return more than 0, so aniso is supported and maxAnisotropicFiltering is set

        // Set Anisotropic filtering (mipmapping have to be activated, aniso filtering is not effective without)
        if( m_maximumAnistropy )
        {
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, m_maximumAnistropy);
            OPENGL_CHECK_ERRORS;
        }

        // Set Mipmap
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
        OPENGL_CHECK_ERRORS;

#ifndef USE_GLES
        // Tell to hardware to generate mipmap (himself) when glTexImage2D is called
        glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
#endif
        OPENGL_CHECK_ERRORS;
    }
    else
    {
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        OPENGL_CHECK_ERRORS;
    }

    // Copy the image data from main memory to video card texture memory
#ifndef USE_GLES
    glTexImage2D(GL_TEXTURE_2D, 0, m_glFmt, m_dwCreatedTextureWidth, m_dwCreatedTextureHeight, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, m_pTexture);
#else
    //GL_BGRA_IMG works on adreno but not inside profiler.
    glTexImage2D(GL_TEXTURE_2D, 0, m_glFmt, m_dwCreatedTextureWidth, m_dwCreatedTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, m_pTexture);

    if(options.mipmapping)
        glGenerateMipmap(GL_TEXTURE_2D);
#endif
    OPENGL_CHECK_ERRORS;
}
开发者ID:JamesMcMurran,项目名称:mupen64plus-ae,代码行数:50,代码来源:OGLTexture.cpp


注:本文中的COGLGraphicsContext::getMaxAnisotropicFiltering方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。