www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Better native D 2D graphics library?

reply "Gan" <avisaria me.com> writes:
Is there a better D graphics library in the works?

I'm using SFML(which is very easy and has lots of features) but 
it seems to use a lot of ram(if you leave it running for a while 
on a graphic intensive scene) and trying to make it include the 
dependencies with the compiled executable is complicated.

Is there a D 2D graphics library that's just as easy, cross 
platform, doesn't use X11, allows drawing to off-screen buffers 
and drawing those to screen? (plus supports nice drawing of 
shapes, circles, rectangles, lines)

I'm probably asking too much- I doubt such a thing exists.
Feb 07 2015
next sibling parent "weaselcat" <weaselcat gmail.com> writes:
On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote:
 Is there a better D graphics library in the works?

 I'm using SFML(which is very easy and has lots of features) but 
 it seems to use a lot of ram(if you leave it running for a 
 while on a graphic intensive scene) and trying to make it 
 include the dependencies with the compiled executable is 
 complicated.

 Is there a D 2D graphics library that's just as easy, cross 
 platform, doesn't use X11, allows drawing to off-screen buffers 
 and drawing those to screen? (plus supports nice drawing of 
 shapes, circles, rectangles, lines)

 I'm probably asking too much- I doubt such a thing exists.
Not what you're asking for, but you could always use SDL - I believe it has two or three bindings to D. Check on dub. I doubt you're going to find anything like SFML written in D as it's a lot of work to maintain such a project, and just duplication of effort. It's why most projects in most languages just wrap SDL in some form.
Feb 07 2015
prev sibling next sibling parent reply "Namespace" <rswhite4 gmail.com> writes:
On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote:
 Is there a better D graphics library in the works?

 I'm using SFML(which is very easy and has lots of features) but 
 it seems to use a lot of ram(if you leave it running for a 
 while on a graphic intensive scene) and trying to make it 
 include the dependencies with the compiled executable is 
 complicated.

 Is there a D 2D graphics library that's just as easy, cross 
 platform, doesn't use X11, allows drawing to off-screen buffers 
 and drawing those to screen? (plus supports nice drawing of 
 shapes, circles, rectangles, lines)

 I'm probably asking too much- I doubt such a thing exists.
I once wrote such a library: https://github.com/Dgame/Dgame But since I left D I don't maintain it. Maybe that will change in the next few weeks. But otherwise you are free to use or improve it.
Feb 07 2015
next sibling parent reply "Gan" <avisaria me.com> writes:
On Saturday, 7 February 2015 at 23:29:01 UTC, Namespace wrote:
 On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote:
 Is there a better D graphics library in the works?

 I'm using SFML(which is very easy and has lots of features) 
 but it seems to use a lot of ram(if you leave it running for a 
 while on a graphic intensive scene) and trying to make it 
 include the dependencies with the compiled executable is 
 complicated.

 Is there a D 2D graphics library that's just as easy, cross 
 platform, doesn't use X11, allows drawing to off-screen 
 buffers and drawing those to screen? (plus supports nice 
 drawing of shapes, circles, rectangles, lines)

 I'm probably asking too much- I doubt such a thing exists.
I once wrote such a library: https://github.com/Dgame/Dgame But since I left D I don't maintain it. Maybe that will change in the next few weeks. But otherwise you are free to use or improve it.
That's really cool. Very very similar to SFML. Only thing that makes me concerned is: static immutable string Disk = "D"; static immutable string Mode = "Release"; pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\derelict\\lib\\dmd\\DerelictSDL2.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\derelict\\lib\\dmd\\DerelictUtil.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\derelict\\lib\\dmd\\DerelictGL3.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameInternal.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameAudio.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameGraphics.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameSystem.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameMath.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameWindow.lib"); I'm not entirely sure what that is or if it's cross-compatible friendly or sharing-with-friends friendly. Though I really hope you re-maintain it.
Feb 07 2015
parent reply "Namespace" <rswhite4 gmail.com> writes:
On Sunday, 8 February 2015 at 01:39:19 UTC, Gan wrote:
 On Saturday, 7 February 2015 at 23:29:01 UTC, Namespace wrote:
 On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote:
 Is there a better D graphics library in the works?

 I'm using SFML(which is very easy and has lots of features) 
 but it seems to use a lot of ram(if you leave it running for 
 a while on a graphic intensive scene) and trying to make it 
 include the dependencies with the compiled executable is 
 complicated.

 Is there a D 2D graphics library that's just as easy, cross 
 platform, doesn't use X11, allows drawing to off-screen 
 buffers and drawing those to screen? (plus supports nice 
 drawing of shapes, circles, rectangles, lines)

 I'm probably asking too much- I doubt such a thing exists.
