Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

Nicolas F. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 24 10:52:43 PDT 2014


On Wednesday, 24 September 2014 at 16:36:29 UTC, csmith wrote:

> I came from web development, you're meaning to tell me there's 
> coding outside of writing boilerplate? Jokes aside, figured if 
> I took the time to learn a modern language, I'd be consistent 
> with adding in newer technologies :)

In that case, here's some two things on the way that may not be 
all that intuitive for a web developer when it comes to dealing 
with OpenGL, as they are quirks stemming mostly from how C works:

1. When you need to pass an array of some sort to an OpenGL 
function, remember to use foo.ptr, not &foo. foo.ptr will get you 
a pointer to an array that the rest of the world, not just D, 
understands.

2. The OpenGL spec mandates that empty error logs for shader 
compilation are to report length 0, but if you ask on an nvidia 
machine about the length of its empty error log, it will reply 
with length 1. This is because nvidia just send the length of the 
string in all cases, which for empty C strings is 1 due to the 
null-byte.

I hope this helps you along, good luck!


More information about the Digitalmars-d-learn mailing list