PDA

View Full Version : SetPixelFormat() returning 0, but no GetLastError



Rhawk187
04-10-2012, 11:24 AM
I'm running a VB6 app in WINE and the OpenGL portion of the program doesn't work. It is using PFD_DRAW_TO_BITMAP. PFD_DRAW_TO_WINDOW formats seem to work.

I've enumerated all the pixel formats (there are around 256) and a few of them match what I request. ChoosePixelFormat seems to return a correct format (in this case pixelFormat 6), but when I pass this value into SetPixelFormat it returns 0. I looked at the documentation and it says to check GetLastError() for more information, but when I call that, it returns 0 which formats to a blank error message.

Does anyone know anyway to figure out why SetPixelFormat would fail? I've done some reading and it sounds like DRAW_TO_BITMAP has been implemented since like May 2009.

I know DRAW_TO_BITMAP is not hardware accelerated. That is perfectly acceptable. This app works fine in Windows, -- I just need to figure out why a supported pixel format doesn't seem to get recognized.

I'm running Ubuntu, most recent version of WINE in their package manager, -- on a Quadro if that matters (not sure if Wine attempts to use the underlying graphics card or if it virtualizes all the pixel formats for software rendering)

Dark Photon
04-11-2012, 05:17 AM
You might need to resort to the Windows forum for this one. I personally don't have any experience doing Windows GL dev in Wine. Anyone else?

kyle_
04-18-2012, 07:31 AM
Only minor. There are peculiarities in Wine, like SwapBuffers & wglSwapBuffers calling each other differently then in Windows, but not much more.

The best bet would probably to drop drawing to bitmap if you control the sources. I doubt Wine guys implement software renderer just for the heck of it so if you cant draw to pixmap with HW then you are probably out of luck. Does glxinfo show visuals/configs that can be used to draw to pixmaps?