本文整理汇总了C++中Surface::GetSDLSurface方法的典型用法代码示例。如果您正苦于以下问题:C++ Surface::GetSDLSurface方法的具体用法?C++ Surface::GetSDLSurface怎么用?C++ Surface::GetSDLSurface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Surface
的用法示例。
在下文中一共展示了Surface::GetSDLSurface方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: STATICHASH
void Framework3D::CreateSplashWindow(const uint WindowIcon,
const char* const Title) {
XTRACE_FUNCTION;
STATICHASH(Framework);
STATICHASH(SplashImage);
const char* const pSplashImage =
ConfigManager::GetString(sSplashImage, nullptr, sFramework);
if (!pSplashImage) {
return;
}
const Surface SplashSurface =
Surface(PackStream(pSplashImage), Surface::ESFT_BMP);
const int SplashWindowWidth = SplashSurface.GetWidth();
const int SplashWindowHeight = SplashSurface.GetHeight();
ASSERT(!m_SplashWindow);
m_SplashWindow = new Window;
#if BUILD_WINDOWS_NO_SDL
const DWORD WindowStyle = WS_POPUP;
const DWORD WindowExStyle =
WS_EX_TOOLWINDOW; // Prevents this window appearing in the taskbar
const int ScreenWidth =
m_Display->m_Fullscreen ? m_Display->m_Width : m_Display->m_ScreenWidth;
const int ScreenHeight =
m_Display->m_Fullscreen ? m_Display->m_Height : m_Display->m_ScreenHeight;
m_SplashWindow->Init(Title, "SplashWindowClass", WindowStyle, WindowExStyle,
SplashWindowWidth, SplashWindowHeight, m_hInstance, NULL,
WindowIcon, ScreenWidth, ScreenHeight);
// The window needs to be shown before we can blit to it.
m_SplashWindow->Show(m_CmdShow);
#endif
#if BUILD_SDL
// TODO SDL: Unify interface?
const uint Flags = SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS;
m_SplashWindow->Init(Title, Flags, SplashWindowWidth, SplashWindowHeight);
// Load icon from package file instead of compiled resource.
Unused(WindowIcon);
STATICHASH(IconImage);
const char* const pIconImage =
ConfigManager::GetString(sIconImage, nullptr, sFramework);
if(pIconImage) {
ASSERT(pIconImage);
const Surface IconSurface =
Surface(PackStream(pIconImage), Surface::ESFT_BMP);
SDL_SetWindowIcon(m_SplashWindow->GetSDLWindow(),
IconSurface.GetSDLSurface());
}
#endif
SplashSurface.BlitToWindow(m_SplashWindow);
}
示例2: Surface
//.........这里部分代码省略.........
CreateSplashWindow( WindowIcon, WindowTitle.CStr() );
m_Window = new Window;
#if BUILD_WINDOWS_NO_SDL
DWORD WindowStyle = 0;
if( m_Display->m_Fullscreen ||
( m_Display->m_ScreenWidth == m_Display->m_Width &&
m_Display->m_ScreenHeight == m_Display->m_Height ) )
{
WindowStyle = WS_POPUP;
}
else
{
WindowStyle = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
}
m_Window->Init( WindowTitle.CStr(), "Class1", WindowStyle, 0, DisplayWidth, DisplayHeight, m_hInstance, WindowProc, WindowIcon, m_Display->m_ScreenWidth, m_Display->m_ScreenHeight );
#elif BUILD_SDL
uint WindowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN;
if( m_Display->m_Fullscreen ||
( m_Display->m_ScreenWidth == m_Display->m_Width &&
m_Display->m_ScreenHeight == m_Display->m_Height ) )
{
WindowFlags |= SDL_WINDOW_BORDERLESS;
}
// TODO SDL: Unify interface?
m_Window->Init( WindowTitle.CStr(), WindowFlags, DisplayWidth, DisplayHeight );
STATICHASH( IconImage );
const char* const pIconImage = ConfigManager::GetString( sIconImage, NULL, sFramework );
ASSERT( pIconImage );
const Surface IconSurface = Surface( PackStream( pIconImage ), Surface::ESFT_BMP );
SDL_SetWindowIcon( m_Window->GetSDLWindow(), IconSurface.GetSDLSurface() );
#endif
m_Window->SetFullscreen( m_Display->m_Fullscreen );
if( m_Display->m_Fullscreen )
{
m_Window->SetPosition( 0, 0 );
}
m_Clock = new Clock;
XTRACE_BEGIN( InitializeDevices );
m_Keyboard = new Keyboard;
#if BUILD_WINDOWS_NO_SDL
m_Mouse = new Mouse( m_hInstance, m_Window->GetHWnd() );
#elif BUILD_SDL
m_Mouse = new Mouse( m_Window );
#endif
XTRACE_END;
InitializeUIInputMap();
XTRACE_BEGIN( InitializeAudioSystem );
InitializeAudioSystem();
XTRACE_END;
XTRACE_BEGIN( InitializeRenderer );
#if BUILD_WINDOWS_NO_SDL
STATICHASH( OpenGL );
const bool OpenGL = ConfigManager::GetBool( sOpenGL );
if( OpenGL )
#endif
{