FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Upcoming release and the future
Goto page 1, 2  Next
 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sat Jan 29, 2005 1:24 pm    Post subject: Upcoming release and the future Reply with quote

DERELICT 0.2
-------------------

It would seem that some people who use Derelict for the first time are, quite understandably, downloading the only release archive- which is horribly outdated. It would seem that I need to get a new release out the door as soon as possible. To that end, these are my next steps:

1) nix DerelictPY - I started this package because I wanted to use it for a project I had in mind. It has proven to be a huge headache, and since I began a new version of Python (2.4) has been released. So in the name of progress I'm going to remove all of DerelictPY from SVN and put it on the backburner. Somewhere down the road I hope to revisit it, but from a different angle. I would rather rewrite everything from scratch than modify the existing nightmare.

2) finish the Linux ports - I still need to get the AL, GL, and GLU packages ported to Linux. Piece of cake (or should be).

3) add SDLnet - this is the last major SDL package to add, and looks to be painless

4) a handful of sample programs

5) a short tutorial for each package, beyond the basic READMEs.

Once again, no timeframe on this stuff, other than 'as soon as possible'. The sooner the better, of course. The goal here is really to get something downloadable that a new user can unzip and get up and running with. The first 3 steps I shouldn't take long at all, but steps 4 and 5 will likely be a bit more lengthy.

If any of you have sample apps you wouldn't mind submitting, or would like to write a tutorial for one of the packages, please don't hesitate to email me. Sample apps should be sent in source form and should, preferably, demonstrate basic concepts of using Derelict packages. Tutorials should be focused on Derelict, not on the library a package wraps. I'm not looking to teach SDL here, but how to get DerelictSDL up and running. A tutorial with a corresponding sample would be perfect.

If I get no submissions, no biggie, I'll get something knocked up as soon as I can. My email address is the handle you see here AT gmail. BTW, I have 10 gmail invites if anyone wants one. I really like it much better than any webmail service I've previously used.


DERELICT'S FUTURE
-----------------------

What are some other packages you would like to see in Derelict? Please reply to this post with any ideas. I make no promises. I will evaluate anything posted, look at licenses to make sure no conflicts will arise (GPL is out!) and determine if I want to make the effort required to port a particular lib (libPNG, while smaller than Python, is even worse!).

Of course, if I decide not to port a lib, I will accept almost any contributions provided that they a) follow the same structure (both directory and code-wise) as the existing Derelict packages and b) the original library is not GPL or any other sort of license that would force Derelict users to go open source. LGPL is okay as long as the original library is available in DLL/SO form.

Here's the status on some libraries you might be thinking of:

SDL_net - coming real soon for the 0.2 release

GLFW - this will be in the 0.3 release

DirectX - I still want to do this, and I will, but it's not a high priority right now

libPNG - forget it. I really wanted to include this, but there are just so many conditional compilation oprtions that there's no way I can get an accurate representation of the headers in D. Those guys need to be shot for the way they designed that library. If anyone can get a working version in D, that can be configured to match any libPNG DLL, I'll happily include it. Otherwise, this may be a candidate for rewriting altogether in D.

Let me hear what you want!
Back to top
View user's profile Send private message Send e-mail
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Thu Feb 10, 2005 12:21 am    Post subject: Reply with quote

Aldacron,

I'm nearly finished implementing a GLFW branch for derelict. You can add it if you want when I'm done. I have to finish it up, then test it to see that it works satisfactorily on Win32 and Linux.

Later,

John R.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Thu Feb 10, 2005 2:56 pm    Post subject: Reply with quote

I've completed the initial version of derelict.glfw for win32. I'll work on the linux version shortly.

There are two versions of the loader:

1) The first one maps the loaded glfw functions to simpler names. For example instead of the real function name "glfwOpenWindow()", I remap to the d-style name openWindow(). The qualified name is derelict.glfw.openWindow(). I think this improves readability. I did it this way because I find the C style prefixing "glfw" to be redundant in D (the module name already contains glfw). Unfortunately, the qualified name is too long now. A solution is to simply remove glfw.d from the derelict directory all together such that importing glfw renders the fully qualified name glfw.openWindow(). It's simple and looks good.

2) In the second method, I've left the actual names in place in the style of Derelict's other modules.

