The windows command SetPixelFormat() fails when used on a Canvas gadget. It works correctly on a panel gadget. Why is this significant?
-Canvas gadgets generate GADGET_PAINT events. Panels no not. Therefore, only a canvas can tell you if another window has been dragged over the viewport (and that the viewport needs to be redrawn).
-SetPixelFormat() is necessary to change color depth, antialias mode, and stencil settings. You can't just rely on a pixel format chosen internally by Blitz.
SetPixelFormat can only be used once on any hdc. After that, the gadget/control must be recreated for a new SetPixelFormat to be called. Presumably, Blitz sets the pixel format internally when a canvas is created. Subsequent calls to set the pixel format of the canvas' hDC will therefore fail. The solution would be to add an optional flag to the CreateCanvas() function, which skips setting the pixel format, allowing the user to set their own.
-Canvas gadgets generate GADGET_PAINT events. Panels no not. Therefore, only a canvas can tell you if another window has been dragged over the viewport (and that the viewport needs to be redrawn).
-SetPixelFormat() is necessary to change color depth, antialias mode, and stencil settings. You can't just rely on a pixel format chosen internally by Blitz.
SetPixelFormat can only be used once on any hdc. After that, the gadget/control must be recreated for a new SetPixelFormat to be called. Presumably, Blitz sets the pixel format internally when a canvas is created. Subsequent calls to set the pixel format of the canvas' hDC will therefore fail. The solution would be to add an optional flag to the CreateCanvas() function, which skips setting the pixel format, allowing the user to set their own.