Thread overview
Building basic gtkd,opengl application
Sep 20, 2015
Michał
Sep 21, 2015
BBasile
Sep 21, 2015
BBasile
Sep 21, 2015
Michał
Sep 21, 2015
Ali Çehreli
Sep 21, 2015
Michał
Sep 21, 2015
bachmeier
Sep 21, 2015
Michał
Sep 21, 2015
Michał
September 20, 2015
I am trying to make some application using gtkd and opengl.
I have made simple program but it didn't work and I have no idea why.

I have never used gtk so maybe I'm doing something stupid : /

The code:
http://pastebin.com/7NfbMqaK

Error:
http://pastebin.com/vaFAP0bu

Some ideas?
Any tips to gtkd/gtk/gl are welcome.

September 21, 2015
On Sunday, 20 September 2015 at 22:30:54 UTC, Michał wrote:
> I am trying to make some application using gtkd and opengl.
> I have made simple program but it didn't work and I have no idea why.
>
> I have never used gtk so maybe I'm doing something stupid : /
>
> The code:
> http://pastebin.com/7NfbMqaK
>
> Error:
> http://pastebin.com/vaFAP0bu
>
> Some ideas?
> Any tips to gtkd/gtk/gl are welcome.

at least one obvious error: line 37, `MyArea glarea = new MyArea();`

`Myarea` scope is limited to the __ctor. You should declare it as a class private variable and then instantiate it in the _ctor, otherwise. With the GC it's probably still alive til next collection but this is nevertheless an error.
September 21, 2015
On Monday, 21 September 2015 at 03:26:36 UTC, BBasile wrote:
> On Sunday, 20 September 2015 at 22:30:54 UTC, Michał wrote:
>> I am trying to make some application using gtkd and opengl.
>> I have made simple program but it didn't work and I have no idea why.
>>
>> I have never used gtk so maybe I'm doing something stupid : /
>>
>> The code:
>> http://pastebin.com/7NfbMqaK
>>
>> Error:
>> http://pastebin.com/vaFAP0bu
>>
>> Some ideas?
>> Any tips to gtkd/gtk/gl are welcome.
>
> at least one obvious error: line 37, `MyArea glarea = new MyArea();`
>
> `Myarea` scope is limited to the __ctor. You should declare it as a class private variable and then instantiate it in the _ctor, otherwise. With the GC it's probably still alive til next collection but this is nevertheless an error.

NVM this is totally wrong. You can create an instance without keeping trace of it in a variable. This even something common in laguages using ownership and if you don't need to manipulate the class instance after its construction... :/
September 21, 2015
So no idea how to make basic gtk/opengl application working?
September 21, 2015
On 09/21/2015 10:59 AM, Michał wrote:
> So no idea how to make basic gtk/opengl application working?

With no experience at all, copying an example without opengl from a basic and incomplete Turkish gtkd tutorial[1]:

import gtk.Window;
import gtk.Main;

int main(string[] args)
{
    Main.init(args);
    auto pencere = new Window("deneme");
    pencere.show();
    Main.run;

    return 0;
}

Does that work?

Ali

[1] http://ddili.org/ders/gtkd/merhaba_gtkd.html

September 21, 2015
On Monday, 21 September 2015 at 17:59:17 UTC, Michał wrote:
> So no idea how to make basic gtk/opengl application working?

The project has its own forum if you haven't already posted there: http://forum.gtkd.org/
September 21, 2015
On Monday, 21 September 2015 at 18:07:27 UTC, Ali Çehreli wrote:
> Does that work?

Yes and clear output there.
I have tried some basic examples of gtkd and they seems to work. GLArea has some problems.
September 21, 2015
On Monday, 21 September 2015 at 18:08:15 UTC, bachmeier wrote:
> On Monday, 21 September 2015 at 17:59:17 UTC, Michał wrote:
>> So no idea how to make basic gtk/opengl application working?
>
> The project has its own forum if you haven't already posted there: http://forum.gtkd.org/

I didn't. I will try there.
Thanks for help.
September 21, 2015
It turns out it was caused by a bug in the gtkd.
Thanks to Mike Wey already fixed.

My minimal working code if somebody was intrested.
<http://pastebin.com/Eu3QJUj0>