Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: How can I 'pause' the game for a few seconds (Unix-Solaris) ?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

    How can I 'pause' the game for a few seconds (Unix-Solaris) ?

    Is there a way to 'pause' a game, say for 3 seconds with a simple function call, on Unix (Solaris) ?

    Thank you,
    Luke

  2. #2
    Guest

    Re: How can I 'pause' the game for a few seconds (Unix-Solaris) ?

    How about just stop updating your game data? Bonus points for rendering a *PAUSED* logo as well.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

    Re: How can I 'pause' the game for a few seconds (Unix-Solaris) ?

    Yes, this is what I want to do ("stop updating the game data") but I don't know how to pause the game for specific amount of time, e.g. 2 seconds.
    Thank you,
    Luke

  4. #4
    Intern Contributor
    Join Date
    Feb 2005
    Posts
    83

    Re: How can I 'pause' the game for a few seconds (Unix-Solaris) ?

    It depends on your platform. Look for clock, time, delay, etc. functions in your related manpages.

  5. #5
    Guest

    Re: How can I 'pause' the game for a few seconds (Unix-Solaris) ?

    You can try the well named sleep function.

    unsigned int sleep (unsigned int seconds) Function
    The sleep function waits for seconds or until a signal is delivered, whichever happens first.

    If sleep function returns because the requested interval is over, it returns a value of zero. If it returns because of delivery of a signal, its return value is the remaining time in the sleep interval.

    The sleep function is declared in unistd.h.
    http://www.gnu.org/manual/glibc-2.2..../Sleeping.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •