# the screen do not open

**URL:** <https://forums.unrealengine.com/t/the-screen-do-not-open/1623650>\
**Category:** C++\
**Tags:** unreal-engine, screen, CPP\
**Created:** [January 18, 2024, 11:09am UTC](https://forums.unrealengine.com/t/the-screen-do-not-open/1623650 "2024-01-18T11:09:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mueoca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mueoca](https://forums.unrealengine.com/u/mueoca)\
**Post date:** [January 18, 2024, 11:09am UTC](https://forums.unrealengine.com/t/the-screen-do-not-open/1623650/1 "2024-01-18T11:09:52Z")

</div>

Hello  
i need to convince something first. i do not creating a game in unreal engine. But in visual studio. That said

mine code do not work as it should. When i implemented light and with material. I get a problem with material. I do get null on the constanbuffer\_material and i do not understand why.  
are there something that i am missing or something i misplaces. Are there any more information that you want please not hesitate and tell me

```auto
bool material(ID3D11Device* device, ID3D11Buffer*& constentBuffer_matreal) {
    ML MATREAL;
	MATREAL.Diffuse[0] = 0.0f;
	MATREAL.Diffuse[1] = 0.0f;
	MATREAL.Diffuse[2] = 0.0f;
	MATREAL.Diffuse[3] = 0.0f;

	MATREAL.Ambient[0] = 0.0f;
	MATREAL.Ambient[1] = 0.0f;
	MATREAL.Ambient[2] = 0.0f;
	MATREAL.Ambient[3] = 0.0f;

	MATREAL.Specular[0] = 0.0f;
	MATREAL.Specular[1] = 0.0f;
	MATREAL.Specular[2] = 0.0f; 
	MATREAL.Specular[3] = 0.0f;

	MATREAL.Emissive[0] = 0.0f;
	MATREAL.Emissive[1] = 0.0f;
	MATREAL.Emissive[2] = 0.0f;
	MATREAL.Emissive[3] = 0.0f;

    MATREAL.Power = 1.0f;

    D3D11_BUFFER_DESC BufferDesc_matrix;
    BufferDesc_matrix.ByteWidth = sizeof(ML);
    BufferDesc_matrix.Usage = D3D11_USAGE_IMMUTABLE;
    BufferDesc_matrix.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
    BufferDesc_matrix.CPUAccessFlags = 0;
    BufferDesc_matrix.MiscFlags = 0;
    BufferDesc_matrix.StructureByteStride = 0;

    D3D11_SUBRESOURCE_DATA data_1;
    data_1.pSysMem = &MATREAL;
    data_1.SysMemPitch = 0;
    data_1.SysMemSlicePitch = 0;

    HRESULT hr = device->CreateBuffer(&BufferDesc_matrix, &data_1, &constentBuffer_matreal);
    return !FAILED(hr);
}

```
