Пример #1
0
void _gfx_platform_window_free(

		GFX_PlatformWindow handle)
{
	/* Make sure to undo fullscreen */
	GFX_Win32_Window* it = _gfx_win32_get_window_from_handle(handle);
	if(it->flags & GFX_WIN32_FULLSCREEN)
		_gfx_win32_leave_fullscreen(it->monitor);

	/* Destroy the context and window */
	_gfx_platform_context_clear(handle);
	DestroyWindow(handle);

	/* Remove from vector */
	gfx_vector_erase(&_gfx_win32.windows, it);
}
Пример #2
0
void _gfx_platform_window_free(

		GFX_PlatformWindow handle)
{
	GFX_X11_Window* it =
		_gfx_x11_get_window_from_handle(GFX_VOID_TO_UINT(handle));

	/* Get attributes */
	XWindowAttributes attr;
	XGetWindowAttributes(_gfx_x11.display, GFX_VOID_TO_UINT(handle), &attr);

	/* Make sure to undo fullscreen */
	if(it->flags & GFX_X11_FULLSCREEN)
		_gfx_x11_leave_fullscreen(it->monitor);

	/* Destroy context, the window and its colormap */
	_gfx_platform_context_clear(handle);
	XDestroyWindow(_gfx_x11.display, GFX_VOID_TO_UINT(handle));
	XFreeColormap(_gfx_x11.display, attr.colormap);

	/* Remove from vector */
	gfx_vector_erase(&_gfx_x11.windows, it);
}