// Construct options from command line arguments UpdaterOptions(int argc, char* argv[]) { SetupDescription(); ParseFromCommandLine(argc, argv); for (int i = 1; i < argc; ++i) { _cmdLineArgs.push_back(argv[i]); } }
void D3DTexture2D::Initialize(int width, int height, DXGI_FORMAT format, UINT bind, UINT misc, const D3D11_SUBRESOURCE_DATA* data) { D3D11_TEXTURE2D_DESC desc; this->width = width; this->height = height; SetupDefaultDescription(desc, width, height, format, bind, misc); // 派生クラスによるオーバーライド // この辺、付け焼刃な感じなので後で変える可能性あり SetupDescription(desc); auto device = core->GetDevice(); auto hresult = device->CreateTexture2D(&desc, data, &this->texture); this->AddResource(HndToRes(texture)); if (bind & D3D10_BIND_SHADER_RESOURCE) { // ShaderResourceViewの作成 device->CreateShaderResourceView(texture, nullptr, &srv); this->AddResource(HndToRes(srv)); } else { srv = nullptr; } if (bind & D3D10_BIND_RENDER_TARGET) { // RenderTargetViewの作成 device->CreateRenderTargetView(texture, nullptr, &rtv); this->AddResource(HndToRes(rtv)); } else { rtv = nullptr; } if (bind & D3D10_BIND_DEPTH_STENCIL) { // DepthStencilViewの作成 device->CreateDepthStencilView(texture, nullptr, &dsv); this->AddResource(HndToRes(dsv)); } else { dsv = nullptr; } }
UpdaterOptions() { SetupDescription(); }