Using OpenGL (custom port)

David Butler xadrian at gmail.com
Tue Oct 6 12:29:36 PDT 2009


I got it working, it did turn out to be a slight error in the type 
declaration.  I had this:

typedef HGLRC function (HDC hDC, HGLRC hShareContext, in int 
*attribList) PFNWGLCREATECONTEXTATTRIBSARBPROC;

And it needed to be:

typedef extern (Windows) ...everything else...

Whoops.  But I can now successfully create a 3.0 context. Yay!

You can get the latest extension headers for OpenGL from 
http://www.opengl.org/registry/#headers (glext.h, wglext.h, glxext.h). 
You should only need two of them, depending on the platform (I think) 
and just use the standard, old-timey gl.h from your system.  glext.h is 
huge, but pretty easy to convert if you have a regex search/replace tool.





div0 wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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?
>>
>> Thanks for any help!
>>
>> -Dave Butler
>
> There's nothing wrong with your int array.
> What's GetLastError tell you?
>
> According to the spec you can just pass null as the attrs anyway
> to get a default, try that.
>
> Only other thing I can suggest is maybe you've got the calling
> convention of PFNWGLCREATECONTEXTATTRIBSARBPROC wrong.
> But you only need to declare it in an extern (windows) block.
>
> Just out of curiosity where did you get the c headers for opengl 3?
>
> My card doesn't support it unfortunately so I've not bothered getting
> hold of it so far.
>
> - --
> My enormous talent is exceeded only by my outrageous laziness.
> http://www.ssTk.co.uk
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iD8DBQFKy4fbT9LetA9XoXwRAkUiAKCi/APnNEJDDVYx0jv6vyo03ji86wCfTXns
> Sa178i0Ry3U+tD1o2awy8d8=
> =t3Cb
> -----END PGP SIGNATURE-----


More information about the Digitalmars-d-learn mailing list