如何找到专业的湛江百度SEO公司来优化福州地区的搜索引擎排名?

摘要:湛江百度seo公司,福州搜索引擎优化公司,淄博周村网站建设方案,济宁网站建设服务加载BMP 1.使用SDL_init初始化SDL库 2.使用SDL_CreateWindow创建一个窗口 3.使用SDL_GetWindowSurface获取创
湛江百度seo公司,福州搜索引擎优化公司,淄博周村网站建设方案,济宁网站建设服务加载BMP 1.使用SDL_init初始化SDL库 2.使用SDL_CreateWindow创建一个窗口 3.使用SDL_GetWindowSurface获取创建窗口的surface 4.使用SDL_LoadBMP加载一张BMP图片 5.使用SDL_BlitSurface将加载的bmp surface拷贝到窗口的surface 6.使用SDL_UpdateWindowSurface更新到窗口 …加载BMP 1.使用SDL_init初始化SDL库 2.使用SDL_CreateWindow创建一个窗口 3.使用SDL_GetWindowSurface获取创建窗口的surface 4.使用SDL_LoadBMP加载一张BMP图片 5.使用SDL_BlitSurface将加载的bmp surface拷贝到窗口的surface 6.使用SDL_UpdateWindowSurface更新到窗口 7.使用SDL_FreeSurface释放申请的空间 8.使用SDL_DestroyWindow销毁窗口 9.使用SDL_Quit释放SDL库 以下时完整代码 #include iostream #include sdl.hconst int SCREEN_WIDTH 640; const int SCREEN_HEIGHT 480;SDL_Window* gWindow nullptr; SDL_Surface* gScreenSurface nullptr; SDL_Surface* gHelloWorld nullptr;bool init() {bool success true;if (SDL_Init(SDL_INIT_VIDEO) 0){printf(SDL could not initialize!SDL Error:%s\n, SDL_GetError());success false;}else{//create windowgWindow SDL_CreateWindow(SDL tutorial, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN);if (gWindow nullptr){printf(window could not created!SDL_Error:%s\n, SDL_GetError());success false;}else{//get window surfacegScreenSurface SDL_GetWindowSurface(gWindow);}}return success; }bool loadMedia() {//loading success flagbool success true;//load splash imagegHelloWorld SDL_LoadBMP(../BMP2.bmp);if (gWindow nullptr){printf(unable to load image!SDL_ERROR%s\n,SDL_GetError());success false;}return success; }void close() {SDL_FreeSurface(gHelloWorld);gHelloWorld NULL;SDL_DestroyWindow(gWindow);gWindow NULL;SDL_Quit();}int main(int argc, char* args[]) {if (!init()){printf(failed to initialize!\n);}else{//load mediaif (!loadMedia()){printf(failed to load media!\n);}else{SDL_BlitSurface(gHelloWorld, nullptr, gScreenSurface, nullptr);//update the surfaceSDL_UpdateWindowSurface(gWindow);SDL_Event e;bool quit false;while (quit false){while (SDL_PollEvent(e)){if (e.type SDL_QUIT)quit true;}}}}close();return 0; } 加载PNG 由于默认的SDL库只能加载BMP格式的图片如果需要加载png
阅读全文