SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, DWORD flags) { SDL_FreeSurface(__sdl_vsurf); __sdl_vsurf = SDL_CreateRGBSurface(SDL_HWSURFACE, width, height, bpp, 0, 0, 0, 0); setclientsize(__sdl_hWnd, width, height); return(__sdl_vsurf); }
int GXOpenDisplay(HWND hWnd, DWORD dwFlags) { DWORD winstyle; DWORD winstyleex; _BMPINFO bi; HDC hdc; HWND hTaskBar; if (gxhwnd) { goto gxopn_err1; } gx_init(); gxhwnd = hWnd; // bitmap���B ZeroMemory(&bi, sizeof(bi)); bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bi.bmiHeader.biWidth = gxdp.cxWidth; bi.bmiHeader.biHeight = 0 - gxdp.cyHeight; bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biBitCount = 16; bi.bmiHeader.biCompression = BI_BITFIELDS; bi.bmiColors[0] = 0xf800; bi.bmiColors[1] = 0x07e0; bi.bmiColors[2] = 0x001f; hdc = GetDC(NULL); hgxbmp = CreateDIBSection(hdc, (BITMAPINFO *)&bi, DIB_RGB_COLORS, &gximage, NULL, 0); ReleaseDC(NULL, hdc); if (hgxbmp == NULL) { goto gxopn_err2; } ZeroMemory(gximage, gxdp.cbyPitch * gxdp.cyHeight); gxold = (SUBCLASSPROC)GetWindowLong(hWnd, GWL_WNDPROC); SetWindowLong(hWnd, GWL_WNDPROC, (LONG)gxdraw); if (GXFlag & GX_WINDOW) { setclientsize(hWnd, WINDOW_WIDTH, WINDOW_HEIGHT); } else { hTaskBar = FindWindow(taskbarclass, NULL); if (hTaskBar) { ShowWindow(hTaskBar, SW_HIDE); } winstyle = GetWindowLong(hWnd, GWL_STYLE); gxhwndstyle = winstyle; winstyleex = GetWindowLong(hWnd, GWL_EXSTYLE); gxhwndstyleex = winstyleex; winstyle &= ~(WS_CAPTION | WS_OVERLAPPED | WS_SYSMENU); winstyle |= WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; winstyleex |= WS_EX_TOPMOST; SetWindowLong(hWnd, GWL_STYLE, winstyle); SetWindowLong(hWnd, GWL_EXSTYLE, winstyleex); SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER); MoveWindow(hWnd, 0, 0, GXWidth, GXHeight, TRUE); } return(1); gxopn_err2: gxhwnd = NULL; gximage = NULL; gxopn_err1: return(0); }