当前位置: 首页>>代码示例>>C++>>正文


C++ Surface::GetSDLSurface方法代码示例

本文整理汇总了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);
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:57,代码来源:framework3d.cpp

示例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
		{
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:67,代码来源:framework3d.cpp


注:本文中的Surface::GetSDLSurface方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。