OpenGL in D2

Siqu user at example.net
Mon Feb 21 02:33:19 PST 2011


Hi,
I'm trying to figure out how I could get a simple OpenGL/GLUT program working
in DMD2. As an attachment, I've added a C version of what I'd like to do. I'd
compile the C version using:
gcc simple.c -lglut -lGLU -o simple

I've found a few OpenGL projects, like bindings
(http://www.dsource.org/projects/bindings/) and derelict
(http://www.dsource.org/projects/derelict/), but I still can't find any way to
easily use or install them (for D2 on Ubuntu). I'd have thought that, since D
interfaces so well with C, just using C libraries wouldn't require specific
wrapper libraries, but it seems an automated method for converting C headers
to D isn't currently possible?

Anyway, any help would be appreciated,
Thanks.
begin 644 simple.c
M(VEN8VQU9&4@/$=,+V=L+F@^"B-I;F-L=61E(#Q'3"]G;'5T+F@^"@IS=&%T
M:6,@:6YT('=I;CL*"G9O:60@:6YI="AI;G0 at 87)G8RP at 8VAA<B`J*F%R9W8I
M"GL*("\O(&EN:71I86QI>F4 at 9VQU=`H at 9VQU=$EN:70H)F%R9V,L(&%R9W8I
M.PH at +R\@<W!E8VEF>2!T:&4 at 9&ES<&QA>2!M;V1E('1O(&)E(%)'0B!A;F0@
M<VEN9VQE(&)U9F9E<FEN9R`*("\O('=E('5S92!S:6YG;&4 at 8G5F9F5R:6YG
M('-I;F-E('1H:7,@=VEL;"!B92!N;VX at 86YI;6%T960*(&=L=71);FET1&ES
M<&QA>4UO9&4H1TQ55%]21T)!('P at 1TQ55%]324Y'3$4I.PH at +R\@9&5F:6YE
M('1H92!S:7IE"B!G;'5T26YI=%=I;F1O=U-I>F4H-3`P+#4P,"D["B`O+R!T
M:&4@<&]S:71I;VX@=VAE<F4@=&AE('=I;F1O=R!W:6QL(&%P<&5A<@H at 9VQU
M=$EN:717:6YD;W=0;W-I=&EO;B at Q,#`L,3`P*3L*("\O(&EF('=E('=O=6QD
M('=A;G0 at 9G5L;'-C<F5E;CH*("\O(&=L=71&=6QL4V-R965N*"D["B`O+R!C
M<F5A=&4@=&AE('=I;F1O=RP@<V5T('1H92!T:71L92!A;F0@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1TQ55"!T;R!R=6X@;6%I;B!L;V]P"B!G;'5T36%I;DQO;W`H*3L*(')E
*='5R;B`P.PI]"@``
`
end


More information about the Digitalmars-d-learn mailing list