Jump to page: 1 2 3
Thread overview
Getting going with D/OpenGL
Oct 23, 2006
Bill Baxter
Oct 23, 2006
Bill Baxter
Oct 23, 2006
James Pelcis
Oct 24, 2006
James Pelcis
Oct 26, 2006
James Pelcis
Oct 26, 2006
Paolo Invernizzi
Oct 24, 2006
Bill Baxter
Oct 23, 2006
Mike Parker
Oct 23, 2006
clayasaurus
Oct 24, 2006
Bill Baxter
Nov 02, 2006
Bradley Smith
Nov 02, 2006
Bradley Smith
October 23, 2006
What's the easiest way to get going with OpenGL under D?
It seems like Derelict has OpenGL support using SDL, but I don't really like SDL's single-window limitation or draconian approach to window resizing (i.e. trash all your textures).

Are there other options?  What's the best supported / actively developed?

I was considering working on a GLUI-alike library.  GLUI is a simple, easy to use GUI library based on OpenGL.  It's pretty popular in the graphics research community just because it's so brain-dead easy to use, is very lightweight, and has very few dependencies.  Perfect for slapping a few buttons and sliders up on the screen to control your OpenGL program.  I think it could be very nice for D, since D is also all about ease-of-use.

--bb
October 23, 2006
Bill Baxter wrote:

> What's the easiest way to get going with OpenGL under D?

Use either e.g. Derelict's loaders, or the OpenGL import modules:

http://www.dsource.org/projects/derelict/
http://www.dsource.org/projects/bindings/
http://shinh.skr.jp/d/porting.html
http://www.algonet.se/~afb/d/

One approach uses function pointers and loads symbols at runtime,
while the other links directly to the libraries (as in C or C++).

I will be bundling my modules for SDL and GL with my GDC builds,
and wxD now has preliminary samples for using SDL and GL, as well.

import sdl.sdl;
import gl.gl;

> It seems like Derelict has OpenGL support using SDL, but I don't really like SDL's single-window limitation or draconian approach to window resizing (i.e. trash all your textures).

You don't have to use SDL to use GL, but you can if you like.
(i.e. SDL can use GL, but you can go directly to GL instead...)

> Are there other options?  What's the best supported / actively developed?

Both of the two approaches mentioned above are still supported.

> I was considering working on a GLUI-alike library.  GLUI is a simple, easy to use GUI library based on OpenGL.  It's pretty popular in the graphics research community just because it's so brain-dead easy to use, is very lightweight, and has very few dependencies.  Perfect for slapping a few buttons and sliders up on the screen to control your OpenGL program.  I think it could be very nice for D, since D is also all about ease-of-use.

Yes, GLUI would work fine for D. And GLUT can also be used,
if you only need a simple GL window and not a full "GUI" ?

There is also the GLFW project: http://glfw.sourceforge.net/

--anders
October 23, 2006
Anders F Björklund wrote:
> Bill Baxter wrote:
> 
>> What's the easiest way to get going with OpenGL under D?
> 
> Use either e.g. Derelict's loaders, or the OpenGL import modules:
> 
> http://www.dsource.org/projects/derelict/
> http://www.dsource.org/projects/bindings/
> http://shinh.skr.jp/d/porting.html
> http://www.algonet.se/~afb/d/
> 
> One approach uses function pointers and loads symbols at runtime,
> while the other links directly to the libraries (as in C or C++).

Which is which?  Do they all support OpenGL 2.0?  Looks like Derelict does now.  Are there any conflicts from having them all installed (e.g. does more than one want to be called gl.gl)?  Any performance/functionality differences?

> I will be bundling my modules for SDL and GL with my GDC builds,
> and wxD now has preliminary samples for using SDL and GL, as well.
> 
> import sdl.sdl;
> import gl.gl;
> 
>> It seems like Derelict has OpenGL support using SDL, but I don't really like SDL's single-window limitation or draconian approach to window resizing (i.e. trash all your textures).
> 
> You don't have to use SDL to use GL, but you can if you like.
> (i.e. SDL can use GL, but you can go directly to GL instead...)

