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


C++ D3DX11CreateShaderResourceViewFromFile函数代码示例

本文整理汇总了C++中D3DX11CreateShaderResourceViewFromFile函数的典型用法代码示例。如果您正苦于以下问题:C++ D3DX11CreateShaderResourceViewFromFile函数的具体用法?C++ D3DX11CreateShaderResourceViewFromFile怎么用?C++ D3DX11CreateShaderResourceViewFromFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: ZeroMemory

void CloudShader::createBuffers(ID3D11Device* pd3dDevice)
{
	// Create the 3 constant buffers, using the same buffer descriptor to create all three
	D3D11_BUFFER_DESC Desc;
	ZeroMemory(&Desc, sizeof(Desc));
	Desc.Usage = D3D11_USAGE_DEFAULT;
	Desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
	Desc.CPUAccessFlags = 0;
	Desc.MiscFlags = 0;

	Desc.ByteWidth = sizeof(CB_VS_PER_OBJECT);
	pd3dDevice->CreateBuffer(&Desc, NULL, &cbVSPerObject);
	DXUT_SetDebugName(cbVSPerObject, "CB_VS_PER_OBJECT_CLOUD");

	Desc.ByteWidth = sizeof(CB_PS_PER_OBJECT);
	pd3dDevice->CreateBuffer(&Desc, NULL, &cbPSPerObject);
	DXUT_SetDebugName(cbPSPerObject, "CB_PS_PER_OBJECT_CLOUD");

	// also initialize the wind textures
	D3DX11CreateShaderResourceViewFromFile(pd3dDevice,
		L"Media\\Grass\\Wind1.png",
		NULL, NULL,
		&txWind1,
		NULL);
	DXUT_SetDebugName(txWind1, "TEX_WIND1_CLOUD");

	D3DX11CreateShaderResourceViewFromFile(pd3dDevice,
		L"Media\\Grass\\Wind2.png",
		NULL, NULL,
		&txWind2,
		NULL);
	DXUT_SetDebugName(txWind2, "TEX_WIND2_CLOUD");
}
开发者ID:alcornwill,项目名称:directx_demo,代码行数:33,代码来源:CloudShader.cpp

示例2: D3DX11CreateShaderResourceViewFromFile

bool TextureArrayClass::Initialize(ID3D11Device* device, WCHAR* filename1, WCHAR* filename2, WCHAR* filename3)
{
	HRESULT result;


	// Load the first texture in.
	result = D3DX11CreateShaderResourceViewFromFile(device, filename1, NULL, NULL, &m_textures[0], NULL);
	if(FAILED(result))
	{
		return false;
	}

	// Load the second texture in.
	result = D3DX11CreateShaderResourceViewFromFile(device, filename2, NULL, NULL, &m_textures[1], NULL);
	if(FAILED(result))
	{
		return false;
	}

	// Load the third texture in.
	result = D3DX11CreateShaderResourceViewFromFile(device, filename3, NULL, NULL, &m_textures[2], NULL);
	if(FAILED(result))
	{
		return false;
	}
	return true;
}
开发者ID:kabzerek,项目名称:DX11_project,代码行数:27,代码来源:TextureArrayClass.cpp

示例3: D3DX11CreateShaderResourceViewFromFile

bool TextureClass::Initialize(ID3D11Device* device, WCHAR* filename, WCHAR* filename2)
{
	HRESULT result;

	m_texture = new ID3D11ShaderResourceView*[2];

	// Load the texture in.
	result = D3DX11CreateShaderResourceViewFromFile(device, filename, NULL, NULL, &(m_texture[0]), NULL);
	if(FAILED(result))
	{
		return false;
	}
	
	if(filename2 != NULL)
	{
		result = D3DX11CreateShaderResourceViewFromFile(device, filename2, NULL, NULL, &(m_texture[1]), NULL);
		if(FAILED(result))
		{
			return false;
		}
	}
	else
	{
		m_texture[1] = 0;
	}
	return true;
}
开发者ID:liggxibbler,项目名称:FuzzyGraphicalTest,代码行数:27,代码来源:textureclass.cpp

示例4: HR

