There's something very strange going on when using Raylib-D.

I tried using the raylib function `LoadTexture` like this:
```
tileSprites[i] = LoadTexture("../sprites/" ~ spriteName);
```

I got the following error:
```
Error: function `raylib.LoadTexture(const(char)* fileName)` is not callable using argument types `(string)`
```

So it's not allowing me to use a D string, but wants me to use (what I believe to be) the archaic C-style string. Here is how this function, as well as `DrawText` is declared in the Raylib-D bindings:
```
void DrawText(const(char)* text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) Texture2D LoadTexture(const(char)* fileName); // Load texture from file into GPU memory (VRAM)
```

The weird thing is that both of these functions are declared only once and with these C-style strings as arguments, yet I have already successfully called `DrawText` using a D string, yet `Texture2D` results in an error.

```
DrawText("Open Emblem", 180, 300, 64, Colors.RAYWHITE);
```

So why is it that one of these functions, but not the other is allowing D strings in place of C-style strings?
  • Re: Error when u... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
    • Re: Error w... Liam McGillivray via Digitalmars-d-learn
      • Re: Err... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
  • Re: Error when u... Paul Backus via Digitalmars-d-learn
    • Re: Error w... Liam McGillivray via Digitalmars-d-learn
      • Re: Err... Liam McGillivray via Digitalmars-d-learn
        • Re:... Steven Schveighoffer via Digitalmars-d-learn
          • ... Liam McGillivray via Digitalmars-d-learn
            • ... Liam McGillivray via Digitalmars-d-learn
              • ... Danilo via Digitalmars-d-learn
          • ... Liam McGillivray via Digitalmars-d-learn
            • ... Danilo via Digitalmars-d-learn
              • ... Liam McGillivray via Digitalmars-d-learn
              • ... monkyyy via Digitalmars-d-learn
            • ... Danilo via Digitalmars-d-learn
      • Re: Err... Steven Schveighoffer via Digitalmars-d-learn
  • Re: Error when u... Liam McGillivray via Digitalmars-d-learn

Reply via email to