Derelict / SDL error

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Dec 8 05:47:37 PST 2014


On Mon, 08 Dec 2014 13:37:20 +0000
Paul via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com> wrote:

> The program now works from a terminal as expected (!) BUT when 
> SDL_RenderCopy is called SDL_GetError() shows an 'error code' (or 
> just some address/value as it is different each time).
FYI: SDL_GetError() returns 'char*', not string. you can print error
message with this code, for example:

  private void sdl_print_error () @trusted nothrow @nogc {
    import core.stdc.stdio : stderr, fprintf;
    auto sdl_error = SDL_GetError();
    fprintf(stderr, "SDL ERROR: %s\n", sdl_error);
  }

besides, i don't think that you'll get something sane from
`SDL_GetError()` in the case of segfault.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141208/6df88a14/attachment.sig>


More information about the Digitalmars-d-learn mailing list