いつもDXライブラリを楽しく使わせていただいてます
既存プログラムのAndroid移植がとてもスムーズに出来てビックリしました
スマホにキーボードを繋げばちゃんと認識・動作もしてくれるし素晴らしいです!
今回、バグらしき挙動を確認しましたのでご報告致します。
//=====
プログラム実行中にフルスクリーン切替を行うと、文字化けする事象が発生しました。
Windows版 VisualC++ 用のTest最新版で確認しております。(2017/9/9最終更新)
以下の条件下で発生するようです。
・UTF-8を使用
・CreateFontToHandle関数のFontNameに存在しないフォント名を与えた場合
(NULLを与えた場合は発生しないようです)
以下事象確認のサンプルプログラムとなります、
ENTERキーでフルスクリーンモードの切替を行うと、文字化けが発生します。
#include "DxLib.h"
#include <string>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
SetChangeScreenModeGraphicsSystemResetFlag(FALSE);
ChangeWindowMode(TRUE);
SetUseCharCodeFormat(DX_CHARCODEFORMAT_UTF8);
DxLib_Init();
SetDrawScreen(DX_SCREEN_BACK);
std::string str = u8"ABC %d あいう";
int Font ;
if (true) {
Font = CreateFontToHandle(u8"存在しないフォント名", -1, -1); //切替時文字化け
}
else {
Font = CreateFontToHandle(NULL, -1, -1); //問題なし
}
bool Push = false;
while (ProcessMessage() == 0 && ClearDrawScreen() == 0) {
if (DxLib::CheckHitKey(KEY_INPUT_RETURN) && Push == false) {
Push = true;
DxLib::ChangeWindowMode(!(DxLib::GetWindowModeFlag() == 1));
}
else {
Push = false;
}
DrawString(0, 0, str.c_str(), GetColor(0xFF, 0xFF, 0xFF));
DrawFormatString(0, 20, GetColor(0xFF, 0xFF, 0xFF), str.c_str(), 10 + 20);
DrawStringToHandle(0, 40, str.c_str(), GetColor(0xFF, 0xFF, 0xFF), Font);
DrawFormatStringToHandle(0, 60, GetColor(0xFF, 0xFF, 0xFF), Font, str.c_str(), 10 + 20);
DrawExtendStringToHandle(0, 80,1,1, str.c_str(), GetColor(0xFF, 0xFF, 0xFF), Font);
DrawExtendFormatStringToHandle(0, 100,1,1, GetColor(0xFF, 0xFF, 0xFF), Font, str.c_str(), 10 + 20);
ScreenFlip();
}
DxLib_End();
return 0;
}