I once wrote such a library: https://github.com/Dgame/Dgame But since I left D I don't maintain it. Maybe that will change in the next few weeks. But otherwise you are free to use or improve it.
That's really cool. Very very similar to SFML. Only thing that makes me concerned is: static immutable string Disk = "D"; static immutable string Mode = "Release"; pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\derelict\\lib\\dmd\\DerelictSDL2.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\derelict\\lib\\dmd\\DerelictUtil.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\derelict\\lib\\dmd\\DerelictGL3.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameInternal.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameAudio.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameGraphics.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameSystem.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameMath.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameWindow.lib"); I'm not entirely sure what that is or if it's cross-compatible friendly or sharing-with-friends friendly. Though I really hope you re-maintain it.
It worked on Mac, Linux and Windows so far without any problems. Forget to add the documentation page I made: http://rswhite.de/dgame4/
Feb 08 2015
parent reply "Gan" <avisaria me.com> writes:
On Sunday, 8 February 2015 at 09:52:50 UTC, Namespace wrote:
 On Sunday, 8 February 2015 at 01:39:19 UTC, Gan wrote:
 On Saturday, 7 February 2015 at 23:29:01 UTC, Namespace wrote:
 On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote:
 Is there a better D graphics library in the works?

 I'm using SFML(which is very easy and has lots of features) 
 but it seems to use a lot of ram(if you leave it running for 
 a while on a graphic intensive scene) and trying to make it 
 include the dependencies with the compiled executable is 
 complicated.

 Is there a D 2D graphics library that's just as easy, cross 
 platform, doesn't use X11, allows drawing to off-screen 
 buffers and drawing those to screen? (plus supports nice 
 drawing of shapes, circles, rectangles, lines)

 I'm probably asking too much- I doubt such a thing exists.
I once wrote such a library: https://github.com/Dgame/Dgame But since I left D I don't maintain it. Maybe that will change in the next few weeks. But otherwise you are free to use or improve it.
That's really cool. Very very similar to SFML. Only thing that makes me concerned is: static immutable string Disk = "D"; static immutable string Mode = "Release"; pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\derelict\\lib\\dmd\\DerelictSDL2.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\derelict\\lib\\dmd\\DerelictUtil.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\derelict\\lib\\dmd\\DerelictGL3.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameInternal.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameAudio.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameGraphics.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameSystem.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameMath.lib"); pragma(lib, Disk ~ ":\\D\\dmd2\\src\\ext\\Dgame\\lib\\" ~ Mode ~ "\\DgameWindow.lib"); I'm not entirely sure what that is or if it's cross-compatible friendly or sharing-with-friends friendly. Though I really hope you re-maintain it.
It worked on Mac, Linux and Windows so far without any problems. Forget to add the documentation page I made: http://rswhite.de/dgame4/
Very cool. I was debating switching to SDL but now I'm only debating between switching from SFML to DGame. When I leave my SFML game running for 7 hours, it uses 700mb of ram. Also my friend can't play my games due to missing dylibs(the SFML setup process is complicated). Those are the main reasons I'm looking for an alternative. I'll do a DGame test, if it beats SFML on those issues- I'm hooked.
Feb 08 2015
parent "Namespace" <rswhite4 gmail.com> writes:
Let me hear what comes out. ;)
Feb 08 2015
prev sibling parent reply "uri" <uri.grill gmail.com> writes:
On Saturday, 7 February 2015 at 23:29:01 UTC, Namespace wrote:
 On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote:
 Is there a better D graphics library in the works?

 I'm using SFML(which is very easy and has lots of features) 
 but it seems to use a lot of ram(if you leave it running for a 
 while on a graphic intensive scene) and trying to make it 
 include the dependencies with the compiled executable is 
 complicated.

 Is there a D 2D graphics library that's just as easy, cross 
 platform, doesn't use X11, allows drawing to off-screen 
 buffers and drawing those to screen? (plus supports nice 
 drawing of shapes, circles, rectangles, lines)

 I'm probably asking too much- I doubt such a thing exists.
I once wrote such a library: https://github.com/Dgame/Dgame But since I left D I don't maintain it. Maybe that will change in the next few weeks. But otherwise you are free to use or improve it.
I use Dgame for hobby projects and can definitely recommend it.
Feb 08 2015
parent "Namespace" <rswhite4 gmail.com> writes:
On Monday, 9 February 2015 at 05:50:00 UTC, uri wrote:
 On Saturday, 7 February 2015 at 23:29:01 UTC, Namespace wrote:
 On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote:
 Is there a better D graphics library in the works?

 I'm using SFML(which is very easy and has lots of features) 
 but it seems to use a lot of ram(if you leave it running for 
 a while on a graphic intensive scene) and trying to make it 
 include the dependencies with the compiled executable is 
 complicated.

 Is there a D 2D graphics library that's just as easy, cross 
 platform, doesn't use X11, allows drawing to off-screen 
 buffers and drawing those to screen? (plus supports nice 
 drawing of shapes, circles, rectangles, lines)

 I'm probably asking too much- I doubt such a thing exists.
I once wrote such a library: https://github.com/Dgame/Dgame But since I left D I don't maintain it. Maybe that will change in the next few weeks. But otherwise you are free to use or improve it.
I use Dgame for hobby projects and can definitely recommend it.
That's nice to hear! Thank you.
Feb 09 2015
prev sibling parent "ponce" <contact gam3sfrommars.fr> writes:
On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote:
 Is there a better D graphics library in the works?

 I'm using SFML(which is very easy and has lots of features) but 
 it seems to use a lot of ram(if you leave it running for a 
 while on a graphic intensive scene) and trying to make it 
 include the dependencies with the compiled executable is 
 complicated.

 Is there a D 2D graphics library that's just as easy, cross 
 platform, doesn't use X11, allows drawing to off-screen buffers 
 and drawing those to screen? (plus supports nice drawing of 
 shapes, circles, rectangles, lines)

 I'm probably asking too much- I doubt such a thing exists.
SDL 2.x can do that with renderers.
Feb 09 2015