源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

sdl显示一张bmp图片示例

  • 时间:2022-03-11 11:21 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:sdl显示一张bmp图片示例
lesson01.cpp
[u]复制代码[/u] 代码如下:
/*This source code copyrighted by Lazy Foo' Productions (2004-2013) and may not be redistributed without written permission.*/ //Include SDL functions and datatypes #include "SDL/SDL.h" int main( int argc, char* args[] ) {     //The images     SDL_Surface* hello = NULL;     SDL_Surface* screen = NULL;     //Start SDL     SDL_Init( SDL_INIT_EVERYTHING );     //Set up screen     screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );     //Load image     hello = SDL_LoadBMP( "hello.bmp" );     //Apply image to screen     SDL_BlitSurface( hello, NULL, screen, NULL );     //Update Screen     SDL_Flip( screen );     //Pause     SDL_Delay( 2000 );     //Free the loaded image     SDL_FreeSurface( hello );     //Quit SDL     SDL_Quit();     return 0; }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部