为什么这么简单的程序就是不出结果?知道的朋友请告诉我。
程序复制到mfc下做一个控件的响应函数。const int SCREEN_WIDTH = 640; // 0 means use current width.
const int SCREEN_HEIGHT = 480; // 0 means use current height.
const int SCREEN_BPP = 32; // 0 means use current bpp.
const Uint32 SCREEN_FLAGS = SDL_SWSURFACE; // SDL_SWSURFACE == 0,surface in system memory.SDL_Surface* pScreen = 0;
pScreen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SCREEN_FLAGS); SDL_Surface* pShownBMP = 0;
pShownBMP = IMG_Load("love.bmp");
// pShownBMP = IMG_LoadTyped_RW("love.bmp");
SDL_Rect* pSrcRect = 0; // If pSrcRect is NULL, the entire source surface is copied. SDL_Rect* pDstRect = 0; // If pDstRect is NULL, then the destination position (upper left corner) is (0, 0
SDL_BlitSurface(pShownBMP, pSrcRect, pScreen, pDstRect); // Put the BMP's surface on theSDL_Flip(pScreen) ;
很奇怪这一行pShownBMP = IMG_Load("love.bmp"); 中 IMG_Load("love.bmp")不读图片,图片文件乱写一个也不报错 IMG_Load("losdfa232ve.bmp"),为什么啊? SDL_LoadBMP("love.bmp")也试过了。
程序复制到mfc下做一个控件的响应函数。const int SCREEN_WIDTH = 640; // 0 means use current width.
const int SCREEN_HEIGHT = 480; // 0 means use current height.
const int SCREEN_BPP = 32; // 0 means use current bpp.
const Uint32 SCREEN_FLAGS = SDL_SWSURFACE; // SDL_SWSURFACE == 0,surface in system memory.SDL_Surface* pScreen = 0;
pScreen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SCREEN_FLAGS); SDL_Surface* pShownBMP = 0;
pShownBMP = IMG_Load("love.bmp");
// pShownBMP = IMG_LoadTyped_RW("love.bmp");
SDL_Rect* pSrcRect = 0; // If pSrcRect is NULL, the entire source surface is copied. SDL_Rect* pDstRect = 0; // If pDstRect is NULL, then the destination position (upper left corner) is (0, 0
SDL_BlitSurface(pShownBMP, pSrcRect, pScreen, pDstRect); // Put the BMP's surface on theSDL_Flip(pScreen) ;
很奇怪这一行pShownBMP = IMG_Load("love.bmp"); 中 IMG_Load("love.bmp")不读图片,图片文件乱写一个也不报错 IMG_Load("losdfa232ve.bmp"),为什么啊? SDL_LoadBMP("love.bmp")也试过了。
解决方案 »
- IIS6.0中接收客户端发送的POST数据问题
- 如果获得箭头键消息响应?
- 菜鸟问题006:怎样实现声音文件的播放啊?
- 在线等待经典ACE网络资料网址
- 调试问题?
- 急急急~~~~~~~100分求助 哪位大哥用vc做过虚拟万用表?给个程序参考一下阿 谢谢
- Socket通信中不知对方IP只知MAC地址能发信息给对方吗
- 关于连接数据库!!帮帮忙!
- 这是我的第一个发布的软件,http://www.csdn.net/cnshare/soft/10/10423.shtm,请指教!
- wireshark抓到数据包,但是应用程序没有收到,可能是什么原因?
- 关于细节图删除的问题
- 谁能给我讲讲CString str 和CString str[]的区别?
SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.
#include "SDL.h"
SDL_Surface *SDL_LoadBMP(const char *file);Description
Loads a surface from a named Windows BMP file.Return Value
Returns the new surface, or NULL if there was an error