Okay... this is your example with modifications based partly on the maxgui example :
If you want the 3d canvas to scale with the window you'll probably need to connect the size event and set TGlobal's width and height to match the new values.
Note that there are currently issues using a fullscreen-mode canvas with wxMax, in that input events seem to get lost somewhere. If you are only using it in a Window, it works fine.
SuperStrict Framework wx.wxApp Import wx.wxFrame Import wx.wxTimer Import wx.wxPanel Import wx.wxglmax2D 'Import "MiniB3D.bmx" Import sidesign.minib3d Const Menu_Exit:Int = 100 SetGraphicsDriver wxGLGraphicsDriver(),GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER New Window.run() Type Window Extends wxApp Field Frame:WinFrame Method OnInit:Int() Frame = WinFrame(New WinFrame.Create(Null, -1, "Terrain Editor", , , 800, 600)) Frame.show(True) SetTopWindow(Frame) Return True End Method End Type Type WinFrame Extends wxFrame Field Canvas:WinCanvas Method OnInit() Local FileMenu:wxMenu = wxMenu.CreateMenu() Local MenuBar:wxMenuBar = wxMenuBar.CreateMenuBar() Local Panel:wxPanel = New wxPanel.Create( Self ) Canvas = WinCanvas(New WinCanvas.Create(Panel, -1, GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER,0,0,800,600)) ConnectAny(wxEVT_CLOSE, OnClose) FileMenu.Append(Menu_Exit, "Exit~tAlt-X", "Quit this program") MenuBar.Append(FileMenu, "&File") SetMenuBar(MenuBar) CreateStatusBar(1) SetStatusText("Terrain Editor") End Method Function OnClose(event:wxEvent) WinFrame(event.parent).Canvas.timer.Stop() event.Skip() End Function End Type Type WinCanvas Extends wxGLCanvas Field Timer:wxTimer Field cam:TCamera Field light:TLight Field cube:TMesh Field sphere:TMesh Field cylinder:TMesh Field cone:TMesh Method OnInit() SetBackgroundStyle(wxBG_STYLE_CUSTOM) Timer = New wxTimer.Create(Self) ConnectAny(wxEVT_TIMER, OnTick) Timer.Start(17) ' ********** Local width:Int, height:Int GetSize(width, height) SetGraphics CanvasGraphics2D( Self ) TGlobal.width = width TGlobal.height = height TGlobal.depth=16 TGlobal.mode=0 TGlobal.rate=60 TGlobal.GraphicsInit() ' ************ cam=CreateCamera() light=CreateLight(1) cube=CreateCube() sphere=CreateSphere() cylinder=CreateCylinder() cone=CreateCone() End Method Method OnPaint(event:wxPaintEvent) Render() End Method Method Render() SetGraphics CanvasGraphics2D( Self ) Draw() Flip End Method Function OnTick(event:wxEvent) wxWindow(event.parent).Refresh() End Function Method Draw() PositionEntity cam,0,0,-10 PositionEntity cube,-6,0,0 PositionEntity sphere,-2,0,0 PositionEntity cylinder,2,0,0 PositionEntity cone,6,0,0 TurnEntity cube,0,1,0 RenderWorld End Method End Type
If you want the 3d canvas to scale with the window you'll probably need to connect the size event and set TGlobal's width and height to match the new values.
Note that there are currently issues using a fullscreen-mode canvas with wxMax, in that input events seem to get lost somewhere. If you are only using it in a Window, it works fine.