static void GLoption(int allegro, int sdl) { int i; int x = al_get_new_display_option(allegro, &i); if (i == ALLEGRO_DONTCARE) return; SDL_GL_SetAttribute(sdl, x); }
HWND _al_win_create_faux_fullscreen_window(LPCTSTR devname, ALLEGRO_DISPLAY *display, int x1, int y1, int width, int height, int refresh_rate, int flags) { HWND my_window; DWORD style; DWORD ex_style; DEVMODE mode; LONG temp; (void)display; (void)flags; style = WS_VISIBLE; /* Not WS_EX_TOPMOST because user might want to tab away */ ex_style = 0; my_window = CreateWindowEx(ex_style, "ALEX", "Allegro", style, x1, y1, width, height, NULL,NULL,window_class.hInstance,0); temp = GetWindowLong(my_window, GWL_STYLE); temp &= ~WS_CAPTION; SetWindowLong(my_window, GWL_STYLE, temp); SetWindowPos(my_window, 0, 0,0, width, height, SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED); /* Go fullscreen */ memset(&mode, 0, sizeof(DEVMODE)); mode.dmSize = sizeof(DEVMODE); mode.dmDriverExtra = 0; mode.dmBitsPerPel = al_get_new_display_option(ALLEGRO_COLOR_SIZE, NULL); mode.dmPelsWidth = width; mode.dmPelsHeight = height; mode.dmDisplayFlags = 0; mode.dmDisplayFrequency = refresh_rate; mode.dmPosition.x = x1; mode.dmPosition.y = y1; mode.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT|DM_DISPLAYFLAGS| DM_DISPLAYFREQUENCY|DM_POSITION; ChangeDisplaySettingsEx(devname, &mode, NULL, 0, NULL/*CDS_FULLSCREEN*/); return my_window; }