From 6e20101ae0d86b498a6b6491ccf9e34166b60cd5 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Sun, 6 Mar 2022 05:21:44 +0000 Subject: [PATCH] Add notes about calling LoadTexture before calling InitWindow --- Frequently-asked-Questions--Common-Questions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Frequently-asked-Questions--Common-Questions.md b/Frequently-asked-Questions--Common-Questions.md index a913e0e..f7c83da 100644 --- a/Frequently-asked-Questions--Common-Questions.md +++ b/Frequently-asked-Questions--Common-Questions.md @@ -95,6 +95,12 @@ DrawText(text, textStartX, textStartY, fontSize, LIGHTGRAY); ``` `MeasureText` only measures the width of text, but takes fewer arguments. It is often acceptable to just use the font size as the total text height, but for some fonts, this may not be accurate. `MeasureTextEx` will measure both height and width of text, but does take more arguments. For this reason it is used less often. +# Why does calling `LoadTexture` crash my program? + +You are likely calling `LoadTexture` before calling `InitWindow`. +Loading textures requires a valid OpenGL context, that `InitWindow` sets up. +Therefore, textures cannot be loaded before calling it. + # How can I draw a texture flipped? Drawing a texture flipped requires the use of either `DrawTextureRec`, or `DrawTexturePro` functions.