Anybody know about SDL and particularly SDL_TTF initialization?
Danny Arends
Danny.Arends at gmail.com
Wed May 22 10:01:41 UTC 2024
On Sunday, 12 May 2024 at 20:13:04 UTC, WhatMeWorry` wrote:
> This should be trivial, right?
> I've been looking at existing D repo code for hours. Can't
> figure why TTF_Init doesn't work?
> It would help if I could figure out how to use SDL_GetError()
>
> INFO: SDL loaded v2.30.2
> INFO: SDL initialized: 0
> INFO: TTF loaded: v2.0.14
> Error Program exited with code -1073741819
>
>
> loadSDL();
> SDL_version v;
> SDL_GetVersion(&v);
> toStdout("SDL loaded v%d.%d.%d", v.major, v.minor, v.patch);
> auto initSDL = SDL_Init(SDL_INIT_EVERYTHING); // returns 0
> on success
> toStdout("SDL initialized: %d", initSDL);
>
> auto loadTTF = loadSDLTTF();
> SDL_TTF_VERSION(&v);
> toStdout("TTF loaded: v%d.%d.%d", v.major, v.minor, v.patch);
> auto initTTF = TTF_Init(); // SDL must be initialized before
> calls to this library
No idea why this fails, seems alright to me. You can use:
TTF_GetError() for a human-readable error message,when the call
to TTF_Init() fails (return -1).
Good luck
Danny
More information about the Digitalmars-d-learn
mailing list