ゲーム制作の為にC言語を勉強中の者です。
今龍神録のプログラムの一例を参考にして画像の描写をしているのですが、画像が描写されません。龍神録のとは書き方が一部異なりますが、それが原因なのでしょうか・・・
↓今組んでる全てのプログラム
main.cpp
#define GLOBAL_INSTANCE
#include "DxLib.h"
#include "GV.h"
#include "sturuct.h"
extern int GetHitKeyStateAll_2();
extern int CheckStateKey(unsigned char Handle);
extern void load();
extern void graph_main();
int img_ch[2][12];
ch_t ch;
//ループで必ず行う処理
int ProcessLoop(){
if(ProcessMessage()!=0)return -1;
if(ClearDrawScreen()!=0)return -1;
GetHitKeyStateAll_2();
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){
ChangeWindowMode(TRUE);
if(DxLib_Init() == -1 || SetDrawScreen( DX_SCREEN_BACK )!=0) return -1;//一括した
load();
while(ProcessLoop()==0){//メインループ
graph_main();
if(CheckStateKey(KEY_INPUT_ESCAPE)==1)break;
ScreenFlip();//裏画面反映
}
DxLib_End(); // DXライブラリ終了処理
return 0;
}
#include "DxLib.h"
#include "GV.h"
unsigned int stateKey[256];
int Key[256];
int GetHitKeyStateAll_2(){
char GetHitKeyStateAll_Key[256];
GetHitKeyStateAll( GetHitKeyStateAll_Key );
for(int i=0;i<256;i++){
if(GetHitKeyStateAll_Key[i]==1) stateKey[i]++;
else stateKey[i]=0;
}
return 0;
}
int CheckStateKey(unsigned char Handle){
return stateKey[Handle];
}
#include "DxLib.h"
#include "GV.h"
#include "sturuct.h"
extern int img_ch[2][12];
void load(){
LoadDivGraph( "../画像/キャラ画像/chara.png" , 96 , 12 , 8 , 20 , 30 , img_ch[0] ) ;
}
#include "DxLib.h"
#include "GV.h"
#include "sturuct.h"
extern ch_t ch;
extern int img_ch[2][12];
void graph_ch(){
DrawRotaGraphF(ch.x,ch.y,1.0f,0.0f,img_ch[0][ch.img],TRUE);
}
void graph_main(){
graph_ch();
}
typedef struct{
int flag; //フラグ
int cnt; //カウンタ
int power; //パワー
int point; //ポイント
int score; //スコア
int num; //残機数
int mutekicnt; //無敵状態とカウント
int shot_mode; //ショットモード
int money; //お金
int img; //画像
int slow; //スローかどうか
double x,y; //座標
}ch_t;
一体どこがおかしいのでしょうか?