コード例 #1
0
int DisplayMode_Init(void)
{
    if(inited) return true;

    captured = false;
    DisplayMode_Native_Init();
#if defined(MACOSX) || defined(UNIX)
    DisplayMode_SaveOriginalColorTransfer();
#endif

    // This is used for sorting the mode set (Hz).
    originalMode = Mode::fromCurrent();

    for(int i = 0; i < DisplayMode_Native_Count(); ++i)
    {
        Mode mode(i);
        if(mode.depth < 16 || mode.width < 320 || mode.height < 240)
            continue; // This mode is not good.
        modes.insert(mode);
    }

    LOG_DEBUG("Current mode is:");
    originalMode.debugPrint();

    LOG_DEBUG("All available modes:");
    for(Modes::iterator i = modes.begin(); i != modes.end(); ++i)
    {
        i->debugPrint();
    }

    initBindings();

    inited = true;
    return true;
}
コード例 #2
0
int DisplayMode_Init(void)
{
    if (inited) return true;

    captured = false;
    DisplayMode_Native_Init();
#if defined(MACOSX) || defined(UNIX)
    DisplayMode_SaveOriginalColorTransfer();
#endif

    // This is used for sorting the mode set (Hz).
    originalMode = Mode::fromCurrent();

    for (int i = 0; i < DisplayMode_Native_Count(); ++i)
    {
        Mode mode(i);
        if (mode.depth < 16 || mode.width < 320 || mode.height < 240)
            continue; // This mode is not good.
        modes.insert(mode);
    }

    LOG_GL_VERBOSE("Current mode is:");
    originalMode.debugPrint();

    LOG_GL_VERBOSE("All available modes:");
    for (Modes::iterator i = modes.begin(); i != modes.end(); ++i)
    {
        i->debugPrint();
    }

    // Script bindings.
    binder.initNew() << DENG2_FUNC_NOARG(DisplayMode_OriginalMode, "originalMode");
    de::App::scriptSystem().addNativeModule("DisplayMode", binder.module());
    binder.module().addNumber("PIXEL_RATIO", 1.0);

    inited = true;
    return true;
}