Method #1 has a minor issue: although it works fine and looks pretty, it's still possible to just call "openWindow()" undecorated because all remapped glfw names are pulled into the current namespace when the module is imported (as is normal for D). Without the glfw decorating the functions, it won't look as clear (to people reading the code) which library is being used. So the only benefit for that method is if you decide to make sure you always prepend the module name to the function: glfw.openWindow() as a convention. In this case, I think it's a good idea.

I'm also interested in encapsulating these functions into a struct or class. As an added bonus, the dynamic loading process can be done in a constructor (although structs don't have those yet Sad ). This doesn't fit into the current derelict methodology, so I might just make this a separate personal project, instead.

Meanwhile the basic glfw interface can go into Derelict when Aldacron needs it.

One other issue I ran into with glfw. In order to make the library work, you must download the glfw archive from the author's site. In that archive is the glfw.dll. Unfortunately that particular dll does not contain the glfwSetTime() function for some wierd reason (that's the only function that didn't load so I commented it out). If you need that function, you'll have to compile the glfw source to a dll yourself with Visual C++ 6. You could also use any of several other C/C++ compilers, but as far as I can tell, most other compilers create symbol names with the '_' prefix and "@#" postfix, which means you'll have to plug in all those symbols into the glfw.d loader code to get the functions loaded correctly - it's kind of annoying how the dll's aren't alike (if you know how to eliminate those symbols in the particular compiler... more power to you!).

I'm going to get some glfw code demos converted to D to test the interface. I'll include those in the package when it's done.

I admit that some of these ideas are inconsistant with Derelicts current design, so I won't offer the described changes for inclusion. The original directly mapped names are available for Derelict's use (#2). I can keep mine as an independent project for glfw.

Later,

John R.
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Thu Feb 10, 2005 9:29 pm    Post subject: Reply with quote

JJR wrote:
I've completed the initial version of derelict.glfw for win32. I'll work on the linux version shortly.


Woohoo! One less lib I have to port Smile Though to be honest I was rather looking forward to it since I haven't touched GLFW in a couple of years.

Quote:

There are two versions of the loader:

2) In the second method, I've left the actual names in place in the style of Derelict's other modules.


This is the way I would like to go with it. The idea is that if you were looking at code you picked up on the net, you would be able to translate it directly to D via Derelict with as few changes as possible.

Quote:

I'm also interested in encapsulating these functions into a struct or class. As an added bonus, the dynamic loading process can be done in a constructor (although structs don't have those yet Sad ). This doesn't fit into the current derelict methodology, so I might just make this a separate personal project, instead.


This is something that has very much been on my mind. Derelict is intended to be a direct binding to libraries, not an encapsulation. However, I have worked a bit with LWJGL (Lightweight Java Gaming Library) in Java and really like how they have set it up. I have been toying with the idea of creating a 'LWDGL' along the same lines. Unlike Derelict, this would be focused solely on game development. It would go beyond Derelict by wrapping graphics and audio libraries in classes, loading OpenGL extensions, and providing abstract interfaces for managing the display and input events. The Derelict bindings for SDL or GLFW could be used for the implemenations. And, as my thinking goes, it would borrow heavily from LWJGL in the design department while adding a few extras. Something like I envision:

Code:

Display.open(width, height, bpp);
GL11.glClearColor(...);
GL11.glClear(GL_COLOR_BUFFER_BIT);

if(GL12.exists())
   GL12.glSomeFunction();
if(GLARBVertexBufferObject.exists())
   GLARBVertexBufferObject.doSomething();

if(Keyboard.isKeyDown(Keyboard.KEY_SPACE))
   AL.alSomeFunction();

Keyboard.bindAction(keyEventDescription,  keyActionDelegate);
...



This could then be used as a headstart on a game engine.

Code:

Meanwhile the basic glfw interface can go into Derelict when Aldacron needs it.


If it's done, send it on in! I still need to get the linux ports for GL, AL, and GLU completed along with some samples. So there's plenty of time yet to include GLFW in the next release archive.

Quote:

One other issue I ran into with glfw. In order to make the library work, you must download the glfw archive from the author's site. In that archive is the glfw.dll. Unfortunately that particular dll does not contain the glfwSetTime() function for some wierd reason (that's the only function that didn't load so I commented it out). If you need that function, you'll have to compile the glfw source to a dll yourself with Visual C++ 6.


I'll include that in the README. I'll also include instructions on how to build it with MingW without the mangled function names.

Quote:

I'm going to get some glfw code demos converted to D to test the interface. I'll include those in the package when it's done.


Great!

Quote:

I admit that some of these ideas are inconsistant with Derelicts current design, so I won't offer the described changes for inclusion. The original directly mapped names are available for Derelict's use (#2). I can keep mine as an independent project for glfw.


Or, since you've gone through the trouble of including them, we could wrap the new names in a version statement (perhaps version(NO_PREFIX) or some such), with the default being glfw*.

Thanks for doing this. There's no telling how long it would have been before I had gotten around to it myself. You can send it to aldacron over at gmail COM when it's done.
Back to top
View user's profile Send private message Send e-mail
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Fri Feb 11, 2005 2:18 am    Post subject: Reply with quote

aldacron wrote:
Woohoo! One less lib I have to port Smile Though to be honest I was rather looking forward to it since I haven't touched GLFW in a couple of years.


Very Happy

aldacron wrote:
Quote:

There are two versions of the loader:

2) In the second method, I've left the actual names in place in the style of Derelict's other modules.


This is the way I would like to go with it. The idea is that if you were looking at code you picked up on the net, you would be able to translate it directly to D via Derelict with as few changes as possible.


Okay... That's what I figured.

aldacron wrote:
This is something that has very much been on my mind. Derelict is intended to be a direct binding to libraries, not an encapsulation. However, I have worked a bit with LWJGL (Lightweight Java Gaming Library) in Java and really like how they have set it up. I have been toying with the idea of creating a 'LWDGL' along the same lines. Unlike Derelict, this would be focused solely on game development. It would go beyond Derelict by wrapping graphics and audio libraries in classes, loading OpenGL extensions, and providing abstract interfaces for managing the display and input events. The Derelict bindings for SDL or GLFW could be used for the implemenations. And, as my thinking goes, it would borrow heavily from LWJGL in the design department while adding a few extras. Something like I envision:

Code:

Display.open(width, height, bpp);
GL11.glClearColor(...);
GL11.glClear(GL_COLOR_BUFFER_BIT);

if(GL12.exists())
   GL12.glSomeFunction();
if(GLARBVertexBufferObject.exists())
   GLARBVertexBufferObject.doSomething();

if(Keyboard.isKeyDown(Keyboard.KEY_SPACE))
   AL.alSomeFunction();

Keyboard.bindAction(keyEventDescription,  keyActionDelegate);
...



This could then be used as a headstart on a game engine.


Sounds like fun!

aldacron wrote:
If it's done, send it on in! I still need to get the linux ports for GL, AL, and GLU completed along with some samples. So there's plenty of time yet to include GLFW in the next release archive.


It's basically done... on windows at least. I want to get it working on Linux and touch it up a bit before I send it in. I thought GL and GLU were already working on Linux. Wasn't claysaurus usign derelict in his project already?

aldacron wrote:
I'll include that in the README. I'll also include instructions on how to build it with MingW without the mangled function names.


Great! So you can disable the mangling on gcc? That'll help.

aldacron wrote:
Quote:

I'm going to get some glfw code demos converted to D to test the interface. I'll include those in the package when it's done.


Great!


I just finished a couple of the glfw examples for Windows. I'm not pleased with the performance; it runs fine, but for some reason, it runs less than half as fast (noted by fps -- half the framerate) as the equivalent C example compiled with openwatcom 1.3. The openwatcom version links with a static lib. I don't know what's causing the obvious slowdown. OH well, at least it works. I might try compiling the sample with dmc and a static lib and then a dll to see if their's a difference in performance there.

aldacron wrote:
Or, since you've gone through the trouble of including them, we could wrap the new names in a version statement (perhaps version(NO_PREFIX) or some such), with the default being glfw*.


Good idea! I never thought of that. I added the version(NO_PREFIX) and have succeeded in compiling in both modes. So far I've tested only the NO_PREFIX mode with 2 glfw examples: triangle.d and mthello.d.

aldacron wrote:
Thanks for doing this. There's no telling how long it would have been before I had gotten around to it myself. You can send it to aldacron over at gmail COM when it's done.


