Suitability of D for a Crossplatform Graphical App

2021-04-25 Thread graw via Digitalmars-d-learn
I've been working through the ideas of a project I'd like to work on and I've reached the point where I'm having trouble choosing a toolset. I'd like to make a graphically simple, mostly menu driven 2d simulation type game, but I'd like it to at least be compatible with android. I've used D

Re: write once type?

2021-04-25 Thread Jack via Digitalmars-d-learn
On Tuesday, 20 April 2021 at 19:56:33 UTC, Steven Schveighoffer wrote: I have had the need in some cases to *maybe* set a const value inside a loop. One can sometimes abstract this into a lambda function, but sometimes this is not possible (e.g. if the loop is static). Not only that, but I may

Re: win64 DLL stdout printing after main process completes

2021-04-25 Thread cc via Digitalmars-d-learn
On Monday, 19 April 2021 at 18:32:15 UTC, Adam D. Ruppe wrote: On Monday, 19 April 2021 at 18:05:46 UTC, cc wrote: This seems to work if I flush after every printf or write in both main and the dll. I was under the impression they were supposed to share the same IO buffers though, is this not

Re: Struct initialization extra comma - should it compile

2021-04-25 Thread Bastiaan Veelo via Digitalmars-d-learn
On Sunday, 25 April 2021 at 13:39:54 UTC, JN wrote: struct Foo { int x, y, z; } void main() { Foo bar = Foo(1,); } This compiles without syntax errors, is this expected? Yes, the

Re: Struct initialization extra comma - should it compile

2021-04-25 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 25 April 2021 at 13:39:54 UTC, JN wrote: struct Foo { int x, y, z; } void main() { Foo bar = Foo(1,); } This compiles without syntax errors, is this expected? Yes, D allows trailing commas in argument lists.

Struct initialization extra comma - should it compile

2021-04-25 Thread JN via Digitalmars-d-learn
struct Foo { int x, y, z; } void main() { Foo bar = Foo(1,); } This compiles without syntax errors, is this expected?

Re: get type name from current class at compile time?

2021-04-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 25 April 2021 at 12:54:43 UTC, Jack wrote: I find out this later. I give up trying to get this in automatic way at compile time That's because the type might not be known at compile time at all, it might come from like a plugin loaded at run time and only ever accessed through the

Re: get type name from current class at compile time?

2021-04-25 Thread Jack via Digitalmars-d-learn
On Sunday, 25 April 2021 at 08:36:51 UTC, Adam D. Ruppe wrote: On Sunday, 25 April 2021 at 03:45:13 UTC, Jack wrote: that's better, thanks Imporant to remember that any compile time thing will be the static type. If someone does: Base a = new Derived(); a.something(); it will still show

Re: get type name from current class at compile time?

2021-04-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 25 April 2021 at 03:45:13 UTC, Jack wrote: that's better, thanks Imporant to remember that any compile time thing will be the static type. If someone does: Base a = new Derived(); a.something(); it will still show up as Base in the this template. The knowledge that it is

Re: Use bindbc-sdl statically

2021-04-25 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 24 April 2021 at 16:48:49 UTC, Ishax wrote: Yet the .exe functions if I supply it with .dlls. Thats silly. That's because you're linking with the import library. On Windows, static libraries and import libraries both have the `.lib` extension. The SDL development packages on the

Re: Use bindbc-sdl statically

2021-04-25 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 24 April 2021 at 16:13:12 UTC, russhy wrote: also you are missing the ``` subConfigurations "bindbc-sdl" "staticBC" ``` That's not necessary when the version `BindSDL_Static` is provided. The `static` and `staticBC` subconfigurations both enable `-version=BindSDL_Static`,