PngImage::PngImage(const char *file_name) { png_image_t *png_image = new png_image_t(); ImageLoader::LoadPNGImage(file_name, png_image); this->bitDepth = png_image->bit_depth; this->colorType = png_image->color_type; CreateBitMap(png_image->row_pointers, png_image->width, png_image->height); }
int GAPI_ShowTaskBar() { if(!bShowTaskBar) { int topBorder, bottomBorder; RECT rc; //Take screen shot CreateBitMap(); //Need close the GAPI to give key control back to the system CloseGAPI(); //ShowWindow(SDL_Window, SW_HIDE); SHFullScreen(SDL_Window, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON); bShowTaskBar = 1; GetTopBottomBorder(&topBorder, &bottomBorder); SDL_WM_SetCaption(GetGameTitle(), NULL); SHDoneButton(SDL_Window, SHDB_HIDE); { //http://forum.soft32.com/pda/SHCreateMenuBar-resource-file-ftopict47431.html SHMENUBARINFO cbi; memset(&cbi, 0, sizeof(SHMENUBARINFO)); menuBar = NULL; cbi.cbSize = sizeof(SHMENUBARINFO); cbi.hwndParent = SDL_Window; cbi.hInstRes = SDL_Instance; cbi.nToolBarId = IDR_MENUBAR; //cbi.dwFlags = /*SHCMBF_EMPTYBAR |*/ SHCMBF_HIDESIPBUTTON | SHCMBF_HMENU; //Don't use this with the Smartphone menu if(SHCreateMenuBar(&cbi)) { menuBar = (HMENU)cbi.hwndMB; } } //http://msdn.microsoft.com/en-us/library/aa453694.aspx SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, FALSE); MoveWindow(SDL_Window, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE); //Show the game menu, but not the incoming call menu SetWindowPos(GetForegroundWindow(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE); //Show incoming call window SetWindowPos(SDL_Window, HWND_NOTOPMOST, /*0, 0, 1, 1*/sdlWindowSize.left, sdlWindowSize.top + topBorder, sdlWindowSize.right, sdlWindowSize.bottom - (topBorder + bottomBorder), SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_SHOWWINDOW); //Allow to show the incomming call window if(menuBar) writeDebugInfo("GAPI_ShowTaskBar Menu Ok"); else { char buf[64]; sprintf(buf, "GAPI_ShowTaskBar No Menu, Error: %ld", GetLastError()); writeDebugInfo(buf); } return 1; } return 0; }