Created Frequently asked Questions Common Questions (markdown)

master
Jeffery Myers pirms 3 gadiem
vecāks
revīzija
e3df9a6548
1 mainītis faili ar 28 papildinājumiem un 0 dzēšanām
  1. +28
    -0
      Frequently-asked-Questions--Common-Questions.md

+ 28
- 0
Frequently-asked-Questions--Common-Questions.md

@ -0,0 +1,28 @@
This page will go over some of the common questions new users have when starting out using raylib.
* How do I make a timer?
Raylib has no built in timer system. You are expected to keep track of time in your own code. You can do with with the GetTime and GetFrameTime functions. Below is an example of a simple timer struct and functions to use it.
```
typedef struct
{
double StartTime;
double Lifetime;
}Timer;
void StartTimer(Timer* timer, double lifetime)
{
timer->StartTime = GetTime();
timer->Lifetime = lifetime;
}
bool TimerDone(Timer timer)
{
return GetTime() - timer.StartTime >= timer.Lifetime;
}
double GetElapsed(Timer timer)
{
return GetTime() - timer.StartTime;
}
```

Notiek ielāde…
Atcelt
Saglabāt