本文整理汇总了C++中CTexture::GetPixels方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::GetPixels方法的具体用法?C++ CTexture::GetPixels怎么用?C++ CTexture::GetPixels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::GetPixels方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool CWinSystemX11::CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction)
{
RESOLUTION_INFO& desktop = g_settings.m_ResInfo[RES_DESKTOP];
if (fullScreen &&
(res.iWidth != desktop.iWidth || res.iHeight != desktop.iHeight ||
res.fRefreshRate != desktop.fRefreshRate || res.iScreen != desktop.iScreen))
{
//on the first call to SDL_SetVideoMode, SDL stores the current displaymode
//SDL restores the displaymode on SDL_QUIT(), if we change the displaymode
//before the first call to SDL_SetVideoMode, SDL changes the displaymode back
//to the wrong mode on exit
CLog::Log(LOGINFO, "CWinSystemX11::CreateNewWindow initializing to desktop resolution first");
if (!SetFullScreen(true, desktop, false))
return false;
}
if(!SetFullScreen(fullScreen, res, false))
return false;
CTexture iconTexture;
iconTexture.LoadFromFile("special://xbmc/media/icon.png");
SDL_WM_SetIcon(SDL_CreateRGBSurfaceFrom(iconTexture.GetPixels(), iconTexture.GetWidth(), iconTexture.GetHeight(), 32, iconTexture.GetPitch(), 0xff0000, 0x00ff00, 0x0000ff, 0xff000000L), NULL);
SDL_WM_SetCaption("XBMC Media Center", NULL);
m_bWindowCreated = true;
return true;
}
示例2: CreateNewWindow
bool CWinSystemEGL::CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction)
{
if(!SetFullScreen(fullScreen, res, false))
return false;
CTexture iconTexture;
iconTexture.LoadFromFile("special://xbmc/media/icon.png");
SDL_WM_SetIcon(SDL_CreateRGBSurfaceFrom(iconTexture.GetPixels(), iconTexture.GetWidth(), iconTexture.GetHeight(), BPP, iconTexture.GetPitch(), 0xff0000, 0x00ff00, 0x0000ff, 0xff000000L), NULL);
SDL_WM_SetCaption("XBMC Media Center", NULL);
m_bWindowCreated = true;
m_eglext = " ";
m_eglext += eglQueryString(m_eglDisplay, EGL_EXTENSIONS);
m_eglext += " ";
CLog::Log(LOGDEBUG, "EGL_EXTENSIONS:%s", m_eglext.c_str());
return true;
}
示例3: DoWork
bool CTextureDDSJob::DoWork()
{
CTexture texture;
if (URIUtils::GetExtension(m_original).Equals(".dds"))
return false;
if (texture.LoadFromFile(m_original))
{ // convert to DDS
CDDSImage dds;
CLog::Log(LOGDEBUG, "Creating DDS version of: %s", m_original.c_str());
return dds.Create(URIUtils::ReplaceExtension(m_original, ".dds"), texture.GetWidth(), texture.GetHeight(), texture.GetPitch(), texture.GetPixels(), 40);
}
return false;
}