dx11/main.cpp
//-----------------------------------------------------------------------------
// [SECTION] general setup function implementations
//-----------------------------------------------------------------------------
[SECTION] general setup function implementations
[ SECTION ] general setup function implementations
static void
create_window()
{
    WNDCLASSEXW winClass = {};
    winClass.cbSize = sizeof(WNDCLASSEXW);
    winClass.style = CS_HREDRAW | CS_VREDRAW;
    winClass.lpfnWndProc = &WndProc;
    winClass.hInstance = ::GetModuleHandle(nullptr);
    winClass.hIcon = ::LoadIconW(0, IDI_APPLICATION);
    winClass.hCursor = ::LoadCursorW(0, IDC_ARROW);
    winClass.lpszClassName = L"MyWindowClass";
    winClass.hIconSm = ::LoadIconW(0, IDI_APPLICATION);
    if (!::RegisterClassExW(&winClass)) {
        ::MessageBoxA(0, "RegisterClassEx failed", "Fatal Error", MB_OK);
        assert(false);
    }
    RECT initialRect = { 0, 0, g_width, g_height };
    ::AdjustWindowRectEx(&initialRect, WS_OVERLAPPEDWINDOW, FALSE, WS_EX_OVERLAPPEDWINDOW);
    LONG initialWidth = initialRect.right - initialRect.left;
    LONG initialHeight = initialRect.bottom - initialRect.top;
    g_hwnd = ::CreateWindowExW(WS_EX_OVERLAPPEDWINDOW,
        winClass.lpszClassName,
        L"Directx 11",
        WS_OVERLAPPEDWINDOW | WS_VISIBLE,
        CW_USEDEFAULT, CW_USEDEFAULT,
        initialWidth,
        initialHeight,
        0, 0, ::GetModuleHandle(nullptr), 0);
    if (!g_hwnd) 
    {
        ::MessageBoxA(0, "CreateWindowEx failed", "Fatal Error", MB_OK);
        assert(false);
    }
}
static void create_window ( ) { WNDCLASSEXW winClass = { } ; winClass . cbSize = sizeof ( WNDCLASSEXW ) ; winClass . style = CS_HREDRAW | CS_VREDRAW ; winClass . lpfnWndProc = & WndProc ; winClass . hInstance = :: GetModuleHandle ( nullptr ) ; winClass . hIcon = :: LoadIconW ( 0 , IDI_APPLICATION ) ; winClass . hCursor = :: LoadCursorW ( 0 , IDC_ARROW ) ; winClass . lpszClassName = L" " ; winClass . hIconSm = :: LoadIconW ( 0 , IDI_APPLICATION ) ; if ( ! :: RegisterClassExW ( & winClass ) ) { :: MessageBoxA ( 0 , " " , " " , MB_OK ) ; assert ( false ) ; } RECT initialRect = { 0 , 0 , g_width , g_height } ; :: AdjustWindowRectEx ( & initialRect , WS_OVERLAPPEDWINDOW , FALSE , WS_EX_OVERLAPPEDWINDOW ) ; LONG initialWidth = initialRect . right - initialRect . left ; LONG initialHeight = initialRect . bottom - initialRect . top ; g_hwnd = :: CreateWindowExW ( WS_EX_OVERLAPPEDWINDOW , winClass . lpszClassName , L" " , WS_OVERLAPPEDWINDOW | WS_VISIBLE , CW_USEDEFAULT , CW_USEDEFAULT , initialWidth , initialHeight , 0 , 0 , :: GetModuleHandle ( nullptr ) , 0 ) ; if ( ! g_hwnd ) { :: MessageBoxA ( 0 , " " , " " , MB_OK ) ; assert ( false ) ; } }
[SECTION] general setup function implementations
[ SECTION ] general setup function implementations