Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am creating a nice level editor for my game now, and I need to draw a 50x50 square grid in four of my child windows. How could I do this considering the fact that the window size could change on a different users computer? My current formula is below, but it will NOT work!
GetClientRect(GetDlgItem(pwnd, ID_DATAVIEW), &pr);
for(int loop = 1; loop < 51; loop++)
MoveToEx(screen, (pr.right / 50) * loop, 0, NULL);
LineTo(screen, (pr.right / 50) * loop, pr.bottom);
MoveToEx(screen, 0, (pr.bottom / 50) * loop, NULL);
LineTo(screen, pr.right, (pr.bottom / 50) * loop);
I thought that would work, but it doesn't. Any ideas? Thanks to any and all who help.
0 · ·