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


C++ SDL_GetWindowWMInfo函数代码示例

本文整理汇总了C++中SDL_GetWindowWMInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ SDL_GetWindowWMInfo函数的具体用法?C++ SDL_GetWindowWMInfo怎么用?C++ SDL_GetWindowWMInfo使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SDL_GetWindowWMInfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getNativeWindow

void* getNativeWindow(SDL_Window* sdlWindow) {
    SDL_SysWMinfo wmi;
    SDL_VERSION(&wmi.version);
    ASSERT_POSTCONDITION(SDL_GetWindowWMInfo(sdlWindow, &wmi), "SDL version unsupported!");
    HDC win = (HDC) wmi.info.win.hdc;
    return (void*) win;
}
开发者ID:frguthmann,项目名称:filament,代码行数:7,代码来源:NativeWindowHelperWindows.cpp

示例2: syswm_getWindowWMInfo

/**
 * @brief Call to SDL_GetWindowWMInfo
 */
int
syswm_getWindowWMInfo(void *arg)
{
  SDL_bool result;
  SDL_Window *window; 
  SDL_SysWMinfo info;
  
  window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN);
  SDLTest_AssertPass("Call to SDL_CreateWindow()");
  SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL");
  if (window == NULL) {
     return TEST_ABORTED;
  }
  
  /* Initialize info structure with SDL version info */
  SDL_VERSION(&info.version); 
  
  /* Make call */
  result = SDL_GetWindowWMInfo(window, &info);
  SDLTest_AssertPass("Call to SDL_GetWindowWMInfo");
  SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
                                                                                                      		
  SDL_DestroyWindow(window);
  SDLTest_AssertPass("Call to SDL_DestroyWindow()");
  
  return TEST_COMPLETED;
}
开发者ID:CrypticGator,项目名称:hackterm,代码行数:30,代码来源:testautomation_syswm.c

示例3: setWindow

void setWindow(SDL_Window* window)
{
	SDL_SysWMinfo window_info;
	SDL_VERSION(&window_info.version);
	SDL_GetWindowWMInfo(window, &window_info);
	g_window = window_info.info.win.window;
}
开发者ID:nem0,项目名称:LumixEngine,代码行数:7,代码来源:platform_interface.cpp

示例4: SDL_VERSION

DataType WindowSDL::getHandle()
{
	SDL_SysWMinfo info;
	SDL_VERSION(&info.version); 
	SDL_GetWindowWMInfo(m_sdlWindow, &info);
	return info.info.win.window;
}
开发者ID:thasan01,项目名称:OpenGL,代码行数:7,代码来源:WindowSDL.cpp

示例5: memset

void OVR_SDL2_app::conf_OVR()
{
    // Configure the renderer. Zeroing the configuration stucture causes all
    // display, window, and device specifications to take on current values
    // as put in place by SDL. This should work cross-platform, but doesn't.
    // A workaround is currently (0.4.3b) required under linux.

    SDL_SysWMinfo info;
    ovrGLConfig   cfg;

    memset(&info, 0, sizeof (SDL_SysWMinfo));
    memset(&cfg,  0, sizeof (ovrGLConfig));

    SDL_VERSION(&info.version);
    SDL_GetWindowWMInfo(window, &info);

    cfg.OGL.Header.API      = ovrRenderAPI_OpenGL;
    cfg.OGL.Header.RTSize.w = hmd->Resolution.w;
    cfg.OGL.Header.RTSize.h = hmd->Resolution.h;

#ifdef __linux__
    cfg.OGL.Disp = info.info.x11.display;
    cfg.OGL.Win  = info.info.x11.window;
#endif

    // Set the configuration and receive eye render descriptors in return.

    ovrHmd_ConfigureRendering(hmd, &cfg.Config, ovrDistortionCap_Chromatic
                                              | ovrDistortionCap_TimeWarp
                                              | ovrDistortionCap_Overdrive,
                                                hmd->DefaultEyeFov, erd);

    offset[0] = erd[0].HmdToEyeViewOffset;
    offset[1] = erd[1].HmdToEyeViewOffset;

    // Determine the buffer size required by each eye of the current HMD.

    ovrSizei size[2];

    size[0] = ovrHmd_GetFovTextureSize(hmd, ovrEye_Left,  hmd->DefaultEyeFov[0], 1);
    size[1] = ovrHmd_GetFovTextureSize(hmd, ovrEye_Right, hmd->DefaultEyeFov[1], 1);

    // Initialize the off-screen render buffers. We're using one buffer per-eye
    // instead of concatenating both eyes into a single buffer.

    for (int i = 0; i < 2; i++)
    {
        if ((buffer[i] = new framebuffer(size[i].w, size[i].h)))
        {
            ovrGLTexture *p = reinterpret_cast<ovrGLTexture*>(tex + i);

            memset(p, 0, sizeof (ovrGLTexture));

            p->OGL.Header.API                 = ovrRenderAPI_OpenGL;
            p->OGL.Header.TextureSize         = size[i];
            p->OGL.Header.RenderViewport.Size = size[i];
            p->OGL.TexId                      = buffer[i]->color;
        }
    }
}
开发者ID:MORTAL2000,项目名称:OVR_SDL2,代码行数:60,代码来源:OVR_SDL2_app.cpp

