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

Author Topic: Start Screen  (Read 2522 times)

0 Members and 1 Guest are viewing this topic.

Hunter259

  • Newbie
  • *
  • Posts: 5
    • View Profile
Start Screen
« on: January 12, 2016, 10:19:59 pm »
I have been trying for a few hours to understand how to pause the rendering for user input on a start screen. I have tried using window.waitEvent but it did not work either. How would one go about creating a start screen?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Start Screen
« Reply #1 on: January 12, 2016, 10:38:48 pm »
Don't pause the rendering, your drawing code should be separate from your logic code. Every frame redraw everything and handle events. When an event occurs simply update what you are drawing.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Hunter259

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Start Screen
« Reply #2 on: January 12, 2016, 11:06:08 pm »
How would I go about doing this? I'm new to graphics development.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Re: Start Screen
« Reply #3 on: January 13, 2016, 02:03:28 am »
Generally your game will render around 60 frames per second (or more) and that's by far not what the CPU can deliver, so there's enough time to handle input between frames.
Have you read the official tutorials on event handling (and opening and managing SFML window)?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/