Getting going with D/OpenGL

Bill Baxter dnewsgroup at billbaxter.com
Mon Oct 23 01:13:25 PDT 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/



More information about the Digitalmars-d-learn mailing list