Add notes about calling LoadTexture before calling InitWindow

master
Peter0x44 3 år sedan
förälder
incheckning
6e20101ae0
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. +6
    -0
      Frequently-asked-Questions--Common-Questions.md

+ 6
- 0
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.

Laddar…
Avbryt
Spara