Getting GtkD working with OpenGL

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 6 06:35:01 PDT 2016


On Thursday, 6 October 2016 at 10:49:40 UTC, Chalix wrote:

> 	glMatrixMode(GL_MODELVIEW); /*Here the program crashes with

There are two things wrong with your use of Derelict.

First, though you are correctly importing derelict.opengl3.gl to 
get the deprecated functions (which the gl3 module does not 
expose), you are calling DerelictGL3.load and not 
DerelictGL.load. The former loads only the core 1.1 functions. To 
load the deprecated 1.1 functions, you need the latter instead.

Second, once the context is created and activated, you need to 
call DerelictGL3.reload to load all of the functions available in 
the context for OpenGL 1.2 and higher as well all available 
extensions supported by Derelict.

So, change DerelictGL3.load to DerelictGL.load, then add a call 
to DerelictGL.reload after creating and activating the context.


More information about the Digitalmars-d-learn mailing list