示例6: Init

bool Init(SDL_Window *window) {
    ImGuiIO &io = ImGui::GetIO();
    io.KeyMap[ImGuiKey_Tab] = SDLK_TAB; // Keyboard mapping. ImGui will use those
    // indices to peek into the io.KeyDown[]
    // array.
    io.KeyMap[ImGuiKey_LeftArrow] = SDL_SCANCODE_LEFT;
    io.KeyMap[ImGuiKey_RightArrow] = SDL_SCANCODE_RIGHT;
    io.KeyMap[ImGuiKey_UpArrow] = SDL_SCANCODE_UP;
    io.KeyMap[ImGuiKey_DownArrow] = SDL_SCANCODE_DOWN;
    io.KeyMap[ImGuiKey_Home] = SDL_SCANCODE_HOME;
    io.KeyMap[ImGuiKey_End] = SDL_SCANCODE_END;
    io.KeyMap[ImGuiKey_Delete] = SDLK_DELETE;
    io.KeyMap[ImGuiKey_Backspace] = SDLK_BACKSPACE;
    io.KeyMap[ImGuiKey_Enter] = SDLK_RETURN;
    io.KeyMap[ImGuiKey_Escape] = SDLK_ESCAPE;
    io.KeyMap[ImGuiKey_A] = SDLK_a;
    io.KeyMap[ImGuiKey_C] = SDLK_c;
    io.KeyMap[ImGuiKey_V] = SDLK_v;
    io.KeyMap[ImGuiKey_X] = SDLK_x;
    io.KeyMap[ImGuiKey_Y] = SDLK_y;
    io.KeyMap[ImGuiKey_Z] = SDLK_z;

    io.RenderDrawListsFn = RenderDrawLists;
    io.SetClipboardTextFn = SetClipboardText;
    io.GetClipboardTextFn = GetClipboardText;

#ifdef _MSC_VER
    SDL_SysWMinfo wmInfo;
    SDL_VERSION(&wmInfo.version);
    SDL_GetWindowWMInfo(window, &wmInfo);
    io.ImeWindowHandle = wmInfo.info.win.window;
#endif

    return true;
}
开发者ID:octaviogarcia,项目名称:bbbwimgui,代码行数:35,代码来源:imgui_impl.cpp

示例7: SDL_VERSION

	void SDLWindow::Alert (const char* message, const char* title) {
		
		#ifdef HX_WINDOWS
		
		int count = 0;
		int speed = 0;
		bool stopOnForeground = true;
		
		SDL_SysWMinfo info;
		SDL_VERSION (&info.version);
		SDL_GetWindowWMInfo (sdlWindow, &info);
		
		FLASHWINFO fi;
		fi.cbSize = sizeof (FLASHWINFO);
		fi.hwnd = info.info.win.window;
		fi.dwFlags = stopOnForeground ? FLASHW_ALL | FLASHW_TIMERNOFG : FLASHW_ALL | FLASHW_TIMER;
		fi.uCount = count;
		fi.dwTimeout = speed;
		FlashWindowEx (&fi);
		
		#endif
		
		if (message) {
			
			SDL_ShowSimpleMessageBox (SDL_MESSAGEBOX_INFORMATION, title, message, sdlWindow);
			
		}
		
	}
开发者ID:Tiago-Ling,项目名称:lime,代码行数:29,代码来源:SDLWindow.cpp

示例8: init_aclip

int init_aclip()
{
	SDL_SysWMinfo info;
	int retval;

	retval = -1;

	SDL_VERSION(&info.version);
#if SDL_VERSION_ATLEAST(2, 0, 0)
	if ( SDL_GetWindowWMInfo(host->video->Window(), &info) )
#else
	if ( SDL_GetWMInfo(&info) )
#endif
	{
		/* Save the information for later use */
		if ( info.subsystem == SDL_SYSWM_X11 ) {
			SDL_Display = info.info.x11.display;
			SDL_window = info.info.x11.window;
#if !SDL_VERSION_ATLEAST(2, 0, 0)
			Lock_Display = info.info.x11.lock_func;
			Unlock_Display = info.info.x11.unlock_func;
#endif

			/* Enable the special window hook events */
			SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);

			retval = 0;
		}
		else {
			SDL_SetError("SDL is not running on X11");
		}

	}
	return retval;
}
开发者ID:bobek,项目名称:aranym-debian,代码行数:35,代码来源:clipbrd_x11.cpp

示例9: SDL_COMPAT_GetWMInfo

int SDL_COMPAT_GetWMInfo(SDL_SysWMinfo *info)
{
  if(g_window)
    return SDL_GetWindowWMInfo(g_window, info);

  return -1;
}
开发者ID:Blonder,项目名称:oricutron,代码行数:7,代码来源:system_sdl.c

示例10: DebugPrintF

	bool SDLGameWindow::VInit()
	{
		/* Initialize SDL
		*/
		if (SDL_Init(SDL_INIT_TIMER) != 0) {
			DebugPrintF(VTEXT("SDL Failed to Initialize"));
            return false;
		}

		/*Create the SDL_Window handle*/
#ifdef UNICODE
		UConverter convert;
		std::string title = convert.to_bytes(m_params.title);
#else
		std::string title = m_params.title;
#endif
		m_windowHandle = SDL_CreateWindow(title.c_str(),
											m_params.x <= 0 ? SDL_WINDOWPOS_CENTERED : m_params.x,
											m_params.y <= 0 ? SDL_WINDOWPOS_CENTERED : m_params.y,
											m_params.width,
											m_params.height,
											SDL_WINDOW_OPENGL);
		if (!m_windowHandle) {
			SDL_Quit();
			DebugPrintF(VTEXT("Failed to created SDL_Window handle"));
            return false;
		}

#ifdef VIX_SYS_WINDOWS
        SDL_SysWMinfo info;
        SDL_VERSION(&info.version);
        if (SDL_GetWindowWMInfo(m_windowHandle, &info))
        {
            m_nativeHandle = info.info.win.window;
            if (m_renderer)
                m_renderer->VAttachNativeHandle(m_nativeHandle);
        }
#endif

#ifdef VIX_SYS_LINUX //for now
        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
		SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
		SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
		/*create OpenGL context*/
		m_context = SDL_GL_CreateContext(m_windowHandle);
		if (!m_context) {
			SDL_Quit();
			DebugPrintF(VTEXT("Failed to create SDL_GL_Context handle"));
            return false;
		}
#endif

		if (m_renderer && !m_renderer->VInitialize()) {
		  DebugPrintF(VTEXT("Renderer failed to initialize"));
			return false;
		}

		return true;
	}
开发者ID:GonzoBright,项目名称:VixenEngine,代码行数:59,代码来源:vix_sdlwindow.cpp

示例11: SDL_VERSION

