Board index » delphi » OpenGL Software Rendering

OpenGL Software Rendering

Hi there

Is there a way to turn Software Rendering on/off when using OpenGL and
Delphi 5?  One of my programs does not work on certain ATI cards and I
am wondering if this can fix the problem.

Thanks

Barry Swart

 

Re:OpenGL Software Rendering


You need to step through the formats and check the capabilities before
selecting a format.

function ChoosePixelFormatGeneric : integer ;
var
  i   : Integer ;
  pfd : TPixelFormatDescriptor ;
  num : Integer ;
begin
  Result := 0 ;
  //get number of formats
  FillChar ( pfd , SizeOf(pfd) , 0 ) ;
  pfd.nSize := SizeOf(pfd) ;
  pfd.nVersion := 1 ;
  num := Integer ( DescribePixelFormat ( glDC , 1 , SizeOf(pfd) , pfd )
) ;
  //enumerate formats
  for i := 1 to num do begin
    FillChar ( pfd , SizeOf(pfd) , 0 ) ;
    DescribePixelFormat ( glDC , i , SizeOf(pfd) , pfd ) ;
    if Boolean ( pfd.dwFlags and PFD_DRAW_TO_WINDOW ) and
       Boolean ( pfd.dwFlags and PFD_SUPPORT_OPENGL ) and
       Boolean ( pfd.dwFlags and PFD_GENERIC_FORMAT ) and // <===here's
the one you want
       Boolean ( pfd.dwFlags and PFD_DOUBLEBUFFER   ) and
       not Boolean ( pfd.dwFlags and PFD_GENERIC_ACCELERATED )  then
begin
      Result := i ;
      Break ;
      end ;
    end ;
end ;

I haven't tested much with different cards so I'm curious what functions
fail on the ATI?

Mitch Wolberg,
RockWare, Inc.

Quote
Barry Swart wrote:

> Hi there

> Is there a way to turn Software Rendering on/off when using OpenGL and
> Delphi 5?  One of my programs does not work on certain ATI cards and I
> am wondering if this can fix the problem.

> Thanks

> Barry Swart

Other Threads