Created Frequently asked Questions Common Questions (markdown)

master
Jeffery Myers 3 년 전
부모
커밋
e3df9a6548
1개의 변경된 파일28개의 추가작업 그리고 0개의 파일을 삭제
  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;
}
```

불러오는 중...
취소
저장