summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2021-06-23 01:25:09 +0200
committerRay <[email protected]>2021-06-23 01:25:09 +0200
commit716e26aa37e352f0188824bc2de7dd3035f7413c (patch)
tree6239af3f4c247e30932b32c884baafb8b2eba8eb /src
parentf989048bda60aeb74111ec687cd44ec92deacfe3 (diff)
downloadraylib-716e26aa37e352f0188824bc2de7dd3035f7413c.tar.gz
raylib-716e26aa37e352f0188824bc2de7dd3035f7413c.zip
Review BeginTextureMode() usage
Moved outside BeginDrawing()/EndDrawing() to illustrate drawing is happening to an external texture (not screen)
Diffstat (limited to 'src')
-rw-r--r--src/core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core.c b/src/core.c
index 38e6a5e7..e70b9474 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1942,7 +1942,10 @@ void ClearBackground(Color color)
// Setup canvas (framebuffer) to start drawing
void BeginDrawing(void)
{
- CORE.Time.current = GetTime(); // Number of elapsed seconds since InitTimer()
+ // WARNING: Previously to BeginDrawing() other render textures drawing could happen,
+ // consequently the measure for update vs draw is not accurate (only the total frame time is accurate)
+
+ CORE.Time.current = GetTime(); // Number of elapsed seconds since InitTimer()
CORE.Time.update = CORE.Time.current - CORE.Time.previous;
CORE.Time.previous = CORE.Time.current;
@@ -2045,7 +2048,7 @@ void EndDrawing(void)
CORE.Time.frame += waitTime; // Total frame time: update + draw + wait
}
- PollInputEvents(); // Poll user events
+ PollInputEvents(); // Poll user events (before next frame update)
#endif
#if defined(SUPPORT_EVENTS_AUTOMATION)