Hi All,
I’m deep in the throes of working in Elixir with 3D in OpenGL via the Erlang wx bindings. .I’m happily rendering teapots but I’m struggling to get a depth buffer working properly on the canvas.
Depth buffers are configured when the canvas is set up. Currently I have (Elixir module attributes with int values for the GL constants):
attrib_list = [@wx_gl_rgba, @wx_gl_doublebuffer, @wx_gl_depth_size, 16, 0]
gl_canvas = :wxGLCanvas.new(frame, [{:attribList, attrib_list}])
wx is not very happy with the attributes and I can’t create the canvas.
When I refer to the wxCanvas Documentation [Erlang -- wxGLCanvas] it says:
To set up the attributes for the canvas (number of bits for the depth buffer, number of bits for the stencil buffer and so on) you pass them in the constructor using a wxGLAttributes (not implemented in wx) instance. You can still use the way before 3.1.0 (setting up the correct values of the attribList parameter) but it’s discouraged.
The docs repeat several times that this method of calling new
is deprecated and I should use the version that takes a wxGLAttributes
argument along with the “(not implemented in wx)” qualification. This documentation has been the same since OTP 24.
I thought this might mean it’s part of another Erlang library but I cannot find any documentation or examples of wxGLAttributes
in Erlang or its use in creating canvases. I’m not really sure what to do. It seems the only way to create a canvas is deprecated and it raises errors when I try to set attributes. Any pointers would be greatly appreciated :-).
Regards,
Robin