bool LightingDemo2::init()
{
    if (RenderCore::init() == false)
    {
        return false;
    }

    mWaves.Init(160, 160, 1.0f, 0.03f, 5.0f, 0.3f);

    // Must init Effects first since InputLayouts depend on shader signatures.
    EffectMgr::initAll(md3dDevice);
    InputLayoutMgr::initAll(md3dDevice);
    RenderStateMgr::initAll(md3dDevice);

    HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, L"../Textures/grass.dds", 0, 0, &mGrassMapSRV, 0 ));
    HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, L"../Textures/water2.dds", 0, 0, &mWavesMapSRV, 0 ));
    HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, L"../Textures/WireFence.dds", 0, 0, &mBoxMapSRV, 0 ));
    HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, L"../Textures/cig_texture2.dds", 0, 0, &mCigMapSRV, 0 ));

    //buildSceneBuffers();
    buildSkull();
    buildCigar();
    buildBox();
    buildLand();
    buildWave();

    return true;
}
开发者ID:daniel-zhang,项目名称:render_demos,代码行数:28,代码来源:LightingDemo2.cpp

示例5: HR

void TreeBillboardApp::InitFX()
{
    // Must init Effects first since InputLayouts depend on shader signatures.
	Effects::InitAll(m_dxDevice.Get());
	InputLayouts::InitAll(m_dxDevice.Get());
	RenderStates::InitAll(m_dxDevice.Get());

	HR(D3DX11CreateShaderResourceViewFromFile(m_dxDevice.Get(), 
        "Textures/grass.dds", 0, 0, m_grassMapSRV.GetAddressOf(), 0 ));

    HR(D3DX11CreateShaderResourceViewFromFile(m_dxDevice.Get(), 
        "Textures/water2.dds", 0, 0, m_wavesMapSRV.GetAddressOf(), 0 ));

    HR(D3DX11CreateShaderResourceViewFromFile(m_dxDevice.Get(), 
        "Textures/WireFence.dds", 0, 0, m_boxMapSRV.GetAddressOf(), 0 ));

    std::vector<std::string> treeFilenames;
	treeFilenames.push_back("Textures/tree0.dds");
	treeFilenames.push_back("Textures/tree1.dds");
	treeFilenames.push_back("Textures/tree2.dds");
	treeFilenames.push_back("Textures/tree3.dds");

    //Create texture array view
    m_treeTextureMapArraySRV = dxHelper::CreateTexture2DArraySRV(
        m_dxDevice.Get(), m_dxImmediateContext.Get(), treeFilenames, DXGI_FORMAT_R8G8B8A8_UNORM);
}
开发者ID:madmaurice,项目名称:sandbox,代码行数:26,代码来源:TreeBillboard.cpp

示例6: BuildShaders

bool BlendApp::Init()
{
	if(!D3DApp::Init())
		return false;

	mWaves.Init(160, 160, 1.0f, 0.03f, 5.0f, 0.3f);

	// Must init Effects first since InputLayouts depend on shader signatures.
	BuildShaders();
	BuildInputLayout();
	RenderStates::InitAll(md3dDevice);

	HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, 
		L"Textures/grass.dds", 0, 0, &mGrassMapSRV, 0 ));

	HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, 
		L"Textures/water2.dds", 0, 0, &mWavesMapSRV, 0 ));

	HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice, 
		L"Textures/WireFence.dds", 0, 0, &mBoxMapSRV, 0 ));

	BuildLandGeometryBuffers();
	BuildWaveGeometryBuffers();
	BuildCrateGeometryBuffers();
	BuildConstBuffer();

	return true;
}
开发者ID:fxyyoung,项目名称:HyperEngine,代码行数:28,代码来源:BlendDemo.cpp

示例7: loadTextures

