Using OpenGL

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 3 09:07:52 PDT 2016


On Saturday, 3 September 2016 at 16:01:34 UTC, Mike Parker wrote:

> The following compiles, runs, and shows the triangle. It's the 
> code you posted above with the corrected call to glBufferData 
> along with more D style (as I would write it anyway) and less C.

One thing I overlooked. In lines where a variable is both 
declared and initialized, like this one:
GLFWwindow* window = glfwCreateWindow(...);

I normally let the compiler use type inference as I did in the 
manifest constant declarations:
auto window = glfwCreateWindow(...);

IMO, when you're dealing with long or ugly type names, it makes 
the code look cleaner.



More information about the Digitalmars-d-learn mailing list