1 module minimum; 2 3 import core.stdc.locale; 4 import dxlib_d; 5 6 nothrow @nogc 7 int hello_dxlib() 8 9 do 10 { 11 debug { 12 } else { 13 SetOutApplicationLogValidFlag(dxlib_d.DxDataType.FALSE); 14 } 15 16 SetGraphMode(800, 600, 32); 17 18 version (Windows) { 19 dxlib_d.DxFunctionWin.ChangeWindowMode(dxlib_d.DxDataType.TRUE); 20 } 21 22 version (ANSI) { 23 SetUseCharCodeFormat(DX_CHARCODEFORMAT_UTF8); 24 setlocale(LC_ALL, ".utf8"); 25 } 26 27 SetAlwaysRunFlag(dxlib_d.DxDataType.TRUE); 28 29 if (DxLib_Init() == -1) { 30 return 1; 31 } 32 33 scope (exit) { 34 DxLib_End(); 35 } 36 37 DrawString(10, 10, "Hello, World!", GetColor(255, 255, 255)); 38 39 while (ProcessMessage() == 0) { 40 WaitKey(); 41 42 break; 43 } 44 45 return 0; 46 } 47 48 version (Windows) { 49 extern (Windows) 50 nothrow @nogc 51 int WinMain(dxlib_d.DxDataType.HINSTANCE hInstance, dxlib_d.DxDataType.HINSTANCE hPrevInstance, dxlib_d.DxDataType.LPSTR lpCmdLine, int nCmdShow) 52 53 do 54 { 55 return .hello_dxlib(); 56 } 57 } else { 58 extern (C) 59 nothrow @nogc 60 int main() 61 62 do 63 { 64 return .hello_dxlib(); 65 } 66 }