static inline IDirectFBWindow *get_dfb_window(SDL_Window *window)
{
	SDL_SysWMinfo wm_info;
	SDL_VERSION(&wm_info.version);
	SDL_GetWindowWMInfo(window, &wm_info);

	return wm_info.info.dfb.window;
}
开发者ID:AG-Dev,项目名称:wesnoth_ios,代码行数:8,代码来源:SDL_DirectFB_render.c

示例12: browseFile

void browseFile(SDL_Window *window, const char *url) {
  SDL_SysWMinfo wminfo;
  SDL_VERSION(&wminfo.version);
  if (SDL_GetWindowWMInfo(window, &wminfo) == 1) {
    HWND hwnd = wminfo.info.win.window;
    ::ShellExecute(hwnd, "open", url, 0, 0, SW_SHOWNORMAL);
  }
}
开发者ID:MarcusWellby,项目名称:SmallBASIC,代码行数:8,代码来源:syswm.cpp

示例13: setWindow

void setWindow(SDL_Window* window)
{
	SDL_SysWMinfo window_info;
	SDL_VERSION(&window_info.version);
	SDL_GetWindowWMInfo(window, &window_info);
	Lumix::Engine::PlatformData platform_data = {};
	g_window = window_info.info.win.window;
}
开发者ID:gunsafighter,项目名称:LumixEngine,代码行数:8,代码来源:platform_interface.cpp

示例14: mode

Ogre::RenderWindow *ApplicationContext::createWindow()
{
    mRoot->initialise(false, mAppName);
    Ogre::NameValuePairList miscParams;
#if OGRE_PLATFORM == OGRE_PLATFORM_NACL
    miscParams["pp::Instance"] = Ogre::StringConverter::toString((unsigned long)mNaClInstance);
    miscParams["SwapCallback"] = Ogre::StringConverter::toString((unsigned long)mNaClSwapCallback);
    // create 1x1 window - we will resize later
    return mRoot->createRenderWindow(mAppName, mInitWidth, mInitHeight, false, &miscParams);

#elif OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
    miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(reinterpret_cast<size_t>(mAWindow));
    miscParams["androidConfig"] = Ogre::StringConverter::toString(reinterpret_cast<size_t>(mAConfig));
    miscParams["preserveContext"] = "true"; //Optionally preserve the gl context, prevents reloading all resources, this is false by default

    return Ogre::Root::getSingleton().createRenderWindow(mAppName, 0, 0, false, &miscParams);
#else
    Ogre::ConfigOptionMap ropts = mRoot->getRenderSystem()->getConfigOptions();

    Ogre::uint32 w, h;

    std::istringstream mode(ropts["Video Mode"].currentValue);
    Ogre::String token;
    mode >> w; // width
    mode >> token; // 'x' as seperator between width and height
    mode >> h; // height

    miscParams["FSAA"] = ropts["FSAA"].currentValue;
    miscParams["vsync"] = ropts["VSync"].currentValue;

#if OGRE_BITES_HAVE_SDL
    if(!SDL_WasInit(SDL_INIT_VIDEO)) {
        SDL_InitSubSystem(SDL_INIT_VIDEO);
    }

    mSDLWindow = SDL_CreateWindow(mAppName.c_str(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, SDL_WINDOW_RESIZABLE);

#if OGRE_PLATFORM == OGRE_PLATFORM_EMSCRIPTEN
    SDL_GL_CreateContext(mSDLWindow);
    miscParams["currentGLContext"] = "true";
#else
    SDL_SysWMinfo wmInfo;
    SDL_VERSION(&wmInfo.version);
    SDL_GetWindowWMInfo(mSDLWindow, &wmInfo);
#endif

#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
    miscParams["parentWindowHandle"] = Ogre::StringConverter::toString(size_t(wmInfo.info.x11.window));
#elif OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(size_t(wmInfo.info.win.window));
#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    assert(wmInfo.subsystem == SDL_SYSWM_COCOA);
    miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(size_t(wmInfo.info.cocoa.window));
#endif
#endif
    return mRoot->createRenderWindow(mAppName, w, h, false, &miscParams);
#endif
}
开发者ID:wjwwood,项目名称:ogre,代码行数:58,代码来源:OgreApplicationContext.cpp

示例15: ImGui_ImplSDL2_Init

static bool    ImGui_ImplSDL2_Init(SDL_Window* window)
{
    g_Window = window;

    // Setup back-end capabilities flags
    ImGuiIO& io = ImGui::GetIO();
    io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors;       // We can honor GetMouseCursor() values (optional)
#if SDL_HAS_WARP_MOUSE_GLOBAL
    io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos;        // We can honor io.WantSetMousePos requests (optional, rarely used)
#endif

    // Keyboard mapping. ImGui will use those indices to peek into the io.KeysDown[] array.
    io.KeyMap[ImGuiKey_Tab] = SDL_SCANCODE_TAB;
    io.KeyMap[ImGuiKey_LeftArrow] = SDL_SCANCODE_LEFT;
    io.KeyMap[ImGuiKey_RightArrow] = SDL_SCANCODE_RIGHT;
    io.KeyMap[ImGuiKey_UpArrow] = SDL_SCANCODE_UP;
    io.KeyMap[ImGuiKey_DownArrow] = SDL_SCANCODE_DOWN;
    io.KeyMap[ImGuiKey_PageUp] = SDL_SCANCODE_PAGEUP;
    io.KeyMap[ImGuiKey_PageDown] = SDL_SCANCODE_PAGEDOWN;
    io.KeyMap[ImGuiKey_Home] = SDL_SCANCODE_HOME;
    io.KeyMap[ImGuiKey_End] = SDL_SCANCODE_END;
    io.KeyMap[ImGuiKey_Insert] = SDL_SCANCODE_INSERT;
    io.KeyMap[ImGuiKey_Delete] = SDL_SCANCODE_DELETE;
    io.KeyMap[ImGuiKey_Backspace] = SDL_SCANCODE_BACKSPACE;
    io.KeyMap[ImGuiKey_Space] = SDL_SCANCODE_SPACE;
    io.KeyMap[ImGuiKey_Enter] = SDL_SCANCODE_RETURN;
    io.KeyMap[ImGuiKey_Escape] = SDL_SCANCODE_ESCAPE;
    io.KeyMap[ImGuiKey_A] = SDL_SCANCODE_A;
    io.KeyMap[ImGuiKey_C] = SDL_SCANCODE_C;
    io.KeyMap[ImGuiKey_V] = SDL_SCANCODE_V;
    io.KeyMap[ImGuiKey_X] = SDL_SCANCODE_X;
    io.KeyMap[ImGuiKey_Y] = SDL_SCANCODE_Y;
    io.KeyMap[ImGuiKey_Z] = SDL_SCANCODE_Z;

    io.SetClipboardTextFn = ImGui_ImplSDL2_SetClipboardText;
    io.GetClipboardTextFn = ImGui_ImplSDL2_GetClipboardText;
    io.ClipboardUserData = NULL;

    g_MouseCursors[ImGuiMouseCursor_Arrow] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
    g_MouseCursors[ImGuiMouseCursor_TextInput] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_IBEAM);
    g_MouseCursors[ImGuiMouseCursor_ResizeAll] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEALL);
    g_MouseCursors[ImGuiMouseCursor_ResizeNS] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENS);
    g_MouseCursors[ImGuiMouseCursor_ResizeEW] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEWE);
    g_MouseCursors[ImGuiMouseCursor_ResizeNESW] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENESW);
    g_MouseCursors[ImGuiMouseCursor_ResizeNWSE] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENWSE);
    g_MouseCursors[ImGuiMouseCursor_Hand] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_HAND);

#ifdef _WIN32
    SDL_SysWMinfo wmInfo;
    SDL_VERSION(&wmInfo.version);
    SDL_GetWindowWMInfo(window, &wmInfo);
    io.ImeWindowHandle = wmInfo.info.win.window;
#else
    (void)window;
#endif

    return true;
}
开发者ID:warrenm,项目名称:imgui,代码行数:58,代码来源:imgui_impl_sdl.cpp


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