您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ D3DX11CreateShaderResourceViewFromFile函数代码示例

51自学网 2021-06-01 20:17:02
  C++
这篇教程C++ D3DX11CreateShaderResourceViewFromFile函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例11: TextureFinder

//Initialise Particle Systembool 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,


示例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,


示例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,


示例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,


示例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,


示例16: Inventory

void EnemyTurnState::Init(){	mInventory = new Inventory();	mInventory->createItemVectors();	mInventory->CreateEnemyVectors();	mFont = ((InClassProj*)mStateMachine)->GetFont();	Next = false;	md3dDevice = ((InClassProj*)mStateMachine)->GetDevice();	md3dImmediateContext = ((InClassProj*)mStateMachine)->GetContext();	mTransparentBS = ((InClassProj*)mStateMachine)->GetTransparentBS();	mFontDS = ((InClassProj*)mStateMachine)->GetFontDS();	mBattleScreen = new Sprite::Frame();	ID3D11ShaderResourceView* image;	D3DX11CreateShaderResourceViewFromFile(md3dDevice, L"Textures/PostBattleScreen.png",		0, 0, &image, 0);	mBattleScreen->imageWidth = 1900;	mBattleScreen->imageHeight = 1000;	mBattleScreen->x = 0;	mBattleScreen->y = 0;	mBattleScreen->image = image;	mBattleScreen->Terrain = 1;	mBattleScreen->Level = 1;	mBattleScreen->Direction = 1;	mBattleScreenVector.push_back(mBattleScreen);	Sprite::Frame* test = mBattleScreenVector[0];	mScreenToDraw = new Tile(XMVectorSet(950.0f, 500.0f, 0.0f, 1.0f), XMVectorSet(1.0f, 1.0f, 1.0f, 1.0f), 1900, 1000, 0.0f, mBattleScreenVector, 1.0f, md3dDevice);}
开发者ID:Spyb0y,项目名称:The-Game-that-Shall....you-get-the-idea,代码行数:33,


示例17: D3DX11CreateShaderResourceViewFromFile

bool TextureClass::Initialize(ID3D11Device * device,WCHAR *filename){	HRESULT result;	result = D3DX11CreateShaderResourceViewFromFile(device,filename,NULL,NULL,&m_texture,NULL);	if(FAILED(result))	{		MessageBox(NULL,L"CreateShaderResource Failed!",L"Error - TextureClass",MB_OK);		return false;	}	D3D11_SAMPLER_DESC sampDesc;	ZeroMemory(&sampDesc,sizeof(D3D11_SAMPLER_DESC));	sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT;	sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;	sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;	sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;	sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;	sampDesc.MinLOD = 0;	sampDesc.MaxLOD = D3D11_FLOAT32_MAX;	result = device->CreateSamplerState(&sampDesc,&m_SamplerState);	if(FAILED(result))	{		MessageBox(NULL,L"Create SamplerState Failed!",L"Error - TextureClass",MB_OK);		return false;	}	return true;}
开发者ID:zzxchavo,项目名称:Minecraft_Direct11,代码行数:26,


示例18: TilePlacementState

void PlayerTurnState::Init(){	mPlace = new TilePlacementState(mStateMachine);		col = mPlace->GetCurrCol();	row = mPlace->GetCurrRow();	Tile::Frame* playerTile = new Tile::Frame();	ID3D11ShaderResourceView* image;	D3DX11CreateShaderResourceViewFromFile(mStateMachine->GetDevice(), L"Textures/playerTile.png",		0, 0, &image, 0);	playerTile->imageWidth = 250;	playerTile->imageHeight = 250;	playerTile->x = 0;	playerTile->y = 0;	playerTile->image = image;	playerTile->Terrain = 2;	playerTile->Level = 5;	playerTile->Direction = 24;	playerTile->isUp = true;	playerTile->isDown = true;	playerTile->isLeft = true;	playerTile->isRight = true;	mPlayerTile.push_back(playerTile);	PlayerPos.x = (col - 125) * 250;	PlayerPos.y = (row - 125) * 250;	PlayerTile = new Tile(XMVectorSet(PlayerPos.x, PlayerPos.y, 0.0f, 1.0f), XMVectorSet(1.0f, 1.0f, 1.0f, 1.0f), 250, 250, 0.0f, mPlayerTile, 1.0f, mStateMachine->GetDevice());}
开发者ID:Spyb0y,项目名称:The-Game-that-Shall....you-get-the-idea,代码行数:29,


示例19: HR

void FBXObj::LoadNormal(ID3D11Device* dev, wchar_t* filename){	ID3D11ShaderResourceView* texture;	HR(D3DX11CreateShaderResourceViewFromFile(dev,         filename, 0, 0, &texture, 0 ));	mNormalArray.push_back(texture);}
开发者ID:osu-capstone-nvidia-project-2013,项目名称:Zeus,代码行数:7,


示例20: LoadTexture

万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。