単純に、[ RED = 赤 ]・[ BLACK = 黒 ]など、変更が無いものならば、#defineでマクロ化しても良いのでは?
ヘッダファイルを作成して、そこにパレット用のマクロを全て定義して、
利用するソースファイルでインクルードすれば、問題なく利用できると思いますが・・・
仮に
・GV.h
#include "DxLib.h"
#include "function.h"
#define RED GetColor(255, 0, 0 )
#define BLACK GetColor( 0, 0, 0 )
・function.h
extern int DBox( int x1, int y1, int x2, int y2, int col );
・DBox.cpp
#include "GV.h"
int DBox( int x1, int y1, int x2, int y2, int col ){
DrawBox( x1, y1, x2, y2, col, TRUE );
return 0;
}
・ctest.cpp
#include "GV.h"
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ){
ChangeWindowMode( TRUE );
if( DxLib_Init() != 0 ) return -1;
SetDrawScreen( DX_SCREEN_BACK ) ;
// ループ
while( ProcessMessage() == 0 && CheckHitKey( KEY_INPUT_ESCAPE ) == 0 )
{
DBox( 0, 0, 100, 100, RED );
DrawString( 0, 0, "test", BLACK ) ;
ScreenFlip();
}
return 0;
}
※修正追記
・仮のソースはC言語的にクラスを使わずに記述していますが、
クラスを使用しても基本的に通用すると思います・・・