How to use d++ (dpp) with Meson build system?

2020-01-25 Thread Denis Feklushkin via Digitalmars-d-learn
Hi! Has anyone already have success with this? Is there any kind of idiomatic way?

Re: bindbc-opengl: Now drawing triangle

2020-01-25 Thread JN via Digitalmars-d-learn
On Saturday, 25 January 2020 at 19:52:25 UTC, Luhrel wrote: Hello, I made a simple OpenGL file using bindbc-opengl and glfw (https://pastebin.com/ehmcHwxj) based on https://github.com/SonarSystems/Modern-OpenGL-Tutorials/blob/master/%5BGETTING%20STARTED%5D/%5B1%5D%20Triangle/main.cpp The cpp

Re: bindbc-opengl: Now drawing triangle

2020-01-25 Thread Luhrel via Digitalmars-d-learn
On Saturday, 25 January 2020 at 20:21:31 UTC, lithium iodate wrote: In line 146 glBufferData(GL_ARRAY_BUFFER, vertices.sizeof, vertices.ptr, GL_STATIC_DRAW); you are calculating the size of `vertices` incorrectly. As `vertices` is a dynamic array, .sizeof will only give you the size of the

Re: bindbc-opengl: Now drawing triangle

2020-01-25 Thread lithium iodate via Digitalmars-d-learn
On Saturday, 25 January 2020 at 19:52:25 UTC, Luhrel wrote: Hello, I made a simple OpenGL file using bindbc-opengl and glfw (https://pastebin.com/ehmcHwxj) based on https://github.com/SonarSystems/Modern-OpenGL-Tutorials/blob/master/%5BGETTING%20STARTED%5D/%5B1%5D%20Triangle/main.cpp The cpp

bindbc-opengl: Now drawing triangle

2020-01-25 Thread Luhrel via Digitalmars-d-learn
Hello, I made a simple OpenGL file using bindbc-opengl and glfw (https://pastebin.com/ehmcHwxj) based on https://github.com/SonarSystems/Modern-OpenGL-Tutorials/blob/master/%5BGETTING%20STARTED%5D/%5B1%5D%20Triangle/main.cpp The cpp project compiles and runs fine (g++ main.cpp -lGL -lglfw -o

Re: compiler error when trying to get random key from AA

2020-01-25 Thread mark via Digitalmars-d-learn
In the end I used this line since I'm not fussy about the rnd for this: auto word = compatibles.byKey.array.choice; Thank you!

Re: list of all defined items in a D file

2020-01-25 Thread Basile B. via Digitalmars-d-learn
On Friday, 24 January 2020 at 14:28:03 UTC, berni44 wrote: On Friday, 24 January 2020 at 12:22:49 UTC, Dennis wrote: You can pass the -X flag to dmd, which makes it generate a .json file describing the compiled file. Great, that's what I was looking for - although it's also good to know the _

Re: compiler error when trying to get random key from AA

2020-01-25 Thread Basile B. via Digitalmars-d-learn
On Saturday, 25 January 2020 at 09:18:01 UTC, Basile B. wrote: On Saturday, 25 January 2020 at 08:35:18 UTC, mark wrote: I have this code: import std.random; import std.stdio; void main() { auto aa = ["one": 1, "two": 2, "three": 3]; writeln(aa); auto rnd = rndGen; auto word = a

Re: compiler error when trying to get random key from AA

2020-01-25 Thread Basile B. via Digitalmars-d-learn
On Saturday, 25 January 2020 at 08:35:18 UTC, mark wrote: I have this code: import std.random; import std.stdio; void main() { auto aa = ["one": 1, "two": 2, "three": 3]; writeln(aa); auto rnd = rndGen; auto word = aa.byKey.choice(rnd); writeln(word); } And in the D playgrou

Re: compiler error when trying to get random key from AA

2020-01-25 Thread Basile B. via Digitalmars-d-learn
On Saturday, 25 January 2020 at 08:35:18 UTC, mark wrote: I have this code: import std.random; import std.stdio; void main() { auto aa = ["one": 1, "two": 2, "three": 3]; writeln(aa); auto rnd = rndGen; auto word = aa.byKey.choice(rnd); writeln(word); } And in the D playgrou

Re: compiler error when trying to get random key from AA

2020-01-25 Thread Basile B. via Digitalmars-d-learn
On Saturday, 25 January 2020 at 09:06:53 UTC, mark wrote: On Saturday, 25 January 2020 at 08:59:23 UTC, Basile B. wrote: On Saturday, 25 January 2020 at 08:35:18 UTC, mark wrote: [...] [snip] [...] rndGen is a range. Use `auto word = aa.byKey.choice(rnd.front())` as index instead. Then `

Re: compiler error when trying to get random key from AA

2020-01-25 Thread Basile B. via Digitalmars-d-learn
On Saturday, 25 January 2020 at 08:59:23 UTC, Basile B. wrote: On Saturday, 25 January 2020 at 08:35:18 UTC, mark wrote: [...] rndGen is a range. Use `auto word = aa.byKey.choice(rnd.front())` as index instead. Then `rndGen.popFront()` to advance. no sorry, I didn't read and thought you nee

Re: compiler error when trying to get random key from AA

2020-01-25 Thread mark via Digitalmars-d-learn
On Saturday, 25 January 2020 at 08:59:23 UTC, Basile B. wrote: On Saturday, 25 January 2020 at 08:35:18 UTC, mark wrote: I have this code: import std.random; import std.stdio; void main() { auto aa = ["one": 1, "two": 2, "three": 3]; writeln(aa); auto rnd = rndGen; auto word = a

Re: compiler error when trying to get random key from AA

2020-01-25 Thread Basile B. via Digitalmars-d-learn
On Saturday, 25 January 2020 at 08:35:18 UTC, mark wrote: I have this code: import std.random; import std.stdio; void main() { auto aa = ["one": 1, "two": 2, "three": 3]; writeln(aa); auto rnd = rndGen; auto word = aa.byKey.choice(rnd); writeln(word); } And in the D playgrou

compiler error when trying to get random key from AA

2020-01-25 Thread mark via Digitalmars-d-learn
I have this code: import std.random; import std.stdio; void main() { auto aa = ["one": 1, "two": 2, "three": 3]; writeln(aa); auto rnd = rndGen; auto word = aa.byKey.choice(rnd); writeln(word); } And in the D playground it gives this error: onlineapp.d(8): Error: template st