Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src_c/static.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "pygame.h"
#include "Python.h"

#include <SDL_ttf.h>

#if defined(__EMSCRIPTEN__)
#undef WITH_THREAD
#endif
Expand Down Expand Up @@ -269,6 +271,12 @@ static struct PyModuleDef mod_pygame_static = {PyModuleDef_HEAD_INIT,
PyMODINIT_FUNC
PyInit_pygame_static()
{
// cannot fail here, and font_initialized is already set to 1 in font.c .
TTF_Init();

// for correct input in wasm worker
SDL_SetHint("SDL_EMSCRIPTEN_KEYBOARD_ELEMENT", "1");

load_submodule("pygame", PyInit_base(), "base");
load_submodule("pygame", PyInit_constants(), "constants");
load_submodule("pygame", PyInit_surflock(), "surflock");
Expand Down