Re: Windows Console and writing Unicode characters

2021-03-30 Thread Luhrel via Digitalmars-d-learn
On Tuesday, 30 March 2021 at 13:19:02 UTC, Adam D. Ruppe wrote: On Tuesday, 30 March 2021 at 08:31:02 UTC, Luhrel wrote: I have been used this trick in C++, so it might also work in D: If you follow through the link that's what I mention as being a bad idea and provide the code given as a

Re: Windows Console and writing Unicode characters

2021-03-30 Thread Luhrel via Digitalmars-d-learn
On Monday, 29 March 2021 at 02:12:57 UTC, Brad wrote: I am new here so I will post this in Learn. I have been doing a bit of reading on printing unicode characters in the Windows Console. Specifically W10 command prompt. I ran across a post by Adam Ruppe in a thread created a couple years

Re: How does one run a linux system command from a D main() fcn ?

2020-08-04 Thread Luhrel via Digitalmars-d-learn
On Tuesday, 4 August 2020 at 19:52:47 UTC, Andy Balba wrote: i.e. D equivalent to C++ command system("MyExe") https://dlang.org/library/std/process.html

Re: Pattern matching via switch?

2020-03-14 Thread Luhrel via Digitalmars-d-learn
On Saturday, 14 March 2020 at 19:04:28 UTC, 12345swordy wrote: I.E. switch (object) case Type1 t1: case Type2 t2: case Type3 t3: As far as I know, there's no way to do that in a switch. However, you can do something like this: --- void main() { auto i = new Type1();

Re: Dscanner: is it possible to switch off style checks case-by-case?

2020-02-15 Thread Luhrel via Digitalmars-d-learn
On Thursday, 13 February 2020 at 17:15:50 UTC, mark wrote: I'm starting out with GtkD and have this function: void main(string[] args) { Main.init(args); auto game = new GameWindow(); Main.run(); } and this method: void quit(Widget widget) { Main.quit(); } When I

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread Luhrel via Digitalmars-d-learn
On Saturday, 1 February 2020 at 08:32:51 UTC, Ferhat Kurtulmuş wrote: On Saturday, 1 February 2020 at 08:27:07 UTC, Luhrel wrote: On Saturday, 1 February 2020 at 08:21:29 UTC, Ferhat Kurtulmuş wrote: You cannot. https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d You must

Re: How to call a extern C++ class constructor ?

2020-02-01 Thread Luhrel via Digitalmars-d-learn
On Saturday, 1 February 2020 at 08:21:29 UTC, Ferhat Kurtulmuş wrote: You cannot. https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d You must use a factory method like createInstance. Oh I see, so there's definitively no way to call a c++ ctor without modifying the c++

How to call a extern C++ class constructor ?

2020-02-01 Thread Luhrel via Digitalmars-d-learn
Hello there, I would like to know how can I call a C++ ctor. Actually, I have this: C++: CppClass.cpp #include "CppClass.h" AmazingCppClass::AmazingCppClass() { number = 124; } int AmazingCppClass::getNumber(bool show) { if (show)

Re: bindbc-opengl: Now drawing triangle

2020-01-27 Thread Luhrel via Digitalmars-d-learn
On Saturday, 25 January 2020 at 21:33:09 UTC, JN wrote: I assume it's working now? Yup it works. For future, learn to use RenderDoc: https://renderdoc.org/ it allows you to debug your OpenGL application and see what kind of data is sent by your app. Wow that's what I need. Thanks for

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

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