Re: GtkD 3.1.0 released, GTK+ with D.
On Friday, 10 April 2015 at 21:54:55 UTC, Mike Wey wrote: On 04/10/2015 11:34 PM, Mike Wey wrote: On 04/10/2015 12:54 PM, stewarth wrote: On Thursday, 26 March 2015 at 22:41:01 UTC, Mike Wey wrote: GtkD is a D binding and OO wrapper of Gtk+ and is released on the LGPL license. Shortly after the last release, GtkD has been updated for GTK+ 3.16. GtkD 3.1.0 is now available on gtkd.org: http://gtkd.org/download.html Hi, I tried posting on the GtkD forum but it crashed when I hit post :P I've just upgraded to GtkD 3.1.1 (not 3.1.0). I now get a compiler error because the setState method in the gtk.Button class is not there anymore. Is this a bug or was it removed on purpose? Thanks, Stew That is a bug. Further investigation shows it was intentional, because of conflicts with other functions, use setStateFlags. Forum should be fixed now. Perfect, all fixed :-) Thank you very much for the help, and GtkD. Cheers, Stew
Re: Dgame RC #1
On Wednesday, 1 April 2015 at 18:30:01 UTC, Namespace wrote: Since the weekend Dgame went into the release phase: https://github.com/Dgame/Dgame/releases/tag/v0.5.0-rc.1 http://dgame-dev.de/?page=download The Website (http://dgame-dev.de/) is fully updated and should be useable on every device. Please let me know if you noticed unexpected behavior (at Dgame or on the website). I also want to participate on one game a month (http://www.onegameamonth.com/). I hope you will vote for me there. ;) I'm sure that will bring some new light to the D community and it will be a good stress test for Dgame. Great work! I'm really enjoying using Dgame at the moment and it makes a really nice change from all the embedded C++ I have to do at work. I'll make sure to go and vote too :) Cheers, stew
Re: GtkD 3.1.0 released, GTK+ with D.
On Thursday, 26 March 2015 at 22:41:01 UTC, Mike Wey wrote: GtkD is a D binding and OO wrapper of Gtk+ and is released on the LGPL license. Shortly after the last release, GtkD has been updated for GTK+ 3.16. GtkD 3.1.0 is now available on gtkd.org: http://gtkd.org/download.html This is great, thanks for your efforts. Cheers, stew
Re: Dgame revived
On Saturday, 14 March 2015 at 15:19:20 UTC, Namespace wrote: On Saturday, 14 March 2015 at 03:12:56 UTC, stewarth wrote: On Friday, 13 March 2015 at 14:23:27 UTC, Namespace wrote: On Friday, 13 March 2015 at 10:51:22 UTC, stewarth wrote: On Friday, 13 March 2015 at 08:31:28 UTC, Namespace wrote: The most of Dgame is ready, only the tutorials are missing to arrive to the release state. Is there anything you wanted absolutely in Dgame? A module, a tutorial? Since I removed the TileMap tutorial I may want to write an replacement how you could easily built one with Sprites. Any further ideas? At the end of this month I wanted to participate on One game a month (http://www.onegameamonth.com/). Mainly with C++ but I think it would be a good test for Dgame, if I would programm some games with it. And it could be helpfull to get more attention on D. Nice work :) I just tried on Arch Linux x86_64 and it worked out of the box using dub. Time to upgrade my Dgame projects !! Thanks, Stew How many do you have? Four in total, all half finished -- just the way I like them :-) I do intend to finish them off, I just need to find more the time between work and sleep... Cheers, Stew Even half finished, I would like to see them. http://dgame-dev.de/?page=show is also called Work in Progress ;) When I get something to a state that I'm comfortable sharing I'll let you know. The hardest part is the resources, graphics etc. My sprites are pretty embarrassing :) Cheers, Stew
Re: Dgame revived
On Friday, 13 March 2015 at 14:23:27 UTC, Namespace wrote: On Friday, 13 March 2015 at 10:51:22 UTC, stewarth wrote: On Friday, 13 March 2015 at 08:31:28 UTC, Namespace wrote: The most of Dgame is ready, only the tutorials are missing to arrive to the release state. Is there anything you wanted absolutely in Dgame? A module, a tutorial? Since I removed the TileMap tutorial I may want to write an replacement how you could easily built one with Sprites. Any further ideas? At the end of this month I wanted to participate on One game a month (http://www.onegameamonth.com/). Mainly with C++ but I think it would be a good test for Dgame, if I would programm some games with it. And it could be helpfull to get more attention on D. Nice work :) I just tried on Arch Linux x86_64 and it worked out of the box using dub. Time to upgrade my Dgame projects !! Thanks, Stew How many do you have? Four in total, all half finished -- just the way I like them :-) I do intend to finish them off, I just need to find more the time between work and sleep... Cheers, Stew
Re: Dgame revived
On Friday, 13 March 2015 at 08:31:28 UTC, Namespace wrote: The most of Dgame is ready, only the tutorials are missing to arrive to the release state. Is there anything you wanted absolutely in Dgame? A module, a tutorial? Since I removed the TileMap tutorial I may want to write an replacement how you could easily built one with Sprites. Any further ideas? At the end of this month I wanted to participate on One game a month (http://www.onegameamonth.com/). Mainly with C++ but I think it would be a good test for Dgame, if I would programm some games with it. And it could be helpfull to get more attention on D. Nice work :) I just tried on Arch Linux x86_64 and it worked out of the box using dub. Time to upgrade my Dgame projects !! Thanks, Stew
Re: GtkD 3.0-beta
On Saturday, 7 March 2015 at 21:14:36 UTC, Mike Wey wrote: I'm glad to announce the first GtkD release that makes use of the new gir based generator. The generator was rebuild from the ground up since the old one was no longer usable with the new GTK+ documentation. For a list of changes see the changelog: http://gtkd.org/changelog.html There is also an list of the breaking changes on the wiki: https://github.com/gtkd-developers/GtkD/wiki/GtkD-2-vs-GtkD-3 Download: http://gtkd.org/Downloads/sources/GtkD-3.0.0-beta.zip I use GtkD so thank you very much for maintaining this project. Cheers, Stew
Re: Dgame revived
On Wednesday, 4 March 2015 at 11:56:28 UTC, stewarth wrote: On Wednesday, 4 March 2015 at 09:42:57 UTC, Gan wrote: On Wednesday, 4 March 2015 at 09:24:55 UTC, Namespace wrote: On Tuesday, 3 March 2015 at 23:01:21 UTC, Gan wrote: Oh also the green circle anti alias isn't happening. Just a plain un-anti-alis circle. Should be fixed now. Note that you now must specify the anti-aliasing, when you create the window. And you can now specify by yourself which opengl context version should be supported. See: http://dgame-dev.de/?package=Windowmodule=GLSettings Looks great. How do I use the new version in dub? Do I just set the dependency version to 0.5.0? I think that because 0.5.0 is on a branch you will need to tell dub to switch branches. This is done with a '~' in the dependencies line. You also need to run dub upgrade. Something like this (untested): --- ... sourcePaths:[.], dependencies: { dgame:~0.5.0 }, targetType:executable ... $ dub upgraade $ dub build Cheers, stew Sorry, cut-paste noise, the only interesting part is this: dependencies: { dgame:~0.5.0 },
Re: Dgame revived
On Wednesday, 4 March 2015 at 09:42:57 UTC, Gan wrote: On Wednesday, 4 March 2015 at 09:24:55 UTC, Namespace wrote: On Tuesday, 3 March 2015 at 23:01:21 UTC, Gan wrote: Oh also the green circle anti alias isn't happening. Just a plain un-anti-alis circle. Should be fixed now. Note that you now must specify the anti-aliasing, when you create the window. And you can now specify by yourself which opengl context version should be supported. See: http://dgame-dev.de/?package=Windowmodule=GLSettings Looks great. How do I use the new version in dub? Do I just set the dependency version to 0.5.0? I think that because 0.5.0 is on a branch you will need to tell dub to switch branches. This is done with a '~' in the dependencies line. You also need to run dub upgrade. Something like this (untested): --- ... sourcePaths:[.], dependencies: { dgame:~0.5.0 }, targetType:executable ... $ dub upgraade $ dub build Cheers, stew
Re: This Week in D #7 - summary of reference counting discussion
On Monday, 2 March 2015 at 04:19:08 UTC, Adam D. Ruppe wrote: This was a very active week on the forums, though most of it was centered around DIP74 and its satellite discussions, leading to a somewhat thin newsletter. http://arsdnet.net/this-week-in-d/mar-01.html https://twitter.com/adamdruppe/status/572249079352299520 This newsletter is great and has been my main source of Dlang weekly news while busy at work. Thanks.
Re: Dgame revived
On Saturday, 28 February 2015 at 22:52:47 UTC, Namespace wrote: On Saturday, 28 February 2015 at 11:02:31 UTC, Namespace wrote: Next step is Font, Text and Spritesheet. Then I'll inspect Clock, Power and MessageBox and in the end I'll inspect Audio. I think the most breaking changes will happen here, because I'll use this time SDL_Audio instead of OpenAL. Font, Text, Clock (renamed to StopWatch) and Power (renamed to Battery) were also ported. The Audio package also. Spritesheet should be redundant now, because Sprite has now a clipRect, to support the Spritesheet behaviour. What is left: add missing comments / complete comments and renew the documentation. After that I will update the website. We are moving forward! :) Comments are finished so far - the documentation can be generated. I've also begun to update the website and to update the tutorials, but I need at least a whole day to get ready. So I'll be ready in mid-March at the latest - because the next week I have to learn for my exams completely again. But you can already begin with your tests. ;) Thank you for updating Dgame so quickly. I'll give it a test later this week and report any issues on github. Cheers, stew
Re: Dgame revived
On Thursday, 26 February 2015 at 08:03:59 UTC, Gan wrote: On Thursday, 26 February 2015 at 06:33:26 UTC, Gan wrote: On Thursday, 26 February 2015 at 06:32:07 UTC, Gan wrote: On Thursday, 26 February 2015 at 03:17:32 UTC, stewarth wrote: On Thursday, 26 February 2015 at 03:01:42 UTC, Rikki Cattermole wrote: On 26/02/2015 3:57 p.m., Gan wrote: On Thursday, 26 February 2015 at 02:32:51 UTC, stewarth wrote: I'd also try hacking in Window.d directly to see if even basic gl commands work, e.g. immediately after window and context creation, try rendering a triangle then tweak the context initialisation to see if it affects anything. It may help you track down exactly which part of the GL setup is causing problems. Cheers, Stew I know almost nothing about OpenGL but using your method(sorta): void reportGLErrors() { GLenum errCode; const GLubyte *errString; if ((errCode = glGetError()) != GL_NO_ERROR) { writeln(OPEN GL ERROR: , errCode); } } I get error code 1282 repeatedly. From a google search someone says: First, glGetError() will return 1282 - invalid operation if the GL context is not current (or not yet created). So, create your context first, then call glGetError. And, verify that any parent class or member class does not call GL functions in their constructors or prior to context being created. Can someone with more OpenGL knowledge clarify what this means? 1. Program starts 2. Window gets created 3. Context gets created 4. Context is activated 5. Profit??? Basically before the context is created and activated you cannot call any OpenGL functions. If you do, they will error out. The bit about constructors ext. don't worry about it. Its just about e.g. where the calls to OpenGL can exist. Yes, my bad sorry, but whatever works. The point is dive in and start printfing about in Window.d, checking error codes to try and figure out where things become stuffed up. Cheers, Stew I did what you suggested. I added a bunch of writeln and reportGLErrors. These are the results: glMatrixMode(GL_PROJECTION); OPEN GL ERROR: 1282 glLoadIdentity(); OPEN GL ERROR: 1282 glShadeModel(GL_FLAT); OPEN GL ERROR: 1282 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); OPEN GL ERROR: 1280 glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); OPEN GL ERROR: 1280 glOrtho(0, vMode.width, vMode.height, 0, 1, -1); OPEN GL ERROR: 1282 Each error happens after each line is called. I'm not sure why this happens or what it means. According to docs: 1280 is GL_INVALID_ENUM Figured it out. DGame wants OpenGL 3.0+ context. However it uses some functions in OpenGL 2.1 that have been depreciated. The mac OpenGL doesn't allow depreciated functions. DGame's OpenGL code is too outdated to run on a 3.0+ GL context on mac. Required fix: Either lower the context to 2.1 or upgrade the code to not use depreciated functions. Great job, well done :) It's never easy debugging those sorts of errors. /stew
Re: Dgame revived
On Thursday, 26 February 2015 at 20:43:20 UTC, Namespace wrote: I've just pushed the current state of the 0.5.0 version: https://github.com/Dgame/Dgame/tree/0.5.0 It's far from finished but it works. So if anyone has requests, wishes or suggestions: now is the time. :) That's great :) At the moment my small test apps don't build due to missing features such as Audio, System.Clock etc. I assume these will be added as work progresses? I'll do some testing over the weekend with what's in place on the 0.5.0 branch and submit bug reports if I find anything. Cheers, Stew
Re: Dgame revived
On Thursday, 26 February 2015 at 03:01:42 UTC, Rikki Cattermole wrote: On 26/02/2015 3:57 p.m., Gan wrote: On Thursday, 26 February 2015 at 02:32:51 UTC, stewarth wrote: I'd also try hacking in Window.d directly to see if even basic gl commands work, e.g. immediately after window and context creation, try rendering a triangle then tweak the context initialisation to see if it affects anything. It may help you track down exactly which part of the GL setup is causing problems. Cheers, Stew I know almost nothing about OpenGL but using your method(sorta): void reportGLErrors() { GLenum errCode; const GLubyte *errString; if ((errCode = glGetError()) != GL_NO_ERROR) { writeln(OPEN GL ERROR: , errCode); } } I get error code 1282 repeatedly. From a google search someone says: First, glGetError() will return 1282 - invalid operation if the GL context is not current (or not yet created). So, create your context first, then call glGetError. And, verify that any parent class or member class does not call GL functions in their constructors or prior to context being created. Can someone with more OpenGL knowledge clarify what this means? 1. Program starts 2. Window gets created 3. Context gets created 4. Context is activated 5. Profit??? Basically before the context is created and activated you cannot call any OpenGL functions. If you do, they will error out. The bit about constructors ext. don't worry about it. Its just about e.g. where the calls to OpenGL can exist. Yes, my bad sorry, but whatever works. The point is dive in and start printfing about in Window.d, checking error codes to try and figure out where things become stuffed up. Cheers, Stew
Re: Dgame revived
On Wednesday, 25 February 2015 at 15:36:21 UTC, Gan wrote: On Tuesday, 24 February 2015 at 22:03:29 UTC, stewarth wrote: On Tuesday, 24 February 2015 at 21:10:53 UTC, Gan wrote: On Tuesday, 24 February 2015 at 21:07:04 UTC, stewarth wrote: On Tuesday, 24 February 2015 at 19:32:08 UTC, Gan wrote: On Tuesday, 24 February 2015 at 16:28:59 UTC, Namespace wrote: I had to force dub to upgrade in order for it to pull the latest code from the master branch. But on the plus side it runs. On the downside it still only displays a blank white screen for Mac users. As growlercab pointed out (https://github.com/Dgame/Dgame/pull/29), I think also that you should set the Version to 3.2 rather than 3.0. Could you give it a try and say if that works for you? No dice. Running the shapes tutorial again, just a blank screen. Console output looks good though: init openAL Derelict loaded GL version: GL33 (GL33), available GL version: 3.3 INTEL-10.0.22 Quit Event Finalize Sound (0) Sound Finalized Text: Finalize Font Font finalized Close open Windows. Open Windows closed. Finalize Texture (0) Texture Finalized quit sdl Did you try commenting out the line that sets the forward compatibility flag as well? (sorry it isn't clear from the posts) if (style Style.OpenGL) { SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); /* * SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, * SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); */ } This fixed a similar issue for me on Linux. Cheers, stew Yeah I did that, doesn't show anything but a blank white screen. OK, thanks for letting me know. Is there anything more I can test to try to get it working on Mac? Also anyone else have a Mac to test on? I wanna make sure it's not just me getting the blank white screen. Without a MAC I am just guessing, but my next steps would be along the lines of: 1. The venerable printf binary search bug hunt approach :) Check glGetError, which you can turn the error into a string with GLU as follows: --- void reportGLErrors() { GLenum errCode; const GLubyte *errString; if ((errCode = glGetError()) != GL_NO_ERROR) { errString = gluErrorString(errCode); writeln(errString.fromStringz) } // UNTESTED!! } --- I'd start the search in $Dgame/Window/Window.d before and after SDL_CreateWindow, SDL_GL_CreateContext and SDL_GL_MakeCurrent then go from there. 2. If printf didn't help I'd look at using a GL debug tool From this page: https://www.opengl.org/wiki/Debugging_Tools XCode tools Under Mac OS X, Apple provides two very handy tools for debugging OpenGL applications as part of XCode: OpenGL Driver Monitor and OpenGL Profiler. If these are anything like AMDs CodeXL (previously gDEBugger) they should tell you what GL errors are occurring each frame and on which call (including in shaders). Depending on your style you may want to swap order of the above :) Cheers, Stew
Re: Dgame revived
I'd also try hacking in Window.d directly to see if even basic gl commands work, e.g. immediately after window and context creation, try rendering a triangle then tweak the context initialisation to see if it affects anything. It may help you track down exactly which part of the GL setup is causing problems. Cheers, Stew
Re: Dgame revived
On Tuesday, 24 February 2015 at 10:01:11 UTC, Namespace wrote: On Tuesday, 24 February 2015 at 09:56:56 UTC, Gan wrote: On Tuesday, 24 February 2015 at 09:24:17 UTC, Namespace wrote: On Tuesday, 24 February 2015 at 09:07:19 UTC, Namespace wrote: On Tuesday, 24 February 2015 at 00:53:49 UTC, Mike Parker wrote: On 2/24/2015 8:18 AM, Gan wrote: Doesn't work. Still gives the same OpenGL too low error. I think you need to place the lines SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); before window creation. Yes. All SDL_GL_SetAttributes must be called before window creation for them to have any effect. I thought that was already understood. You sound a little rude. :D I thought that must precede the GLContext. That made the most sense to me. I will change it. ;) It semms there is a problem with ma DUB package: Branch ~beta: Got JSON of type undefined, expected object. Branch ~tune: Got JSON of type undefined, expected object. I deleted these branches, drafted a new tag and tried to trigger a manual update, but nothing happens. I had to force dub to upgrade in order for it to pull the latest code from the master branch. But on the plus side it runs. On the downside it still only displays a blank white screen for Mac users. Yeah, that is really strange. For all tutorials? I have already started on the weekend to begin Dgame 0.5 and revise the whole. So that's at least a glimmer of hope. Try commenting out this line: SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG) According to the opengl.org wiki this flag should not be used except in GL 3.0 and was made redundant in GL 3.1. The code snippet above is trying to set MAJOR.MINOR as GL 3.3. I just had an issue on Linux with a blank screen. Commenting out this line resolved the issue. Cheers, stew
Re: Dgame revived
On Monday, 23 February 2015 at 03:03:01 UTC, stewarth wrote: And I can confirm Dgame 0.4.1 is also working with DMD 2.067-b2 on arch linux x86_64. Cheers, stew and the same on Debian x86_64 I'm just told :) /stew
Re: Dgame revived
On Sunday, 22 February 2015 at 20:55:04 UTC, amber wrote: On Sunday, 22 February 2015 at 20:42:20 UTC, Gan wrote: On Sunday, 22 February 2015 at 09:30:10 UTC, Namespace wrote: On Sunday, 22 February 2015 at 09:05:16 UTC, Mike Parker wrote: On 2/22/2015 2:43 PM, Gan wrote: dub.json: { name: game, description: game, dependencies: { dgame: ~master } } First, you need to change your dependency to something like this: dependencies: { dgame: ~0.4.0 } Or you can use ==0.4.0, or =0.4.0. Just don't use branch-based dependencies anymore (like ~master) as those are deprecated. Second, there's a bug in Dgame's dub.json, which is causing compilation to error out. I'll post a PR for it. I have the PR merged, the problem should be fixed now. Thanks to you and growlercab. Now it builds though crashes on run with this error: init openAL derelict.util.exception.SharedLibLoadException@../../.dub/packages/derelict-util-1.9.1/source/derelict/util/exception.d(35): Failed to load one or more shared libraries: libogg.dylib - dlopen(libogg.dylib, 2): image not found libogg.0.dylib - dlopen(libogg.0.dylib, 2): image not found Error executing command run: Program exited with code 1 Press any key to continue... I think you need to install the ogg libraries. Derelict, which Dgame uses, only provides bindings to the C/C++ libraries. You still need to get the those libraries for things to work. Sorry I cannot help more. On linux it's just a matter of using the pkg manager (apt, pacman, yum etc.) On MAC I have not idea. I can confirm Dgame 0.4.1 is now working on Linux (Debian x86_64) after I did a dub upgrade. Thanks, amber And I can confirm Dgame 0.4.1 is also working with DMD 2.067-b2 on arch linux x86_64. Cheers, stew
Re: D port of the Dynamic Window Manager (DWM)
On Sunday, 11 January 2015 at 14:08:26 UTC, Dicebot wrote: On Monday, 5 January 2015 at 06:17:03 UTC, stewart h wrote: Hi, I've ported DWM to D as a learning exercise and thought I'd share it. The repository can be found here: https://bitbucket.org/growlercab/ddwm (Beware, I've only tested it on Arch-Linux 64 bit for about 1 day!) DWM is a minimalist dynamic window manager from suckless. More details on DWM can be found here http://dwm.suckless.org/ The cport branch is where I've done as little as possible to port the C code to D. It really looks like C code and is basically the DWM code compiling with DMD. Under the Downloads section is a build of ddwm-cport to try out if anyone is interested, or build from source as it's pretty easy with dub. The master branch is where I'm learning D, trying new Phobos functions and D style coding. I'm then comparing how the D-style version performs with DDWM.cport and the original DWM in terms of speed and memory. I don't expect the master branch to be stable but cport should work fine. Cheers, Stew Would you be interested in going full fork mode and adding new features to D version? I am big fan of tiling window managers and having one that is written in D and I can easily extend sounds tempting :3 That is my long term goal for this project. I am currently using the project to learn D and Phobos by doing things like replacing for-loops with std.algorithm calls etc. It's an unnecessary step but I'm finding it useful coming from C/C++. Once I get into the swing of D a bit more I will be looking to replace whole parts with new D code and adding new features. First off will probably be run time configuration and very basic theme support. I'm also keen to experiment with dispatch mechanism so it uses Phobos std.concurrency or std.signals...or both! There are still some unresolved performance issues in D-DWM but they're low priority ATM. For example the c-port branch is basically DWM compiled with DMD and yet bringing up xterm (it's a fork()/execvp() in the code) takes far longer with D-DWM than it does in original C-DWM. Cheers, Stew