Re: Using OpenGL (custom port)

2009-10-04 Thread Moritz Warning
On Sun, 04 Oct 2009 19:52:12 -0400, David Butler wrote: [..] > Is there a difference between a pointer to a D array and an int* in C? > How do I convert between the two? Am I even looking in the right place? > You can think of a D array as a struct of a length value and a C pointer. struct Arr

Re: Using OpenGL (custom port)

2009-10-04 Thread David Butler
Oops, I edited part of the code. Just substitute in 'tmpContext' anywhere you see 'context'.

Using OpenGL (custom port)

2009-10-04 Thread David Butler
I'm a bit new to D, but seem to be mostly getting the hang of things. For a learning project, I decided to do something in OpenGL from scratch (including porting the headers). As far as I can tell, things are mostly ported properly... I can create an OpenGL 2.1 context, basic functions work, e

Re: __func__

2009-10-04 Thread Jarrett Billingsley
On Sun, Oct 4, 2009 at 5:12 PM, Zarathustra wrote: > Does in D exist something like __func__? > For example in gcc: > int main(){ printf("%s", __func__); ...} > returns "main". > No. There is a ridiculous workaround though. // Parsing mangles for fun and profit. char[] _getJustName(char[] mangl

__func__

2009-10-04 Thread Zarathustra
Does in D exist something like __func__? For example in gcc: int main(){ printf("%s", __func__); ...} returns "main".

Re: Getting started - D meta-program question

2009-10-04 Thread Justin Johansson
downs Wrote: > Justin Johansson wrote: > > Daniel Keep Wrote: > > > > Just now I've written a bit of CS101 play around code (shown below) for > > constructing a > > singly-linked list of numbers (Conslist idiom). As the code seems to work, > > it looks like > > I've cut my first teeth on "D me

Re: Sizeof class instance

2009-10-04 Thread Jeremie Pelletier
Justin Johansson wrote: Jeremie Pelletier Wrote: Justin Johansson wrote: Jarrett Billingsley Wrote: On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson wrote: How does one determine the sizeof (in bytes) of an instance of a class in D? .sizeof works as advertised for structs, but for referen

Re: Getting started - D meta-program question

2009-10-04 Thread downs
Justin Johansson wrote: > Daniel Keep Wrote: > >> Justin Johansson wrote: >>> There was mention** on the general discussion group that the D >>> foreach_reverse >>> language construct could be replaced (emulated?) with a (D) meta-program. >>> >>> ** "Even a novice programmer can write a meta-prog

Re: Sizeof class instance

2009-10-04 Thread grauzone
Justin Johansson wrote: grauzone Wrote: Justin Johansson wrote: How does one determine the sizeof (in bytes) of an instance of a class in D? .sizeof works as advertised for structs, but for reference types, .sizeof yields the sizeof the referencing variable (effectively same as size of a poi

Re: Sizeof class instance

2009-10-04 Thread Justin Johansson
grauzone Wrote: > Justin Johansson wrote: > > How does one determine the sizeof (in bytes) of an instance of a class in D? > > > > .sizeof works as advertised for structs, but for reference types, > > .sizeof yields the sizeof the referencing variable (effectively same as > > size of a pointer)

Re: Sizeof class instance

2009-10-04 Thread grauzone
Justin Johansson wrote: How does one determine the sizeof (in bytes) of an instance of a class in D? .sizeof works as advertised for structs, but for reference types, .sizeof yields the sizeof the referencing variable (effectively same as size of a pointer) and not the size of the underlying in

Re: Sizeof class instance

2009-10-04 Thread Justin Johansson
Jeremie Pelletier Wrote: > Justin Johansson wrote: > > Jarrett Billingsley Wrote: > > > >> On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson wrote: > >>> How does one determine the sizeof (in bytes) of an instance of a class in > >>> D? > >>> > >>> .sizeof works as advertised for structs, but fo