//------------------------------------------------------------------------------
void keyboard(unsigned char key, int x, int y)
{
    switch( key )
    {
        case 0x1b:
#ifdef NOGLUT
            PostQuitMessage(0);
#else
            shutdownBase();
            shutdown();
            exit(0);
#endif
            break;
        case 'a':
            g_scale *= 0.5f;
            UPDATEUI(g_scale)
            break;
        case 'q':
            g_scale *= 2.0f;
            UPDATEUI(g_scale)
            break;
        case ' ':
            g_realtime.bNonStopRendering = g_realtime.bNonStopRendering ? false : true;
            UPDATEUI(g_realtime.bNonStopRendering);
            break;
        case '1':
            fx_TechScene    = fx_EffectScene->findTechnique(0);
            LOGI("Using scene technique %s", fx_TechScene->getName());
            #ifdef USESVCUI
            if(g_pComboTech) g_pComboTech->SetSelectedByIndex(0);
            #endif
            break;
        //case '2':
        //    fx_TechScene    = fx_EffectScene->findTechnique(1);
        //    LOGI("Using scene technique %s", fx_TechScene->getName());
        //    #ifdef USESVCUI
        //    if(g_pComboTech) g_pComboTech->SetSelectedByIndex(1);
        //    #endif
        //    break;
        //case '3':
        //    fx_TechScene    = fx_EffectScene->findTechnique(2);
        //    LOGI("Using scene technique %s", fx_TechScene->getName());
        //    #ifdef USESVCUI
        //    if(g_pComboTech) g_pComboTech->SetSelectedByIndex(2);
        //    #endif
        //    break;
        case 's':
            loadSceneEffect();
            break;
    }
}
//------------------------------------------------------------------------------
void keyboard(unsigned char key, int x, int y)
{
    switch( key )
    {
        case 0x1b:
#ifdef NOGLUT
            PostQuitMessage(0);
#else
            shutdownBase();
            shutdown();
            exit(0);
#endif
            break;
        case 'w':
            g_bWireFrame = g_bWireFrame ? false : true;
#ifdef USESVCUI
            if(g_pWinHandler) g_pWinHandler->VariableFlush(&g_bWireFrame);
#endif
            glPolygonMode(GL_FRONT_AND_BACK, g_bWireFrame ? GL_LINE:GL_FILL);
            break;
        case 'a':
            g_scale *= 0.5f;
            if(fx_scaleBias)
                fx_scaleBias->setValue4f(0, 0, 0, g_scale);
            UPDATEUI(g_scale)
            break;
        case 'q':
            g_scale *= 2.0f;
            if(fx_scaleBias)
                fx_scaleBias->setValue4f(0, 0, 0, g_scale);
            UPDATEUI(g_scale)
            break;
        case ' ':
            g_realtime.bNonStopRendering = g_realtime.bNonStopRendering ? false : true;
            UPDATEUI(g_realtime.bNonStopRendering);
            break;
        case 'm':
            loadMaterialEffect();
            break;
        case '1':
        case '2':
        //case '3':
            fx_Tech    = fx_Effect->findTechnique(TECH_DEFAULT+key-'1');
            LOGI("Using scene technique %s", fx_Tech->getName());
            #ifdef USESVCUI
            if(g_pComboTech) g_pComboTech->SetSelectedByIndex(key-'1');
            #endif
            break;
    }
}
//------------------------------------------------------------------------------
void keyboard(unsigned char key, int x, int y)
{
    switch( key )
    {
        case 0x1b:
#ifdef NOGLUT
            PostQuitMessage(0);
#endif
            shutdownBase();
            shutdown();
            exit(0);
            break;
        case ' ':
            g_realtime.bNonStopRendering = g_realtime.bNonStopRendering ? false : true;
            UPDATEUI(g_realtime.bNonStopRendering);
            break;
        case 'm':
            loadMaterialEffect();
            break;
        //case '1':
        //case '2':
        //case '3':
        //    fx_Tech    = fx_Effect->findTechnique(TECH_DEFAULT+key-'1');
        //    LOGI("Using scene technique %s", fx_Tech->getName());
        //    #ifdef USESVCUI
        //    if(g_pComboTech) g_pComboTech->SetSelectedByIndex(key-'1');
        //    #endif
        //    break;
        case '1':
        case '2':
        case '3':
            g_uniformUpdateMode = (UpdateMode)(key-'1');
            fx_Tech = fx_Effect->findTechnique("uniformBlock");
            #ifdef USESVCUI
            if(g_pComboUniformUpdate) g_pComboUniformUpdate->SetSelectedByIndex(key-'1');
            #endif
            break;
        case '4':
            g_uniformUpdateMode = (UpdateMode)(key-'1');
            fx_Tech = fx_Effect->findTechnique("Uniforms"); // use another approach
            #ifdef USESVCUI
            if(g_pComboUniformUpdate) g_pComboUniformUpdate->SetSelectedByIndex(key-'1');
            #endif
            break;
    }
}
Exemple #4
0
bool CSummaryView::UpdateUI(CCmdUI * cui)
{
    if ( m_view.IsLoaded() )
    {
        UPDATEUI(cui, ID_BROWSER_NEW, true);
        UPDATEUI(cui, ID_BROWSER_IE, true);
        UPDATEUI(cui, ID_BROWSER_STOP, true);
        UPDATEUI(cui, ID_BROWSER_BACK, m_view.BackEnabled());
        UPDATEUI(cui, ID_BROWSER_FORWARD, m_view.ForwardEnabled());
        UPDATEUI(cui, ID_BROWSER_REFRESH, true);
    }
    return false;
}
//------------------------------------------------------------------------------
void keyboard(unsigned char key, int x, int y)
{
    switch( key )
    {
        case 0x1b:
#ifdef NOGLUT
            PostQuitMessage(0);
#endif
            shutdown();     // destroy resources specific to the sample, first
            shutdownBase(); // THEN destroy base-things
            exit(0);
            break;
        case 'a':
            g_scale *= 0.5f;
            UPDATEUI(g_scale)
            break;
        case 'q':
            g_scale *= 2.0f;
            UPDATEUI(g_scale)
            break;
        case ' ':
            g_realtime.bNonStopRendering = g_realtime.bNonStopRendering ? false : true;
            UPDATEUI(g_realtime.bNonStopRendering);
            break;
        case 'm':
            loadMaterialEffect();
            break;
        case '1':
        case '2':
        case '3':
            fx_Tech    = fx_Effect->findTechnique(TECH_DEFAULT+key-'1');
            LOGI("Using scene technique %s", fx_Tech->getName());
            #ifdef USESVCUI
            g_pComboTech->SetSelectedByIndex(key-'1');
            #endif
            break;
    }
}