Skip to content

Instantly share code, notes, and snippets.

@yashihei
Last active January 2, 2016 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yashihei/8259257 to your computer and use it in GitHub Desktop.
Save yashihei/8259257 to your computer and use it in GitHub Desktop.
オレオレ仕様Dxlibのmain.cpp
#include <Dxlib.h>
#pragma warning(disable:4996)
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ) {
//SetGraphMode();画面サイズ任意
if (MessageBox(NULL,"フルスクリーンで起動しますか?","起動オプション",MB_YESNO) == IDYES) {
ChangeWindowMode(FALSE);
} else {
ChangeWindowMode(TRUE);
}
SetOutApplicationLogValidFlag(FALSE);
SetMainWindowText("HOGE");
if (DxLib_Init() == -1) return -1;
SetDrawScreen(DX_SCREEN_BACK);
//フォント読み込み
//const char* font_path = "dat/hoge.ttf";
//AddFontResourceEx(font_path, FR_PRIVATE, NULL);
//ChangeFont("BM mini", DX_CHARSET_DEFAULT);
//SetFontSize(18);
//デバグ用にコンソール出してやる
AllocConsole();
freopen("CONOUT$", "w", stdout);
while (ProcessMessage() == 0) {
ClearDrawScreen();
ScreenFlip();
}
// RemoveFontResourceEx(font_path, FR_PRIVATE, NULL);
FreeConsole();
DxLib_End();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment