#include"DxLib.h" int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd){ if(ChangeWindowMode(TRUE) != DX_CHANGESCREEN_OK || DxLib_Init()==-1)return -1; int image[16];/*分割画像用変数*/ int x=640-24; int x2=0; char Key[256];/*キー入力用変数*/ LoadDivGraph("char.png",16,4,4,32,32,image); SetDrawScreen(DX_SCREEN_BACK); while(1){ ClearDrawScreen(); x-=3; x2+=3; DrawGraph(x,150,image[4],TRUE); DrawGraph(x2,350,image[12],TRUE); if(x<0)break; ScreenFlip(); } DxLib_End(); return 0; }を
#include"DxLib.h"
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd){
if(ChangeWindowMode(TRUE) != DX_CHANGESCREEN_OK || DxLib_Init()==-1)return -1;
int image[16];/*分割画像用変数*/
int x=640-24;
int x2=0;
char Key[256];/*キー入力用変数*/
LoadDivGraph("char.png",16,4,4,32,32,image);
SetDrawScreen(DX_SCREEN_BACK);
while(!ProcessMessage){
ClearDrawScreen();
x-=3;
x2+=3;
DrawGraph(x,150,image[4],TRUE);
DrawGraph(x2,350,image[12],TRUE);
if(x<0)break;
ScreenFlip();
}
DxLib_End();
return 0;
}
と繰り返しの条件にProcessMessageを入れると実行されないままプログラムが終了してしまいます。
なぜですか?