Ah, but I do like the SDL's cross-platform goodness.  Certain don't want to bother with a bunch of wgl-ing or WinMain-ing to get an otherwise platform neutral GL app up and running.

[...]
> Yes, GLUI would work fine for D. And GLUT can also be used,
> if you only need a simple GL window and not a full "GUI" ?

I was thinking more of rewriting something "GLUI-like" in D rather than actually wrapping GLUI.  GLUI depends on GLUT for its windowing and input which is kinda annoying, since GLUT has some problems.  And the GLUI code's concept of OO is ... interesting.  Ideally the input/window interface would be abstracted a little bit, so the toolkit could work on top of SDL, for example (albeit single-windowed) or GLUT, or GLFW.  And maybe I'd like to add some simple theming, too.  Not everybody's crazy about the Win95 look 'n' feel, after all. :-)


> There is also the GLFW project: http://glfw.sourceforge.net/
October 23, 2006
Bill Baxter wrote:

>> Use either e.g. Derelict's loaders, or the OpenGL import modules:
>>
>> http://www.dsource.org/projects/derelict/
>> http://www.dsource.org/projects/bindings/
>> http://shinh.skr.jp/d/porting.html
>> http://www.algonet.se/~afb/d/
>>
>> One approach uses function pointers and loads symbols at runtime,
>> while the other links directly to the libraries (as in C or C++).
> 
> Which is which?  Do they all support OpenGL 2.0?  Looks like Derelict does now.  Are there any conflicts from having them all installed (e.g. does more than one want to be called gl.gl)?  Any performance/functionality differences?

Let's see now, the first two uses loaders and the second two linking.

They all live in different D namespaces, even though I think all of
the modules based on DedicateD's use the sdl.sdl/[open]gl.gl naming ?

There is a minor cost in space for the function pointers and startup
loading time, but that shouldn't make any difference in actual use...

I just use the import modules directly, since I find it to be easier.
(especially on platforms like Mac, without DMD and Build easy to use)

>> You don't have to use SDL to use GL, but you can if you like.
>> (i.e. SDL can use GL, but you can go directly to GL instead...)
> 
> Ah, but I do like the SDL's cross-platform goodness.  Certain don't want to bother with a bunch of wgl-ing or WinMain-ing to get an otherwise platform neutral GL app up and running.

No, but it is much easier to just use GLUT or GLFW for that...

> I was thinking more of rewriting something "GLUI-like" in D rather than actually wrapping GLUI.  GLUI depends on GLUT for its windowing and input which is kinda annoying, since GLUT has some problems.  And the GLUI code's concept of OO is ... interesting.  Ideally the input/window interface would be abstracted a little bit, so the toolkit could work on top of SDL, for example (albeit single-windowed) or GLUT, or GLFW.  And maybe I'd like to add some simple theming, too.  Not everybody's crazy about the Win95 look 'n' feel, after all. :-)

No, something themable would be nice - I agree with you.

I even did an attempt to make it look a little like MacOS,
by using freetype for the fonts and some bitmap buttons ?
But it wasn't finished, and I didn't need it in the end...

--anders
October 23, 2006
Bill Baxter wrote:
> What's the easiest way to get going with OpenGL under D?
> It seems like Derelict has OpenGL support using SDL, but I don't really 

DerelictGL is independent of DerelictSDL. You can use it with whatever library you like that creates the OpenGL context for you.
October 23, 2006
Bill Baxter wrote:

> Do they all support OpenGL 2.0?  Looks like Derelict does now. 

I think that Derelict and Jamie Pelcis bindings* do now.
(* see D.announce/2982, but summerseas.com seems gone ?)

The DedicateD bindings used Microsofts GL 1.1 (I think)
and for my updated version I used SGI's SI: OpenGL 1.2
So you would have to use GL's extension mechanisms, to
use the newer features with those older import modules.

(DedicateD is still at http://int19h.tamb.ru/files.html)

I'm thinking to update mine to use Mesa3D and FreeGLUT,
instead of the SGI OpenGL and GLUT that I currently have.
i.e. use the newer open source versions, instead of the
old and unmaintained vendor reference implementations...

Then again OpenGL 1.x is working just fine for "gears" :-)
And most people seem to prefer the Derelict loaders, so.

--anders
October 23, 2006
Bill Baxter wrote:
> What's the easiest way to get going with OpenGL under D?
> It seems like Derelict has OpenGL support using SDL, but I don't really like SDL's single-window limitation or draconian approach to window resizing (i.e. trash all your textures).
> 
> Are there other options?  What's the best supported / actively developed?

In defense of SDL...

1) Losing the OpenGL context on window resize only happens on Windows
2) Multi-window support in the future http://www.gamedev.net/community/forums/topic.asp?topic_id=380142


However, if you are going to make an standard OpenGL GUI, you should make it work with Win32, SDL, GLUT, GLFW, X, etc.
October 23, 2006
Anders F Björklund wrote:
> I think that Derelict and Jamie Pelcis bindings* do now.
> (* see D.announce/2982, but summerseas.com seems gone ?)

Yes, they both support OpenGL 2.0.

Unless you need some of the extensions that aren't currently available with Derelict (I have all of them), I recommend you use Derelict instead.  Aldacron is doing a much better job at maintenance than I am.

P.S.
summerseas.com isn't likely to be up for a while, as the server is between states and the destination doesn't have internet access right now.  If you still want the bindings, I can email them to you.
October 24, 2006
clayasaurus wrote:
> Bill Baxter wrote:
>> What's the easiest way to get going with OpenGL under D?
>> It seems like Derelict has OpenGL support using SDL, but I don't really like SDL's single-window limitation or draconian approach to window resizing (i.e. trash all your textures).
>>
>> Are there other options?  What's the best supported / actively developed?
> 
> In defense of SDL...
> 
> 1) Losing the OpenGL context on window resize only happens on Windows

Really?  GLUT supports resize without trashing the context on Windows. I wonder why SDL can't.  I thought I remembered the argument went something like "some platforms don't allow it, so we just trash the context on every platform to maintain consistent cross-platform behavior".  But if it only happens on Windows, then I don't get the reasoning...

> 2) Multi-window support in the future http://www.gamedev.net/community/forums/topic.asp?topic_id=380142

That'll be nice when it arrives, but according to Bob in the post below, it's been in the works since Fall of 2004, so I'm not holding my breath.
http://www.libsdl.org/pipermail/sdl/2005-July/069565.html

> However, if you are going to make an standard OpenGL GUI, you should make it work with Win32, SDL, GLUT, GLFW, X, etc.

I think so too.  They all do about the same thing, so it would be nice to have them wrapped up in an abstract interface, even if only one of them is supported initially.

--bb
October 24, 2006
James Pelcis wrote:

> Unless you need some of the extensions that aren't currently available with Derelict (I have all of them), I recommend you use Derelict instead.  Aldacron is doing a much better job at maintenance than I am.

And on the plus side, you don't have to use "std.loader" either.

> P.S.
> summerseas.com isn't likely to be up for a while, as the server is between states and the destination doesn't have internet access right now.  If you still want the bindings, I can email them to you.

They were being linked to from:
http://www.dsource.org/projects/bindings/wiki/SimpleDirectMediaLayer
http://www.dsource.org/projects/bindings/wiki/OpenGraphicsLibrary
http://www.dsource.org/projects/bindings/wiki/OpenAudioLibrary

Maybe your old files could be uploaded to the SVN there, instead ?
http://www.dsource.org/projects/bindings/browser/trunk

--anders
« First   ‹ Prev
1 2 3