19.06.2019 17:52, Den_d_y пишет:
void load (const (char *) path)
{
     SDL_Surface ab = SDL_LoadBMP (path);
     a = SDL_CreateTextureFromSurface (ab);
     SDL_FreeSurface (ab);
}

try the following:
```
void load (string path)
{
    import std.string : toStringz;
SDL_Surface ab = SDL_LoadBMP (path.toStringz); // toStringz converts string to null terminated char*
    auto a = SDL_CreateTextureFromSurface (ab);
    SDL_FreeSurface (ab);
}
```

Reply via email to