pkulchenko / wxlua

wxlua: Lua bindings for wxWidgets cross-platform GUI toolkit; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and wxWidgets 3.x
306 stars 59 forks source link

OpenGL core profile need two more class #11

Closed wtjcn closed 5 years ago

wtjcn commented 6 years ago

to use OpenGL core profile, two more class are needed, wxGLAttributes and wxGLContextAttrs, as usded in wxWidgets samples opengl/pyramid

pkulchenko commented 5 years ago

@wtjcn, I've added these two classes and also added some of the new methods to wxGLContext; all the changes have been pushed to https://github.com/pkulchenko/wxlua/tree/wxwidgets312.

Here is the sample code that works for me:

canvas = wx.wxGLCanvas(frame, wx.wxID_ANY, {}, wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxEXPAND)

local attrs = wx.wxGLAttributes()
attrs:PlatformDefaults():Defaults():EndList()
print(canvas.IsDisplaySupported(attrs))