#include "DxLib.h"

#define GRAPHIC_BACKGROUND_FILENAME "./pic/back.png"
#define GRAPHIC_SELECTBOX_FILENAME  "./pic/select.png"

#define SELECT_BOX_X 50
#define SELECT_BOX_Y 200

#define SELECT_BOX_WIDTH 700
#define SELECT_BOX_HEIGHT 50

#define SELECT_BOX_MESSAGE_Y 20

#define FONT_SIZE 16

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
						 LPSTR lpCmdLine, int nCmdShow )
{
	//ウィンドウモードで起動
	ChangeWindowMode( TRUE );
	//画面の大きさは800 * 600
	SetGraphMode( 800, 600 , 16 ) ;
	//DxLib初期化
	if( DxLib_Init() == -1 ) {
		 return -1;
	}

	// 描画先を裏画面にセット
	SetDrawScreen( DX_SCREEN_BACK );

	//フォントの大きさをセット
	SetFontSize( FONT_SIZE );

	//白
	int whiteColor = GetColor(255, 255, 255);
	//背景の読み込み
	int backgroundGraphic = LoadGraph( GRAPHIC_BACKGROUND_FILENAME );
	//選択ボックスの読み込み
	int selectBoxGraphicHandle = LoadGraph( GRAPHIC_SELECTBOX_FILENAME ); 

	//メインループ
	while( ProcessMessage() == 0 && CheckHitKey( KEY_INPUT_ESCAPE ) == 0 ) {

		//画面クリア
		ClearDrawScreen();

		//背景を描画
		DrawGraph( 0, 0, backgroundGraphic, FALSE );		
		//透明度50％とする
		SetDrawBlendMode( DX_BLENDMODE_ALPHA , 128 );
		//選択ボックスの描画(選択肢2つの場合)
		DrawGraph( SELECT_BOX_X, SELECT_BOX_Y, selectBoxGraphicHandle, TRUE );
		DrawGraph( SELECT_BOX_X, SELECT_BOX_Y + SELECT_BOX_HEIGHT,
			selectBoxGraphicHandle, TRUE);
		//アルファブレンドを元に戻す
		SetDrawBlendMode( DX_BLENDMODE_NOBLEND , 0 );

		//適当に文字を表示する
		DrawString(SELECT_BOX_X + 20, SELECT_BOX_Y + SELECT_BOX_MESSAGE_Y,
			"選択肢1 あいうえおかきくけこ", whiteColor);
		DrawString(SELECT_BOX_X + 20, SELECT_BOX_Y + SELECT_BOX_HEIGHT + SELECT_BOX_MESSAGE_Y,
			"選択肢2 さしすせそたちつてと", whiteColor);

		ScreenFlip();
	}

	DxLib_End();
	return 0;
}
