Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: SetPixelFormat() returning 0, but no GetLastError

  1. #1
    Intern Newbie
    Join Date
    May 2008
    Posts
    30

    SetPixelFormat() returning 0, but no GetLastError

    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)

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,124

    Re: SetPixelFormat() returning 0, but no GetLastError

    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?

  3. #3
    Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    268

    Re: SetPixelFormat() returning 0, but no GetLastError

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •