aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 7fad5941..75544765 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -549,6 +549,9 @@ var LibrarySDL = {
var h = fontData.size;
var fontString = h + 'px ' + fontData.name;
var tempCtx = SDL.ttfContext;
+#if ASSERTIONS
+ assert(tempCtx, 'TTF_Init must have been called');
+#endif
tempCtx.save();
tempCtx.font = fontString;
var ret = tempCtx.measureText(text).width | 0;