Willさん、返信ありがとうございます。
コードはだいたいこんな感じになっています。
////DLLのファイル
//ヘッダー
#include "stdafx.h"
#ifdef EXPORTS
#define DLL __declspec(dllexport)
#else
#define DLL __declspec(dllimport)
#endif
class DLL Graphic{
int GrHandle;
public:
Graphic(char* FileName){
GrHandle=LoadGraph(FileName);
}
int Draw(int X,int Y){
return DrawGraph(X,Y,GrHandle,TRUE);
}
};
////呼び出し側
//main.cpp
#include "stdafx.h" //DXライブラリはここで読み込んでいます。
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
SetGraphMode(WindowX,WindowY,32);
ChangeWindowMode(true);
if( DxLib_Init() < 0 )
{
return -1;
}
SetDrawScreen( DX_SCREEN_BACK );
Graphic *img = new Graphic("hoge.png");
while(ProcessMessage() == 0 && )
{
ClearDrawScreen();
img->Draw(0,0);
ScreenFlip();
}
DxLib_End() ;
return 0 ;
}
こんな感じで使っているのですが・・・。
初期化は呼び出し側のプログラムですればいいんですよね?