SFML community forums

Help => Graphics => Topic started by: Fedcomp on November 08, 2013, 09:39:21 pm

Title: Drawing grid 16x16 all over the window?
Post by: Fedcomp on November 08, 2013, 09:39:21 pm
Searching a bit, i found discussions on this forums how to make a line.
I tryed to use new knowledge to make a grid 16x16 with the size of the main window but failed with segfault.
How to draw 16x16 grid of the size of main window?
Title: Re: Drawing grid 16x16 all over the window?
Post by: Stauricus on November 08, 2013, 09:50:43 pm
it depends on what you mean by "16x16 with the size of the window"
do you want to fill the window with grids that have 16 pixels in height and width? or fill the window with grids that are of the size window/16 (and then you have 16 squares on X axis and 16 on the Y axis) ?
Title: Re: Drawing grid 16x16 all over the window?
Post by: eXpl0it3r on November 08, 2013, 11:14:53 pm
Most likely an overflow/bad indexing, but without code we can't help you. ;)
Title: Re: Drawing grid 16x16 all over the window?
Post by: BaneTrapper on November 10, 2013, 12:56:19 am
You can get data from sf::Window class and make your grid = window.width / 16.
Refer to documentation for window class.