Example #1
0
OpenGL::OpenGL()
:  m_renderPath(RENDER_PATH_VERTEX_ARRAY),
   m_boundTexture(0)
{
    CrbReleaseAssert ( g_openGL == NULL );
    m_vendorString     = cc_strdup((const char *)glGetString ( GL_VENDOR     ));
    m_rendererString   = cc_strdup((const char *)glGetString ( GL_RENDERER   ));
    m_versionString    = cc_strdup((const char *)glGetString ( GL_VERSION    ));
    m_extensionsString = cc_strdup((const char *)glGetString ( GL_EXTENSIONS ));
    SetupExtensions();
    SetupVersion();
}
int TigerFileBase::OpenFile( const char * pszModuleToOpen,
                             const char *pszExtension )

{
    char        *pszFilename;

    CPLFree( pszModule );
    pszModule = NULL;
    CPLFree( pszShortModule );
    pszShortModule = NULL;
    
    if( fpPrimary != NULL )
    {
        VSIFClose( fpPrimary );
        fpPrimary = NULL;
    }

    if( pszModuleToOpen == NULL )
        return TRUE;

    pszFilename = poDS->BuildFilename( pszModuleToOpen, pszExtension );

    fpPrimary = VSIFOpen( pszFilename, "rb" );

    CPLFree( pszFilename );

    if( fpPrimary != NULL )
    {
        pszModule = CPLStrdup(pszModuleToOpen);
        pszShortModule = CPLStrdup(pszModuleToOpen);
        for( int i = 0; pszShortModule[i] != '\0'; i++ )
        {
            if( pszShortModule[i] == '.' )
                pszShortModule[i] = '\0';
        }

        SetupVersion();

        return TRUE;
    }
    else
        return FALSE;
}