Smile

Your welcome. It was actually kind of fun. Since I've got the windows port done, I may as well send it off to you while I continue fixing up the examples. I'll get the linux port done shortly, then send you an update in the next little while.

Later,

John R.
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Fri Feb 11, 2005 4:46 am    Post subject: Reply with quote

JJR wrote:
I thought GL and GLU were already working on Linux. Wasn't claysaurus usign derelict in his project already?


Yes, he has them all working for his project, but I have yet to commit anything to svn for Derelict. The stumbling block for me, for OpenGL at least, was the glx* functions (which clayasaurus isn't using). Getting DerelictGL operable on Linux is a couple of version statements - as long as you only use it with SDL (and perhaps now GLFW). But if someone wanted to go the X11 route, they need the glx* functions. To define those in Derelict, I need to somehow include a port of the X11 headers. Doing the wgl* stuff was easy with std.c.windows.windows and a few extra declarations that were missing. I have no idea yet how to do the X11 stuff. Maybe GDC has X11 ported? At any rate, I'll be revisiting this when I look at the Linux port coming up and will include the X11 stuff if I can and if not, just go without it for now. This is the same reason the SDL_WM stuff in Derelict isn't functioning on Linux.

Quote:

Great! So you can disable the mangling on gcc? That'll help.


IIRC it's a simple command line switch, --kill-at, or something close to it.

Quote:

I just finished a couple of the glfw examples for Windows. I'm not pleased with the performance; it runs fine, but for some reason, it runs less than half as fast (noted by fps -- half the framerate) as the equivalent C example compiled with openwatcom 1.3. The openwatcom version links with a static lib. I don't know what's causing the obvious slowdown. OH well, at least it works. I might try compiling the sample with dmc and a static lib and then a dll to see if their's a difference in performance there.


The GLFW guy did his own D port some time ago, going the import lib linkage route. I recall seeing it in cvs after they moved to sourceforge. Perhaps, if it is still compilable with the current DMD, you can give that a go and see if it demonstrates a slowdown or not. Maybe that will help point you toward finding the cause.
Back to top
View user's profile Send private message Send e-mail
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Fri Feb 11, 2005 5:35 am    Post subject: Reply with quote

aldacron wrote:
Yes, he has them all working for his project, but I have yet to commit anything to svn for Derelict. The stumbling block for me, for OpenGL at least, was the glx* functions (which clayasaurus isn't using). Getting DerelictGL operable on Linux is a couple of version statements - as long as you only use it with SDL (and perhaps now GLFW). But if someone wanted to go the X11 route, they need the glx* functions. To define those in Derelict, I need to somehow include a port of the X11 headers. Doing the wgl* stuff was easy with std.c.windows.windows and a few extra declarations that were missing. I have no idea yet how to do the X11 stuff. Maybe GDC has X11 ported? At any rate, I'll be revisiting this when I look at the Linux port coming up and will include the X11 stuff if I can and if not, just go without it for now. This is the same reason the SDL_WM stuff in Derelict isn't functioning on Linux.


Interesting. Now I remember I was supposed to have a look at the Linux version and see what I could do. I don't think it should be that difficult to get it all linux ready. I've already worked with the linux dynamic loader once before. It should be straight forward to get that working and get the correct glx functions added. I'll have a look.

aldacron wrote:
The GLFW guy did his own D port some time ago, going the import lib linkage route. I recall seeing it in cvs after they moved to sourceforge. Perhaps, if it is still compilable with the current DMD, you can give that a go and see if it demonstrates a slowdown or not. Maybe that will help point you toward finding the cause.


Actually, I had compiled it for dmc over 6 months ago. I had modified one of the make files for digitalmars. I was using a working library for d, but I wasn't testing for performance at the time. I'll just dredge up the makefile again and see if a static link with digitalmars makes a difference.

- John
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Fri Feb 11, 2005 11:03 am    Post subject: Reply with quote

JJR wrote:
I don't think it should be that difficult to get it all linux ready. I've already worked with the linux dynamic loader once before. It should be straight forward to get that working and get the correct glx functions added. I'll have a look.


Heh, good luck! I remember looking at one of the glx functions and seeing that one of the parameters was XDisplay or somesuch. Looking at the X11 headers I found this huge struct that pulled in a bunch of stuff from several other headers. So to really get the full functionality, you need a way to call into the X11 libraries to set up the display and whatever else, and extract the data that needs to be passed to the glx* routines. And that means porting the X11 headers, which is a huge undertaking.
Back to top
View user's profile Send private message Send e-mail
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Fri Feb 11, 2005 1:18 pm    Post subject: Reply with quote

Well... it may be trickier then I imagined. I didn't realize you went to all that trouble. I'll be at work all weekend, but I should have a chance to see what needs to be done.

Later,

John R.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Fri Feb 11, 2005 2:38 pm    Post subject: Reply with quote

aldacron wrote:
The GLFW guy did his own D port some time ago, going the import lib linkage route. I recall seeing it in cvs after they moved to sourceforge. Perhaps, if it is still compilable with the current DMD, you can give that a go and see if it demonstrates a slowdown or not. Maybe that will help point you toward finding the cause.


Well, I tried it with dmc static lib and dmd. I used your derelict.gl and derelict .glu for opengl.

The performance was on par with OpenWatcom C build.

So obviously something is slowing down the derelict GLFW that I provided. I don't know what's doing it. Hopefully I can figure it out.

Later,

John R.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Fri Feb 11, 2005 2:42 pm    Post subject: Reply with quote

The slowdown could be completely in the glfw.dll that's provided, since that's the only one I've been using.

If you get a gcc glfw.dll compiled, maybe I should give that a test.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Fri Feb 11, 2005 3:09 pm    Post subject: Reply with quote

I ran a couple of tests:

1) Compiled a glfw.dll with mingw-gcc-3.4.2. I then used the dll with the derelict.glfw triangle.d example. Low and behold, it ran just as slow as when using the provided glfw.dll.

2) Compiled a glfw.dll with openwatcom again. This time I found a linker switch that disables the function decoration Smile. The dll is twice as big as that made by gcc, but when I used it with the d triangle.exe, it had full performance (the same speed as the C staticly linked one)! Yay!

