DX11Starter/Game.cpp
// --------------------------------------------------------
// Called once per program, after DirectX and the window
// are initialized but before the game loop.
// --------------------------------------------------------
Called once per program, after DirectX and the window
are initialized but before the game loop.
Called once per program after DirectX and the window are initialized but before the game loop .
void Game::Init()
{
	renderer = new Renderer(device, context);
	camera->SetAspectRatio((float)width / height);
	CreateWICTextureFromFile(
		device, 
		context, 
		L"Debug/Assets/Textures/crate.png", 
		0, 
		&crateSrv);
	crate = new Material(vertexShader, pixelShader, crateSrv);
	blue = new Material(vertexShader, pixelShader, XMFLOAT4(0.15f, 0.15f, 1, 1), defaultSrv);
	CreateBasicGeometry();
	context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
}
void Game :: Init ( ) { renderer = new Renderer ( device , context ) ; camera -> SetAspectRatio ( ( float ) width / height ) ; CreateWICTextureFromFile ( device , context , L" " , 0 , & crateSrv ) ; crate = new Material ( vertexShader , pixelShader , crateSrv ) ; blue = new Material ( vertexShader , pixelShader , XMFLOAT4 ( 0.15f , 0.15f , 1 , 1 ) , defaultSrv ) ; CreateBasicGeometry ( ) ; context -> IASetPrimitiveTopology ( D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST ) ; }
Called once per program, after DirectX and the window
are initialized but before the game loop.
Called once per program after DirectX and the window are initialized but before the game loop .
// Helper methods for loading shaders, creating some basic // geometry to draw and some simple camera matrices. //  - You'll be expanding and/or replacing these later //Wood Texture //Providing the context will auto-generate mipmaps //we don't actually need the texture reference // Tell the input assembler stage of the pipeline what kind of // geometric primitives (points, lines or triangles) we want to draw.   // Essentially: "What kind of shape should the GPU draw with our data?"