Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OpenGL and HW acceleration [modified]

OpenGL and HW acceleration [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicsgame-devhardware
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dave Calkins
    wrote on last edited by
    #1

    I'm using the below code to enumerate the available pixel formats. For each pixel format, I'm checking the flags to see if this format provides HW accelerated rendering. I'm getting "NONE" for half the formats and "GENERIC" for the other half. I don't get "ACCELERATED" for any of them. I've tried this on multiple machines which have hardware that I would expect to provide HW accelerated OpenGL rendering.

    PIXELFORMATDESCRIPTOR pfd;

    int maxpf = DescribePixelFormat(hDC,0,0,NULL);
    for (int i = 1; i <= maxpf; i++)
    {
    if (DescribePixelFormat(hDC,i,sizeof(PIXELFORMATDESCRIPTOR),&pfd) == 0)
    continue;
    if ((pfd.dwFlags & PFD_SUPPORT_OPENGL) == 0)
    continue;

    if ((pfd.dwFlags & PFD_GENERIC_ACCELERATED) != 0)
    {
    TRACE1("%d: ACCELERATED\n", i);
    }
    else if ((pfd.dwFlags & PFD_GENERIC_FORMAT) != 0)
    {
    TRACE1("%d: GENERIC\n", i);
    }
    else
    {
    TRACE1("%d: NONE\n", i);
    }
    }

    So my question is what is the correct way to determine which pixel formats support HW accelerated rendering? Are the flags in the pixel format even the right place to look? One site I found which discusses this is below: here Seems pretty vague though unfortunately.

    modified on Wednesday, August 6, 2008 9:53 AM

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups