Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Drawing grid 16x16 all over the window?  (Read 2722 times)

0 Members and 1 Guest are viewing this topic.

Fedcomp

  • Newbie
  • *
  • Posts: 4
    • View Profile
Drawing grid 16x16 all over the window?
« 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?

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Drawing grid 16x16 all over the window?
« Reply #1 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) ?
Visit my game site (and hopefully help funding it? )
Website | IndieDB

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10916
    • View Profile
    • development blog
    • Email
Re: Drawing grid 16x16 all over the window?
« Reply #2 on: November 08, 2013, 11:14:53 pm »
Most likely an overflow/bad indexing, but without code we can't help you. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

BaneTrapper

  • Full Member
  • ***
  • Posts: 213
  • Do you even see this, i dont need it.
    • View Profile
    • Email
Re: Drawing grid 16x16 all over the window?
« Reply #3 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.
BaneTrapperDev@hotmail.com Programing, Coding
Projects: Not in development(unfinished/playable):
http://en.sfml-dev.org/forums/index.php?topic=11073.msg76266#msg76266
UP and in Development: The Wanderer - Lost in time
http://en.sfml-dev.org/forums/index.php?topic=14563.0