//--------------------------------------------------------------------------------------
// JPE: Load Texture
//--------------------------------------------------------------------------------------
HRESULT loadTextures(ID3D11Device* d3d11Device)
{
	//LPCWSTR pathTexture = L"C:\\Users\\yapjpe\\Documents\\Visual Studio 2010\\Projects\\DirectXSamples\\Textures\\images.dds";
	LPCWSTR pathTexture = L"C:\\Users\\yapjpe\\Desktop\\tmp\\imagenes\\HexagonTile_DIFF.png";
	LPCWSTR pathNormalMap = L"C:\\Users\\yapjpe\\Desktop\\tmp\\imagenes\\mono_norm.jpg"; 
	LPCWSTR pathSpecularMap = NULL; // L"C:\\Users\\yapjpe\\Desktop\\tmp\\imagenes\\HexagonTile_SPEC.png";
	// jpg: circulo_norm  mono_norm cara_norm formas_norm  ice1_n  sandbag-diff sandbag-nor
	// png: rabbit-june5_2006-img_0075_nm.png HexagonTile_NRM HexagonTile_DIFF HexagonTile_SPEC

	HRESULT hr;
	hr = D3DX11CreateShaderResourceViewFromFile(d3d11Device, pathTexture,
		NULL, NULL, &m_texture, NULL);
	if (FAILED(hr))
	{
		return hr;
	}

	// Create a texture sampler state description.
	samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
	samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
	samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
	samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
	samplerDesc.MipLODBias = 0.0f;
	samplerDesc.MaxAnisotropy = 1;
	samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
	samplerDesc.BorderColor[0] = 0;
	samplerDesc.BorderColor[1] = 0;
	samplerDesc.BorderColor[2] = 0;
	samplerDesc.BorderColor[3] = 0;
	samplerDesc.MinLOD = 0;
	samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;

	// Create the texture sampler state.
	hr = d3d11Device->CreateSamplerState(&samplerDesc, &m_sampleState);
	if (FAILED(hr))
	{
		return hr;
	}

	// Carga el normal map.
	hr = D3DX11CreateShaderResourceViewFromFile(d3d11Device, pathNormalMap,
		NULL, NULL, &m_normalmap, NULL);
	if (FAILED(hr))
	{
		return hr;
	}

	// Carga el normal map.
	hr = D3DX11CreateShaderResourceViewFromFile(d3d11Device, pathSpecularMap,
		NULL, NULL, &m_specularmap, NULL);
	if (FAILED(hr))
	{
		return hr;
	}

	return hr;
}
开发者ID:jpechevarria,项目名称:lab,代码行数:60,代码来源:Tutorial05.cpp

示例8: BRR

// конструктор модели с костями
AnimModel::AnimModel(wchar_t* binFilePath, wchar_t* textureFilePath, bool* result) {

	// инициализация переменных
	position = Const::spawnPoint; // координаты модели

	// загрузить модель из файла
	BRR(LoadAmimModelFromFile(binFilePath));

	// инициализация элементов после загрузки
	std::fill(curFrame.begin(), curFrame.end(), 0);
	std::fill(accumulation.begin(), accumulation.end(), 0.0f);
	std::fill(blendFactors.begin(), blendFactors.end(), 0.0f);
	blendFactors[0] = 1.0f;

	// создать матрицу порядка умножения финальных костей
	BRR(BuildOrder());

	// загрузить текстуру
	if (FAILED(D3DX11CreateShaderResourceViewFromFile(Mediator::pDev, textureFilePath, NULL, NULL, &pSRtexture, NULL))) {
		BRR(Mediator::errors->Push(textureFilePath));
		*result = false;
		return;
	}

	*result = true;

}
开发者ID:Zimogor,项目名称:boxes_and_spheres,代码行数:28,代码来源:AnimModel.cpp

示例9: XMFLOAT4

void cPillar::Init(float x,float y,float z)
{
	cFBXObject::Init(L"FX/Basic.fx");

	vertices = LOADMANAGER->Pillar_Resource;

	mDirLights[0].Ambient = XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f);
	mDirLights[0].Diffuse = XMFLOAT4(0.8f, 0.8f, 0.8f, 1.0f);
	mDirLights[0].Specular = XMFLOAT4(0.6f, 0.6f, 0.6f, 16.0f);
	mDirLights[0].Direction = XMFLOAT3(0.707f, -0.707f, 0.0f);

	mDirLights[1].Ambient = XMFLOAT4(0.2f, 0.2f, 0.2f, 1.0f);
	mDirLights[1].Diffuse = XMFLOAT4(1.4f, 1.4f, 1.4f, 1.0f);
	mDirLights[1].Specular = XMFLOAT4(0.3f, 0.3f, 0.3f, 16.0f);
	mDirLights[1].Direction = XMFLOAT3(-0.707f, 0.0f, 0.707f);


	mDirLights[2].Ambient = XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f);
	mDirLights[2].Diffuse = XMFLOAT4(0.2f, 0.2f, 0.2f, 1.0f);
	mDirLights[2].Specular = XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f);
	mDirLights[2].Direction = XMFLOAT3(0.0f, -0.707f, -0.707f);


	mObjectMat.Ambient = XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f);
	mObjectMat.Diffuse = XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f);
	mObjectMat.Specular = XMFLOAT4(0.2f, 0.2f, 0.2f, 16.0f);


	HR(D3DX11CreateShaderResourceViewFromFile(m_pD3dDevice,
		L"Textures/pillar.bmp", 0, 0, &mDiffuseMapSRV, 0));

	//D3D11_BUFFER_DESC vbd;
	ZeroMemory(&vbd, sizeof(D3D11_BUFFER_DESC));
	vbd.Usage = D3D11_USAGE_DEFAULT;
	vbd.ByteWidth = sizeof(PNT_Vertex)* vertices.size();
	//vbd.ByteWidth = sizeof(PNT_Vertex)* m_Animations[0].keyframe_vertices.size();
	vbd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
	//vbd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
	vbd.MiscFlags = 0;
	vbd.StructureByteStride = 0;
	//D3D11_SUBRESOURCE_DATA vinitData;
	vinitData.pSysMem = &vertices[0];
	//vinitData.pSysMem = &m_Animations[0].keyframe_vertices[0];
	HR(m_pD3dDevice->CreateBuffer(&vbd, &vinitData, &m_VB));


	D3D11_RASTERIZER_DESC Desc;
	ZeroMemory(&Desc, sizeof(D3D11_RASTERIZER_DESC));
	Desc.FillMode = D3D11_FILL_SOLID;
	Desc.CullMode = D3D11_CULL_BACK;
	Desc.FrontCounterClockwise = true;////////////////////////////////////////////////////////////////////////////////////////////////////////
	Desc.DepthClipEnable = true;

	HR(m_pD3dDevice->CreateRasterizerState(&Desc, &m_RS));


	m_WorldMatrix._41 = x;
	m_WorldMatrix._42 = y;
	m_WorldMatrix._43 = z;
}
开发者ID:kb7639,项目名称:Tower_of_Eternity,代码行数:60,代码来源:cPillar.cpp