So the problem is in the dll. I still don't know why gcc was slow and openwatcom was fast. Maybe it has to do with some optimization settings or compiler switches. Beats me. But I'll use the openwatcom compiled dll for now. Maybe I'll check the performance of a dmc compiled dll too.

- John R.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Fri Feb 11, 2005 4:23 pm    Post subject: Reply with quote

aldacron wrote:
JJR wrote:
I don't think it should be that difficult to get it all linux ready. I've already worked with the linux dynamic loader once before. It should be straight forward to get that working and get the correct glx functions added. I'll have a look.


Heh, good luck! I remember looking at one of the glx functions and seeing that one of the parameters was XDisplay or somesuch. Looking at the X11 headers I found this huge struct that pulled in a bunch of stuff from several other headers. So to really get the full functionality, you need a way to call into the X11 libraries to set up the display and whatever else, and extract the data that needs to be passed to the glx* routines. And that means porting the X11 headers, which is a huge undertaking.


But the glx functions shouldn't be necessary if one is using glfw or glut, correct? Those libraries take care of the low level setup for you. Does SDL still need them?

It seems to me that the need arises for the glx* functions only if you are interested in directly setting up the X window. Maybe I'm wrong?

- John R.
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Fri Feb 11, 2005 9:32 pm    Post subject: Reply with quote

JJR wrote:

But the glx functions shouldn't be necessary if one is using glfw or glut, correct? Those libraries take care of the low level setup for you. Does SDL still need them?

It seems to me that the need arises for the glx* functions only if you are interested in directly setting up the X window. Maybe I'm wrong?


You are correct. And that capability needs to be available in Derelict. The goal is to allow someone to write an OpenGL app in D the same as they can in C. Not everyone will want to use SDL or GLFW, so the X11 option ought to be there. It's possible right now to use DerelictGL with the Win32 API, after all. It would be nice to have X11 stuff in Phobos, as the Win32 stuff is.
Back to top
View user's profile Send private message Send e-mail
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Fri Feb 11, 2005 10:30 pm    Post subject: Reply with quote

Ok I understand what you mean now. I'll continue to look into it.

As for the derelict.glfw, did you receive my email?

Later,

John R.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group