SFML community forums
Help => Graphics => Topic started 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?
-
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) ?
-
Most likely an overflow/bad indexing, but without code we can't help you. ;)
-
You can get data from sf::Window class and make your grid = window.width / 16.
Refer to documentation for window class.