www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - compact library for creating window + OpenGL context + input

reply Trass3r <un known.com> writes:
(other than SDL)

Basically something like the SFML Window module, but written in D and  
working on Windoze/Linux.
Jan 08 2012
next sibling parent reply Kiith-Sa <42 theanswer.com> writes:
Trass3r wrote:

 (other than SDL)
 
 Basically something like the SFML Window module, but written in D and
 working on Windoze/Linux.
GLFW, if all you need is OpenGL (heck, even GLUT maybe). Is there any reason, though? SDL is not dead anymore, and its API is being rewritten with 1.3 (aka SDL2). Or do you mean written completely in D? (Can't think of anything, maybe GLFW would be (relatively) simple to rewrite?)
Jan 08 2012
parent reply Trass3r <un known.com> writes:
 Basically something like the SFML Window module, but written in D and
 working on Windoze/Linux.
GLFW, if all you need is OpenGL (heck, even GLUT maybe).
Isn't GLUT more or less dead and/or usage discouraged? Hmm GLFW seems to be no better than SDL.
 Is there any reason, though? SDL is not dead anymore, and its API is
 being rewritten with 1.3 (aka SDL2).
SDL in its current form is heavily flawed. Who knows when the new one will be ready. And it especially still lacks important functionality: " Required Sam: Add support for render targets Sam: Add support for OpenGL context profiles "
 Or do you mean written completely in D?
 (Can't think of anything, maybe GLFW would be (relatively) simple to  
 rewrite?)
Yep written in D. Object-oriented, modular, no external dependencies. btw, just remembered there's a basic window creation module and input handling code at https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/simpledisplay.d Could be better though.
Jan 09 2012
parent Mike Parker <aldacron gmail.com> writes:
On 1/9/2012 10:13 PM, Trass3r wrote:
 Basically something like the SFML Window module, but written in D and
 working on Windoze/Linux.
GLFW, if all you need is OpenGL (heck, even GLUT maybe).
Isn't GLUT more or less dead and/or usage discouraged? Hmm GLFW seems to be no better than SDL.
GLFW is pretty awesome, IMO. Lightweight and doesn't get in your way. Version 3 is going to be even better, but the pace of development is rather slow. I knocked up a Derelict binding to it a while back, but I'm not going to put it in the repository until GLFW 3 is actually released. I'd be happy to put it up for download somewhere if anyone wants it. Though, I don't guarantee that it's up-to-date. There may have been a change or two in the interface since I threw it together.
 Is there any reason, though? SDL is not dead anymore, and its API is
 being rewritten with 1.3 (aka SDL2).
SDL in its current form is heavily flawed. Who knows when the new one will be ready. And it especially still lacks important functionality: " Required Sam: Add support for render targets Sam: Add support for OpenGL context profiles "
 Or do you mean written completely in D?
 (Can't think of anything, maybe GLFW would be (relatively) simple to
 rewrite?)
Yep written in D. Object-oriented, modular, no external dependencies. btw, just remembered there's a basic window creation module and input handling code at https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/simpledisplay.d Could be better though.
Jan 09 2012
prev sibling next sibling parent reply Denis Shelomovskij <verylonglogin.reg gmail.com> writes:
09.01.2012 6:05, Trass3r пишет:
 (other than SDL)

 Basically something like the SFML Window module, but written in D and
 working on Windoze/Linux.
I have written a Windows OpenGL context creation for given HWND (initially for DGUI but it isn't a restriction, one just have to write his own control class) because of complicated context creation in this OS (~800 lines of D code for only context creation with desired parameters) and lack of functionality like: "here is my windows handle - create new context with it/use it with an existing one". There is no Linux support yet. There is no IO control because it is for using with a widget toolkit like DGUI, SWT, DFL, etc. I don't think you are looking for such solution, so it is here just for information. But if someone need this, I will release sources.
Jan 09 2012
parent reply Trass3r <un known.com> writes:
 I have written a Windows OpenGL context creation for given HWND  
 (initially for DGUI but it isn't a restriction, one just have to write  
 his own control class) because of complicated context creation in this  
 OS (~800 lines of D code for only context creation with desired  
 parameters) and lack of functionality like: "here is my windows handle -  
 create new context with it/use it with an existing one".
Including OpenGL 3+ contexts?
 I don't think you are looking for such solution, so it is here just for  
 information. But if someone need this, I will release sources.
Please do so, could be helpful.
Jan 09 2012
next sibling parent Denis Shelomovskij <verylonglogin.reg gmail.com> writes:
09.01.2012 17:22, Trass3r пишет:
 I have written a Windows OpenGL context creation for given HWND
 (initially for DGUI but it isn't a restriction, one just have to write
 his own control class) because of complicated context creation in this
 OS (~800 lines of D code for only context creation with desired
 parameters) and lack of functionality like: "here is my windows handle
 - create new context with it/use it with an existing one".
Including OpenGL 3+ contexts?
Yes, it was the point.
 I don't think you are looking for such solution, so it is here just
 for information. But if someone need this, I will release sources.
Please do so, could be helpful.
OK. Will do it in ~24 hours.
Jan 09 2012
prev sibling parent Denis Shelomovskij <verylonglogin.reg gmail.com> writes:
09.01.2012 17:22, Trass3r пишет:
 I don't think you are looking for such solution, so it is here just
 for information. But if someone need this, I will release sources.
Please do so, could be helpful.
IIRC it was the last working version before I decided to create a bigger library (the one that will fully cover basic OpenGL support for D, it isn't ready nor compilable): http://deoma-cmd.ru/files/other/dgl-old-but-working.7z Latest Derelict2 and DGUI are required for building. dgl\config.d, dgl\context.d, dgl\controls\dguicontrol.d - the only ready library files, compiled documentation is in docs folder. main.d, glcontrolusing.d - an example of using Note, that a window isn't needed for GLContext creation at all (first constructor). Compiles *.exe is in Debug folder.
Jan 10 2012
prev sibling next sibling parent David <d dav1d.de> writes:
Am 09.01.2012 04:05, schrieb Trass3r:
 (other than SDL)

 Basically something like the SFML Window module, but written in D and
 working on Windoze/Linux.
Thought about the same, well similiar: Porting pyglet, nice API, written in Python and works cross platform http://www.pyglet.org/
Jan 09 2012
prev sibling parent reply Mike Wey <mike-wey example.com> writes:
On 01/09/2012 04:05 AM, Trass3r wrote:
 (other than SDL)

 Basically something like the SFML Window module, but written in D and
 working on Windoze/Linux.
This one might be useful: https://github.com/AndrejMitrovic/DNeonHelium/blob/master/Samples/win32/lesson01.d -- Mike Wey
Jan 09 2012
parent Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> writes:
Another problem is that all these APIs don't allow obtaining native
handles to windows, so that OS-specific stuff can be done. For
example, both Win32 API and Xlib allow you to create alpha-blended and
shaped windows, but in a vastly different manner. I personally need an
alpha-blended shaped window for cool 3D notifications and popup-like
things. I have never seen any cross-platform API provide this kind of
functionality.

-- 
Bye,
Gor Gyolchanyan.
Jan 09 2012