question about ctfe init importC zero length array of struct

2024-02-28 Thread Dakota via Digitalmars-d-learn
This is the type defined from c code import by importC: ```c struct A { int count; int[] i; } ``` This kind data need to be init as const to avoid runtime cost, and need to be done from D code. how can I do this ? To put code into D source, I can use "-i=package" to automatically

Re: Error when using `import`.

2024-02-28 Thread Danilo via Digitalmars-d-learn
Examples were moved, so it‘s in the same place now: - https://github.com/schveiguy/raylib-d - https://github.com/schveiguy/raylib-d_examples

Bind C++ template specialized with void parameter

2024-02-28 Thread Gregor Mückl via Digitalmars-d-learn
I have roughly the following code in C++ (vastly simplified from reality): ```cpp template class Wrapper { private: T t; bool valid; public: bool isValid() { return valid; } }; template<> class Wrapper\ { private: bool valid; public: bool isValid() { return valid; } }; ``` I can b

Re: Error when using `import`.

2024-02-28 Thread Danilo via Digitalmars-d-learn
On Wednesday, 28 February 2024 at 07:56:16 UTC, Liam McGillivray wrote: ``` 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? C is expecting null-terminated chars. D strin

Re: Error when using `import`.

2024-02-28 Thread Liam McGillivray via Digitalmars-d-learn
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 us