The set_pixel_format() ARB format selection seems broken. When I run your program the "Fallback: keep legacy" path gets used. However, when I pulled a modified version of that function into another project the "Reset to chosen ARB format" path is taken and it fails on the second call to SetPixelFormat(). According to the documentation:
An application can only set the pixel format of a window one time. Once a window's pixel format is set, it cannot be changed.
Therefore a temporary window and GL context must be created to do the format selection. There's a working example in my GLV project of how to fix it.
For some reason the second SetPixelFormat call on the fallback path doesn't fail, but it sounds like it should be avoided.
The set_pixel_format() ARB format selection seems broken. When I run your program the "Fallback: keep legacy" path gets used. However, when I pulled a modified version of that function into another project the "Reset to chosen ARB format" path is taken and it fails on the second call to SetPixelFormat(). According to the documentation:
Therefore a temporary window and GL context must be created to do the format selection. There's a working example in my GLV project of how to fix it.
For some reason the second SetPixelFormat call on the fallback path doesn't fail, but it sounds like it should be avoided.