13 years C/C++/C# programing, focus on embedded and mobile device development.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

m_pDirect3D9 = Direct3DCreate9(D3D_SDK_VERSION);

    int w = 1920;
    int h = 1080;

    D3DPRESENT_PARAMETERS d3dpp;
    ZeroMemory(&d3dpp, sizeof(d3dpp));
    d3dpp.BackBufferWidth = w;
    d3dpp.BackBufferHeight = h;
    d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
    d3dpp.BackBufferCount = 1;
    d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
    d3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
    d3dpp.hDeviceWindow = NULL;
    d3dpp.Windowed = TRUE;
    d3dpp.EnableAutoDepthStencil = FALSE;
    d3dpp.Flags = D3DPRESENTFLAG_VIDEO;
    d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;

    LRESULT result = m_pDirect3D9->lpVtbl->CreateDevice(m_pDirect3D9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED, &d3dpp, &m_pDirect3DDevice);
    if (SUCCEEDED(result))
    {
        result = m_pDirect3DDevice->lpVtbl->CreateTexture(m_pDirect3DDevice, w, h, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &managedTexture, gc->shtex_data->tex_handle);
        if (result)
        {

        }
    }

posted on 2018-04-12 10:38  woaiusd  阅读(425)  评论(0编辑  收藏  举报