zoukankan      html  css  js  c++  java
  • C语言调用DIRECT3D的实例代码,通过lpVtbl字段进行

    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)
            {

            }
        }

  • 相关阅读:
    个人总结08
    npm快速入门
    Activity简介
    SELinux
    正则表达式学习笔记(二)表达式的匹配原理
    git学习笔记(一)
    使用VSFTPD传输文件
    正则表达式学习笔记(一)正则表达式入门
    Linux基础(一)磁盘分区
    Shell脚本笔记(九)数组
  • 原文地址:https://www.cnblogs.com/swnuwangyun/p/8805932.html
Copyright © 2011-2022 走看看