当前位置: 首页>>代码示例>>C++>>正文


C++ Nullable::Get方法代码示例

本文整理汇总了C++中Nullable::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ Nullable::Get方法的具体用法?C++ Nullable::Get怎么用?C++ Nullable::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nullable的用法示例。


在下文中一共展示了Nullable::Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CObject

CObject *CreateBox()
{
	static Nullable < SGeometry > boxGeo;
	if( boxGeo.IsNull() )
	{
		Geometry::BoxTN( &boxGeo.Get(), true );
	}

	SGeometrySlice slice;
	slice.indicesCount = boxGeo->indicesCount;
	slice.is_defined = true;
	slice.startIndex = 0;
	slice.startVertex = 0;
	slice.verticesCount = boxGeo->verticesCount;

	D3D11_SAMPLER_DESC o_sampDef;
    o_sampDef.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
    o_sampDef.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
    o_sampDef.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
    o_sampDef.BorderColor[ 0 ] = 1.f;
    o_sampDef.BorderColor[ 1 ] = 1.f;
    o_sampDef.BorderColor[ 2 ] = 1.f;
    o_sampDef.BorderColor[ 3 ] = 1.f;
    o_sampDef.ComparisonFunc = D3D11_COMPARISON_NEVER;
    o_sampDef.Filter = D3D11_FILTER_ANISOTROPIC;
    o_sampDef.MaxAnisotropy = 16;
    o_sampDef.MaxLOD = FLT_MAX;
    o_sampDef.MinLOD = -FLT_MAX;
    o_sampDef.MipLODBias = 0.f;

	D3D11_BLEND_DESC o_blend = {};
    o_blend.AlphaToCoverageEnable = false;
    o_blend.IndependentBlendEnable = false;
    o_blend.RenderTarget[ 0 ].BlendEnable = true;
    o_blend.RenderTarget[ 0 ].SrcBlend = D3D11_BLEND_SRC_ALPHA;
    o_blend.RenderTarget[ 0 ].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
    o_blend.RenderTarget[ 0 ].BlendOp = D3D11_BLEND_OP_ADD;
    o_blend.RenderTarget[ 0 ].SrcBlendAlpha = D3D11_BLEND_ZERO;
    o_blend.RenderTarget[ 0 ].DestBlendAlpha = D3D11_BLEND_ZERO;
    o_blend.RenderTarget[ 0 ].BlendOpAlpha = D3D11_BLEND_OP_ADD;
    o_blend.RenderTarget[ 0 ].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;

	D3D11_RASTERIZER_DESC o_rsDesc;
    o_rsDesc.AntialiasedLineEnable = false;
    o_rsDesc.CullMode = D3D11_CULL_BACK;
    o_rsDesc.DepthBias = 0;
    o_rsDesc.DepthBiasClamp = 0.f;
    o_rsDesc.DepthClipEnable = true;
    o_rsDesc.FillMode = D3D11_FILL_SOLID;
    o_rsDesc.FrontCounterClockwise = false;
    o_rsDesc.MultisampleEnable = false;
    o_rsDesc.ScissorEnable = false;
    o_rsDesc.SlopeScaledDepthBias = 0.f;

	CVec < STex, void > tex;
	tex.EmplaceBack( TextureLoader::Load( "Textures/Best-Desktop-Background-130.jpg" ), &o_sampDef, vec2( 0 ), vec2( 4000, 4 ), vec2( 0.75, 0.75 ), 0 );

	CVec < SMaterial, void > mat;
	mat.EmplaceBack( &boxGeo.Get(), slice, 1, 0, std::move( tex ), ShadersManager::AcquireByName( "lightless" ), &o_blend, &o_rsDesc, Colora::White, Colora::White, Color::Black, 0.5, RStates::target );
	mat[ 0 ].is_enabled = true;
	mat[ 0 ].is_inFrustum = true;

	return new CObject( vec3( 0 ), vec3( 0 ), vec3( 0 ), std::move( mat ) );
}
开发者ID:Industrialice,项目名称:DX11JunkProject,代码行数:64,代码来源:Source.cpp


注:本文中的Nullable::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。