www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Building basic gtkd,opengl application

reply =?UTF-8?B?TWljaGHFgg==?= <mmcomando gmail.com> writes:
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.
Sep 20 2015
next sibling parent reply BBasile <bb.temp gmx.com> writes:
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.
Sep 20 2015
parent BBasile <bb.temp gmx.com> writes:
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... :/
Sep 20 2015
prev sibling next sibling parent reply =?UTF-8?B?TWljaGHFgg==?= <mmcomando gmail.com> writes:
So no idea how to make basic gtk/opengl application working?
Sep 21 2015
next sibling parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
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
Sep 21 2015
parent =?UTF-8?B?TWljaGHFgg==?= <mmcomando gmail.com> writes:
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.
Sep 21 2015
prev sibling parent reply bachmeier <no spam.com> writes:
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/
Sep 21 2015
parent =?UTF-8?B?TWljaGHFgg==?= <mmcomando gmail.com> writes:
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.
Sep 21 2015
prev sibling parent =?UTF-8?B?TWljaGHFgg==?= <mmcomando gmail.com> writes:
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>
Sep 21 2015