示例10: D3DX11CreateShaderResourceViewFromFile

HRESULT GraphicsManager::CreateShaderResourceViewFromFile(ID3D11Device *device, ID3D11DeviceContext *dc, const wchar_t *filename, ID3D11ShaderResourceView **resourceView)
{
  HRESULT result = E_FAIL;

#ifdef OLD_DX_SDK
	//If not, then we have to load it!
	D3DX11_IMAGE_LOAD_INFO imageInfo;
	result = D3DX11CreateShaderResourceViewFromFile(device, filename, &imageInfo, NULL, resourceView, NULL);
#else
  ID3D11Texture2D *tex;
  result = CreateWICTextureFromFile(device, dc, filename, (ID3D11Resource **)&tex, resourceView);
  if (FAILED(result))
  {
    DirectX::TexMetadata md;
    DirectX::ScratchImage img;
    result = LoadFromDDSFile(filename, 0, &md, img);
    result = CreateShaderResourceView(device, img.GetImages(), img.GetImageCount(), md, resourceView);
  }
#endif

  if (FAILED(result))
  {
    printf("There was a problem loading \"%s\"\n", filename);
  }

	return result;
}
开发者ID:wilkinj1,项目名称:CST8237-Assignments,代码行数:27,代码来源:GraphicsManager.cpp

示例11: TextureFinder

//Initialise Particle System
bool CParticleSystem::Initialise(ID3D11Device* device, std::string mFileName, std::string mFileType, std::string textureLocation)
{
	bool result;

	//Texture Location
	std::string textureRelativePath = TextureFinder(textureLocation, mFileName, mFileType);

	if (FAILED(D3DX11CreateShaderResourceViewFromFile(device, textureRelativePath.c_str(), NULL, NULL, &m_Texture[0], NULL)))
	{
		//Output Error Message 
		OutputDebugString("Unable to Load Texture: ");
		OutputDebugString(textureRelativePath.c_str());
		OutputDebugString("\n");
		return false;
	}

	//Initialise Particles in System
	result = InitialiseParticleSystem();
	if (!result)
	{
		return false;
	}

	//Initialise Buffers
	result = InitialiseBuffers(device);
	if (!result)
	{
		return false;
	}

	return true;
}
开发者ID:Dan-Blackburn,项目名称:Final-Year-Project,代码行数:33,代码来源:CParticleSystem.cpp

示例12: D3DX11CreateShaderResourceViewFromFile

bool Shader::loadTexture(const wchar_t* name, ID3D11Device* pDevice) {
	HRESULT hr = D3DX11CreateShaderResourceViewFromFile(pDevice, name, NULL, NULL, &m_pTexture, NULL);
	if(FAILED(hr)) {
		Log::get()->err("Не удалось загрузить текстуру %ls", name);
		return false;
	}

	D3D11_SAMPLER_DESC samplerDesc;
	samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
	samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
	samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
	samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
	samplerDesc.MipLODBias = 0.0f;
	samplerDesc.MaxAnisotropy = 1;
	samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
	samplerDesc.BorderColor[0] = 0;
	samplerDesc.BorderColor[1] = 0;
	samplerDesc.BorderColor[2] = 0;
	samplerDesc.BorderColor[3] = 0;
	samplerDesc.MinLOD = 0;
	samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;

	hr = pDevice->CreateSamplerState(&samplerDesc, &m_pSampleState);
	if(FAILED(hr)) {
		Log::get()->err("Не удалось создать sample state");
		return false;
	}

	return true;
}
开发者ID:flair2005,项目名称:physx-app,代码行数:30,代码来源:Shader.cpp

