problem in resizing the swapchain buffers

Started by
12 comments, last by Mohammed Abdulmonem 9 years, 7 months ago

Have you tried setting the world, view and projection matrices to some constant values not related to what you are rendering? I'm afraid your code is a bit too convoluted to decipher what you intend when you set the view matrix. If constant values for the matrices renders properly, you should compare the vectors you produce in your routine to create the view matrix, in windowed mode and fullscreen mode to determine what is different.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Advertisement

do you mean like this line


wvp = XMLoadFloat4x4(&(B.Memory[0].Pieces[35])) * vp;

 

i am sorry i didn't name the variables to be understandable .....B is variable that contains of world matrices of any possible step for the falling small cubes(tetris-like)

it contains of


struct BUILD     //BUILD B;
{
	std::vector <Floor> Memory;
	BUILD(){
		Memory.resize(10);   // i got 10 floors
	}
	UINT GetSize(){
		return Memory.size();
	}
};
struct Floor{
	XMFLOAT4X4 Pieces[36];          //Floor contains 36 possible step
	std::vector <UINT> filledindeces;// contains the indices of the filled matrices
};


//this is how i set the B variable
void Game::SetBuild(){
	float x=0,y=0,z=0;
	XMMATRIX tMat;
	Floor tFloor;//temporary varaible to set floor matrices one by one
	UINT re = B.GetSize(); //B is a member variable
	for (UINT i = 0; i < re ; i++)
	{
		x=0;z=0;
		for (int j = 0; j < 36; j++)
		{
			tMat = XMMatrixTranslation(x,y,z);
			XMStoreFloat4x4(&tFloor.Pieces[j],tMat);
			if (j == 35)
			{
				y+= heightoff;  // hieghtoff = height / 10
				x=0;
				z=0;
				continue;
			}
			if ((j+1) % 6 == 0)
			{
				x -= widthoff; //widthoff = width / 6
				z = 0;
				continue;
			}
			z -= depthoff; //depthoff = depth / 6
		}
		B.Memory[i]=tFloor;
	}
	B.Memory[9].filledindeces.push_back(10); //drop a box from the 10th floor at index 10
	currentItem.Floor_Index=10;
//currentItem is a member variable for tracking the currently falling box to move it when the user press buttons
	currentItem.Height=9;
}
 

well i didn't mention it because i am sure there is no problem here

....those matrices are already constant i call setBuild() in the first initializations ..... i dont change them at all .....

You're probably going to have to try doing something other than posting code to determine where the problem lies. I'm not big at all on just staring at code to find problems. I strongly suggest you actually examine values or change something to provide yourself and others with some sort of information to narrow down the problem. I do hope you find the problem eventually.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

i already tried something .....i patched the program to never call onResize() and it works except that it is low quality....low quality problem is easy to solve(increasing resolution)...but that means i need to patch it also to be unable to resize window...the problem is kind of fixed....that means the problem where on resize function...isn't there any kind of rules or special condition (like releasing the buffers before calling swapchain->resizebuffers())...

This topic is closed to new replies.

Advertisement