/** * \brief Toogle window ontop attribute. * * Should be called on VOCTRL_ONTOP event. * * Global libvo variables changed: * vo_ontop */ void vo_w32_ontop( void ) { vo_ontop = !vo_ontop; if (!vo_fs) { createRenderingContext(); } }
/** * \brief Configure and show window on the screen. * * This function should be called in libvo's "config" callback. * It configures a window and shows it on the screen. * * Global libvo variables changed: * vo_fs * vo_vm * * \return 1 - Success, 0 - Failure */ int vo_w32_config(uint32_t width, uint32_t height, uint32_t flags) { PIXELFORMATDESCRIPTOR pfd; int pf; HDC vo_hdc = vo_w32_get_dc(vo_window); memset(&pfd, 0, sizeof pfd); pfd.nSize = sizeof pfd; pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; if (flags & VOFLAG_STEREO) pfd.dwFlags |= PFD_STEREO; pfd.iPixelType = PFD_TYPE_RGBA; pfd.cColorBits = 24; pfd.iLayerType = PFD_MAIN_PLANE; pf = ChoosePixelFormat(vo_hdc, &pfd); if (!pf) { mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to select a valid pixel format!\n"); vo_w32_release_dc(vo_window, vo_hdc); return 0; } SetPixelFormat(vo_hdc, pf, &pfd); vo_w32_release_dc(vo_window, vo_hdc); // we already have a fully initialized window, so nothing needs to be done if (flags & VOFLAG_HIDDEN) return 1; // store original size for videomode switching o_dwidth = width; o_dheight = height; if (WinID < 0) { // the desired size is ignored in wid mode, it always matches the window size. prev_width = vo_dwidth = width; prev_height = vo_dheight = height; prev_x = vo_dx; prev_y = vo_dy; } vo_fs = flags & VOFLAG_FULLSCREEN; vo_vm = flags & VOFLAG_MODESWITCHING; return createRenderingContext(); }
/** * \brief Configure and show window on the screen. * * This function should be called in libvo's "config" callback. * It configures a window and shows it on the screen. * * Global libvo variables changed: * vo_fs * vo_vm * * \return 1 - Success, 0 - Failure */ int vo_w32_config(uint32_t width, uint32_t height, uint32_t flags) { // we already have a fully initialized window, so nothing needs to be done if (flags & VOFLAG_HIDDEN) return; // store original size for videomode switching o_dwidth = width; o_dheight = height; if (WinID < 0) { // the desired size is ignored in wid mode, it always matches the window size. prev_width = vo_dwidth = width; prev_height = vo_dheight = height; prev_x = vo_dx; prev_y = vo_dy; } vo_fs = flags & VOFLAG_FULLSCREEN; vo_vm = flags & VOFLAG_MODESWITCHING; return createRenderingContext(); }
/** * \brief Toogle window border attribute. * * Should be called on VOCTRL_BORDER event. * * Global libvo variables changed: * vo_border */ void vo_w32_border(void) { vo_border = !vo_border; createRenderingContext(); }
void vo_w32_fullscreen(void) { vo_fs = !vo_fs; createRenderingContext(); }