示例13: sizeof

bool Object::InitializeBuffers(ID3D11Device* device, ID3D11DeviceContext* deviceContext, vector<Vertex>* vertices, LPCSTR textureFilename)
{
	vertexCount = vertices->size();

	Vertex *verts = new Vertex[vertexCount];
	for (int i = 0; i < vertexCount; i++)
		verts[i] = vertices->at(i);

	BUFFER_INIT_DESC vertexBufferDesc;
	vertexBufferDesc.ElementSize	=	sizeof(Vertex);
	vertexBufferDesc.InitData		=	verts;
	vertexBufferDesc.NumElements	=	vertices->size();
	vertexBufferDesc.Type			=	VERTEX_BUFFER;
	vertexBufferDesc.Usage			=	BUFFER_DEFAULT;
	
	vertexBuffer = new ObjectBuffer();
	if(FAILED(vertexBuffer->Init(device, deviceContext, vertexBufferDesc)))
		::MessageBox(0, "Initializing vertex buffer failed! [ObjLoader]", "Error", MB_OK);


	D3D11_INPUT_ELEMENT_DESC inputDesc[]	=	{
		{"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0},
		{"NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0},
		{"TEXTURECOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0}
	};

	if(D3DX11CreateShaderResourceViewFromFile(device, textureFilename, 0, 0, &mShaderResourceView, 0 ))
		::MessageBox(0, "Failed to create shader resource! [Model->bthcolor]", "Error", MB_OK);
	Effects::Shader_ShadowFX->SetTexture(mShaderResourceView, "shaderTexture");

	return true;
}
开发者ID:timotii48,项目名称:TTEngine,代码行数:32,代码来源:Object.cpp

示例14: HandleShaderFiles

void HandleShaderFiles(const char* a_szFilename)
{
	const char* pEnd = strchr(a_szFilename,'\0');
	while((*pEnd) != '.')
	{
		pEnd--;
	}
	char szExtension[32];
	strncpy_s(szExtension,pEnd,strlen(pEnd) + 1);
	

	if(strstr(szExtension,".hlsl"))
	{
		pkShader->LoadFromFile(a_szFilename);
		m_pScene->UpdateProperties();
	}
	else if(strstr(szExtension,".jpg") || strstr(szExtension,".png") || strstr(szExtension,".bmp") || strstr(szExtension,".tif"))
	{
		ID3D11ShaderResourceView* NewTexture = nullptr;
		D3DX11CreateShaderResourceViewFromFile(lcRenderer::GetDevice(),a_szFilename,nullptr,nullptr,&NewTexture,nullptr);

		if(NewTexture)
		{
			CubeTexture = NewTexture;
			return;
		}
	}
}
开发者ID:NathanChambers,项目名称:Labyrinth-Engine,代码行数:28,代码来源:Application.cpp

示例15: GetWindowRect

bool BoxApp::Init()
{
	if(!D3DApp::Init())
		return false;
	GetWindowRect(mhMainWnd,&rc);
	int midX= (rc.right+rc.left)/2;
	int midY= (rc.top+rc.bottom)/2;
	mLastMousePos.x = midX;
	mLastMousePos.y = midY;
	SetCursorPos(midX,midY);
	ClipCursor(&rc);
	w = new World();
	w->Init(md3dDevice,this);

	cam = new Camera();
	cam->Init(&mView, w->playerShip);

	//SetCapture(mhMainWnd);
	ShowCursor(false);

	BuildGeometryBuffers();
	BuildFX();
	BuildVertexLayout();

	HR(D3DX11CreateShaderResourceViewFromFile(md3dDevice,L"Assets/skybox.dds",0,0, &mCubeMapSRV,0));
	CubeMap = mFX->GetVariableByName("gCubeMap")->AsShaderResource();

	CubeMap->SetResource(mCubeMapSRV);
	return true;
}
开发者ID:DuncanKeller,项目名称:3D-Proj-Space-Jam,代码行数:30,代码来源:EmptyProject.cpp


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