Re: Getting GtkD working with OpenGL

2016-10-06 Thread Chalix via Digitalmars-d-learn
On Thursday, 6 October 2016 at 13:35:01 UTC, Mike Parker wrote: So, change DerelictGL3.load to DerelictGL.load, then add a call to DerelictGL.reload after creating and activating the context. Thank you! That fixed the segmentation fault problem and the crash :) But I still struggle with the

Re: Getting GtkD working with OpenGL

2016-10-06 Thread Chalix via Digitalmars-d-learn
On Tuesday, 4 October 2016 at 17:00:34 UTC, Mike Wey wrote: Replace "import glgdk.GLContext;" with "import gdk.GLContext;" Hey Mike, you've been a great help so far! Thank you :) I thought now I am ready to draw something, but I struggle with the GLContext and GdkGlContext. Where do I get a

Re: Getting GtkD working with OpenGL

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 18:00:53 UTC, Mike Wey wrote: The signal functions can be found in the gobject.Signals module. But you should use the GLArea.addOnCreateContext / addOnRender / addOnResize functions to attach a D delegate to the signal. You will still need to link with the OpenGL

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 17:56:46 UTC, ag0aep6g wrote: When you do precompile to a library, you can skip the compilation later. That can save time. True, linking with this library instead of compiling it every time I changed my code will save me a lot of time :)

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 17:45:55 UTC, Jonathan M Davis wrote: The import statement just tells the D compiler to pull in declarations for the symbols that it needs from those modules. It doesn't actually compile those modules. You still have to give them to the compiler (either all

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 13:51:28 UTC, Mike Parker wrote: // wrapfoo.d import foo; // import the foo module from above void myFunc(string s) { import std.string : toStringz; my_func(s.toStringz()); } Thank you for the example, Mike! And thanks to all others who support me with

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:54:03 UTC, Adam D. Ruppe wrote: It is possible, you just need to match compilers with the library in C++, whereas C libraries don't need such an exact match. With your Qt library, you get a build of it that is compatible with the compiler you use to build your

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:15:10 UTC, rikki cattermole wrote: To use any kind of function you must declare it, plain and simple. Any c or c++ function/class is the very much same way. Now C++ types such as classes are highly limited in D since it doesn't ugh cross over all that well (it

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:12:44 UTC, Adam D. Ruppe wrote: A lot of people like the wrappers as being prettier to use since you can turn C functions into classes and such. gtkd is an example of that. Thanks for your fast answers :) Hm, I thing I am missing some fundamentals... I read a

Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
Hi All! The documentation of D (https://dlang.org/overview.html#compatibility) says: "Direct Access to C API's Not only does D have data types that correspond to C types, it provides direct access to C functions. There is no need to write wrapper functions, parameter swizzlers, nor code to

Re: Getting GtkD working with OpenGL

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Sunday, 18 September 2016 at 21:41:45 UTC, Mike Wey wrote: The demo still uses the old GtkGLExt binding, which usually isn't available in de distributions repositories. The newer GLArea is easier to use since it's part of GTK. As for the linker errors, you'll need to link with the OpenGL

Re: Getting GtkD working with OpenGL

2016-09-18 Thread Chalix via Digitalmars-d-learn
Here the code I actually wanted to compile (SimpleGL.d): /* * This file is part of gtkD. * * dui is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the

Getting GtkD working with OpenGL

2016-09-18 Thread Chalix via Digitalmars-d-learn
Hi All! This weekend I explored Dlang and I think it's very promising. So I wanted to create some projects I've created with C++ already - for the sake of comparison. I wanted to create a new class which inherits from DrawingArea (from the Gtk library). This will be my OpenGL-Widget with