Another error message

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
aslanbey0158
Posts: 52
Joined: April 15th, 2017, 10:48 am

Another error message

Post by aslanbey0158 » September 12th, 2020, 10:45 am

i get another error
Attachments
uyg 24-2 _2.rar
(847.34 KiB) Downloaded 196 times

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Another error message

Post by albinopapa » September 12th, 2020, 4:32 pm

Still getting error message about not including <string> in DxgiInfoManager.h
Still getting error message about not including <iterator> in App.cpp

And probably the thing you're asking about:

Code: Select all

TransformCbuf::TransformCbuf( Graphics& gfx, const Drawable& parent, UINT slot )
	:
	parent( parent )
{
	if( !pVcbuf )
	{
		pVcbuf = std::make_unique<VertexConstantBuffer<Transforms>>( gfx, slot );
	}
}
The TransformCBuf constructor is missing a parameter in the make_unique line. Look at the constructors for ConstantBuffer, you should be able to figure out what's missing.

Also, it turns out you aren't setting the slot value in a PointLight PixelConstantBuffer, it's always a good idea to initialize your variables.

Code: Select all

template<typename C>
class ConstantBuffer : public Bindable
{
public:
	void Update( Graphics& gfx,const C& consts )
	ConstantBuffer( Graphics& gfx, const C& consts, UINT slot =0 )
	ConstantBuffer( Graphics& gfx )
protected:
	Microsoft::WRL::ComPtr<ID3D11Buffer> pConstantBuffer;
	UINT slot;     // <--- RIGHT HERE SHOULD BE: UINT slot = 0u;
};
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

aslanbey0158
Posts: 52
Joined: April 15th, 2017, 10:48 am

Re: Another error message

Post by aslanbey0158 » September 13th, 2020, 2:25 pm

I did everything but the problem is continue.
I believe the problem too small but i cant resolve.
Attachments
uyg 24-2 _2_2.rar
(846.92 KiB) Downloaded 198 times

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Another error message

Post by albinopapa » September 13th, 2020, 3:51 pm

You haven't fixed everything I mentioned:

Code: Select all

TransformCbuf::TransformCbuf( Graphics& gfx, const Drawable& parent, UINT slot )
	:
	parent( parent )
{
	if( !pVcbuf )
	{
		pVcbuf = std::make_unique<VertexConstantBuffer<Transforms>>( gfx, slot );

	}
}
You haven't changed anything here.

I told you to look at the ConstantBuffer constructors

Code: Select all

ConstantBuffer( Graphics& gfx, const C& consts, UINT slot = 0);
ConstantBuffer( Graphics& gfx );
You have two constructors for ConstantBuffer. The first one takes a Graphics& reference, a C const& and a UINT. You are trying to create a VertexConstantBuffer using a Graphics& and a UINT. The UINT slot is defaulted, so the compiler is trying to create a VertexConstantBuffer using a Graphics& and a UINT instead of a Graphics& and a C const&. It's trying to use the UINT slot as a C const& and it's not liking it because you are trying to create a VertexConstantBuffer<TransformCbuf::Transforms> and not a VertexConstantBuffer<UINT>.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

aslanbey0158
Posts: 52
Joined: April 15th, 2017, 10:48 am

Re: Another error message

Post by aslanbey0158 » September 14th, 2020, 8:43 am

I solved the problem of ConstantBuffer . By this way The program runned.
TransformCbuf may be different but it runs.
Thanks for every helps

Post Reply