How to have panels with backgrounds and without

BlitzPlus Forums/BlitzPlus Programming/How to have panels with backgrounds and without

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

OpenGL rendering works a lot better on a panel set to have no background brush, using SetClassLong(hwnd,GCL_HBRBACKGROUND,0). However, this makes all your panels so that they don't get refreshed when another window is dragged over them.

The way around this is to set one panel with SetClassLong(hwnd,GCL_HBRBACKGROUND,0), which will remove the background for all panels. Then you use SetPanelColor() on all your non-rendering panels. You will also need to cover each window you create with a large panel:

window=CreateWindow("",0,0,400,300)
windowpanel=CreatePanel(0,0,ClientWidth(window),ClientHeight(window),window)
SetGadgetLayout windowpanel,1,1,1,1
SetPanelColor windowpanel,r,g,b

This will give you OpenGL viewports that don't get cleared, as well as regular solid application panels.