View Single Post
  #4  
Old May 23rd 21, 10:15 AM posted to alt.comp.periphs.videocards.nvidia
skybuck2000
external usenet poster
 
Posts: 61
Default OpenGL driver loading abnoxiously slow. (Toshiba laptop L670 2012/Intel/AMD/RadeON)

I found and consulted my older postings about this, fortunately those still on google newsgroups.

GetDC doesn't work well in design state it's value is always different between api calls and such.

So for now I have decided to implement it this way:

function TOpenGLControl.GetDeviceContext : HDC;
begin
if not (csDesigning in ComponentState) then
begin
result := GetDC(Handle);
end else
begin
result := Canvas.Handle;
end;
end;

And then in whatever code a device context is necessary it calls this function:

GetDeviceContext.

The only drawback so far is that it crashes the IDE when the topengl control is put on a form, why exactly I don't know but it might have something to do with the IDE not being able to find the source code or whatever.

I like adding those manually to projects. It could also be some new bug in the IDE, after the project is fixed by adding the graphics units and saved and re-opened all should work fine.

Now I go test it further by re-compilingg some of my applications and corona game to solve this weird slow startup hopefully once and for all because it's quite annoying.

It could also be that VCL has a bug which gets more severe as the CPU speed increases !

So Delphi creator be warned and debug your VCL better ! In some rare cases it can behave strangely, still haven't found the exact cause of it... so far so good though...

It may also have to do something with critical sections being locked and unlocked.

Or maybe it trips up the dbg spider...

I am still not 100% convinced this solves it once and for all but it does make the situation better.

It could also be a weird bug in windows 7 home edition or in AMD/ATI driver which is beta, but also the official driver also showed some behaviour.

And same behaviour also noticed on PC/nvidia... windows 7 ultimate edition...

So the mystery remains somewhat but is now less severe.

Bye for now,
Skybuck.