Ejemplo n.º 1
0
HRESULT WINAPI wxDDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc,
                                     LPVOID lpContext)
{
    // we need at least the mode size
    static const DWORD FLAGS_REQUIRED = DDSD_HEIGHT | DDSD_WIDTH;
    if ( (lpDDSurfaceDesc->dwFlags & FLAGS_REQUIRED) == FLAGS_REQUIRED )
    {
        wxDDVideoModesAdder * const vmodes =
            static_cast<wxDDVideoModesAdder *>(lpContext);

        vmodes->Add(wxVideoMode(lpDDSurfaceDesc->dwWidth,
                                lpDDSurfaceDesc->dwHeight,
                                lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount,
                                lpDDSurfaceDesc->dwRefreshRate));
    }

    // continue the enumeration
    return DDENUMRET_OK;
}
Ejemplo n.º 2
0
pascal void DMModeTransProc (	void* pData,
					  DMListIndexType nIndex,
					  DMDisplayModeListEntryPtr pInfo)
{
	DMModeTransRec* pInfoData = (DMModeTransRec*) pData;

	for(unsigned long i = 0; i < pInfo->displayModeDepthBlockInfo->depthBlockCount; ++i)
		{
#define pDBI pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthVPBlock
		if (pInfoData->psMode->csData == pInfo->displayModeDepthBlockInfo->depthVPBlock[i].depthSwitchInfo->csData)
			{
			pInfoData->Mode = wxVideoMode((int) pInfo->displayModeResolutionInfo->csHorizontalPixels,
								 (int) pInfo->displayModeResolutionInfo->csVerticalLines,
								 (int) pDBI->vpPixelSize,
								 (int) Fix2Long(pInfo->displayModeResolutionInfo->csRefreshRate) );
			pInfoData->bMatched = true;
			break;
			}
#undef pDBI
		}
}
Ejemplo n.º 3
0
bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser)
{
#ifdef __WXUNIVERSAL__
    wxString themeName;
    if ( parser.Found(OPTION_THEME, &themeName) )
    {
        wxTheme *theme = wxTheme::Create(themeName);
        if ( !theme )
        {
            wxLogError(_("Unsupported theme '%s'."), themeName.c_str());
            return false;
        }

        // Delete the defaultly created theme and set the new theme.
        delete wxTheme::Get();
        wxTheme::Set(theme);
    }
#endif // __WXUNIVERSAL__

#if defined(__WXMGL__)
    wxString modeDesc;
    if ( parser.Found(OPTION_MODE, &modeDesc) )
    {
        unsigned w, h, bpp;
        if ( wxSscanf(modeDesc.c_str(), wxT("%ux%u-%u"), &w, &h, &bpp) != 3 )
        {
            wxLogError(_("Invalid display mode specification '%s'."), modeDesc.c_str());
            return false;
        }

        if ( !SetDisplayMode(wxVideoMode(w, h, bpp)) )
            return false;
    }
#endif // __WXMGL__

    return wxAppConsole::OnCmdLineParsed(parser);
}
Ejemplo n.º 4
0
wxVideoMode wxAppBase::GetDisplayMode() const
{
    return wxVideoMode();
}
Ejemplo n.º 5
0
 virtual wxVideoMode GetCurrentMode() const { return wxVideoMode(); }
Ejemplo n.º 6
0
wxVideoMode wxDisplay::GetCurrentMode() const
{
    wxCHECK_MSG( IsOk(), wxVideoMode(), _T("invalid wxDisplay object") );

    return m_impl->GetCurrentMode();
}