Original Post
I'm sure this isn't an uncommon issue. I code programs on my machine and they turn out somewhat completely different on another. In fact, my PC seems to be the only one with the correct results. I have developed an interface system for DirectX which basically involves each control having 9 quads, and 9*4 vertices. This provides for sizable interface components. I have buttons that are 27x30 pixels in my code. This is the size I'm trying to achieve. I notice on my PC (LCD Monitor, easy to count pixels), the buttons are created perfectly and are all 27x30 pixels in size. Yet, on a CRT monitor at school or at my friend's home, they are around 23 pixels in width. I have no idea why this is occuring. Also the texture mapping seems to be a bit offset as well on machines other than mine. I can provide code if necessary, but I really am not sure what to post. For now, I suppose I'll paste my SetSize function which is responsible for changing the size of my controls: Basically controls here are treated exactly like Windows controls. They all have a client rect and a non client rect. The non client rect includes the client rect AND the non client areas, which basically means the "window size". I am sizing by control rect, which is not the client rect. This means I call the function like so for each button: SetSize(27, 30, false); I hope this is enough information. Thanks.
//====================================================================================
/**
** \brief Sets the size of the control frame
**
** \param width Width of the control frame
** \param height Height of the control frame
**
** \return 1 for success, 0 for failure
**/
int DXLIB::CIControl::SetSize(int width, int height, bool ClientRect)
{
CHECKCLASS();
if(width < m_MinimumSize.x)
width = m_MinimumSize.x;
if(height < m_MinimumSize.y)
height = m_MinimumSize.y;
if(!ClientRect)
{
// Size the Control (NOT Client)
POINT diff = {width - m_CtlRect.width, height - m_CtlRect.height};
m_CtlRect.width = width;
m_CtlRect.height = height;
m_ClientRect.width += diff.x;
m_ClientRect.height += diff.y;
}
else
{
// Size the Client Rect
POINT diff = {width - m_ClientRect.width, height - m_ClientRect.height};
m_ClientRect.width = width;
m_ClientRect.height = height;
m_CtlRect.width += diff.x;
m_CtlRect.height += diff.y;
}
return 1;
}