DGL
https://delphigl.com/forum/

CreateRenderingContext failing on Windows 8 with Open GL 4.0
https://delphigl.com/forum/viewtopic.php?f=19&t=10870
Seite 1 von 1

Autor:  Sentient [ Do Mai 30, 2013 21:13 ]
Betreff des Beitrags:  CreateRenderingContext failing on Windows 8 with Open GL 4.0

Hello,

I have a Delphi application that uses OpenGL for several graphics. We've haven't had a problem with the dglOpenGL file for years but now we have a client who is getting an exception. He is using a Windows 8 computer. We asked him to use a utility (http://www.realtech-vr.com/glview/download.php) to find his OpenGL version and he replied that he was using version 4.0. I updated our application to use the latest version of dglOpenGL.pas but he still gets the same problem.

I haven't found that the exception happens when CreateRenderingContext is called, I can't tell where in the function because I haven't been able to reproduce this on my own computer.

Does any one have any ideas for how to fix this problem? Let me know if there's any details I could provide to help.

Autor:  Lord Horazont [ Fr Mai 31, 2013 12:12 ]
Betreff des Beitrags:  Re: CreateRenderingContext failing on Windows 8 with Open GL

Can you somehow run the Application in a Debugger on Windows 8 so that you can get more details? Without any further details (at least the function call which fails, or the type of exception, would be quite helpful), I'm afraid, it will be hard to track down.

Maybe you can add debug output which gives you a hint on which function is about to be called before the exception happens.

regards,
Horazont

Autor:  Sascha Willems [ Fr Mai 31, 2013 17:25 ]
Betreff des Beitrags:  Re: CreateRenderingContext failing on Windows 8 with Open GL

As Lord Horazont says, try to use some error tracking tool (like EurekaLog or MadShi) that gives you a call stack with the exact position of the exception.

My applications (using our header) so far work fine on Windows 8. None of my users has had any problems and I've tested my current project on different Ultrabooks and Tablets all sporting Windows 8 without any problems.

Autor:  end [ Sa Jun 01, 2013 07:51 ]
Betreff des Beitrags:  Re: CreateRenderingContext failing on Windows 8 with Open GL

Maybe it's not Windows 8, but a incompatibility with the graphic driver. There are also maaaaany incompatibilities between NVIDIA, ATI and the other vendors.

In my experience an OpenGL Application works with the same components on Windows 8, if it works on Windows 7.

EDIT:

gDEBugger is an good tracking tool, too!

Autor:  Sentient [ Di Jun 04, 2013 16:37 ]
Betreff des Beitrags:  Re: CreateRenderingContext failing on Windows 8 with Open GL

Thanks for all the suggestions. I added some better debugging code to our code and changed the way the exception was handled. It took a while to get a result because I had to wait for the client to test it on his machine.

Here's the exception details:
Code:
  1. exception class   : EAccessViolation
  2. exception message : Access violation at address 663CB60E in module 'ig7icd32.dll'. Read of address 0000002C.


Here's the callstack right before the exception:
Code:
  1. main thread ($be8):
  2. 663cb60e +06e ig7icd32.dll
  3. 6661103b +0fb ig7icd32.dll                        DrvCreateLayerContext
  4. 66f4c17a +10e OpenGL32.dll                        wglCreateLayerContext
  5. 66f4c1cb +00a OpenGL32.dll                        wglCreateContext
  6. 01d359d0 +198 TRAK.EXE     dglOpenGL              CreateRenderingContext


I'm not quite sure what the ig7icd32.dll is. My guess it's some sort of helper of the OpenGL32.dll. One other thing, this person is using a 64bit operating system, I don't know if that matters at all.

Autor:  Sascha Willems [ Di Jun 04, 2013 18:30 ]
Betreff des Beitrags:  Re: CreateRenderingContext failing on Windows 8 with Open GL

ig7icd32.dll is from Intel's OpenGL implementation. Are the drivers up-to-date? I've tested my current game with our current headers on several Ultrabooks with integrated Intel gfx-chipsets and had no problems.

From the callstack it crashes while trying to create the render context via wglCreateContext, which is something that shouldn't happen. If the driver can't create a context, such functions should just return error codes.

So two advices : Try to install current graphics drivers and see if it changes anything, and if not try to create a render context yourself. Copy the code from the CreateRenderContext function of our header and try to create a bare minimum render context with no alpha, no layers, no stencil, etc. and see if it works.

Autor:  Sentient [ Mi Jun 05, 2013 21:38 ]
Betreff des Beitrags:  Re: CreateRenderingContext failing on Windows 8 with Open GL

Sascha Willems hat geschrieben:
ig7icd32.dll is from Intel's OpenGL implementation. Are the drivers up-to-date? I've tested my current game with our current headers on several Ultrabooks with integrated Intel gfx-chipsets and had no problems.

From the callstack it crashes while trying to create the render context via wglCreateContext, which is something that shouldn't happen. If the driver can't create a context, such functions should just return error codes.

So two advices : Try to install current graphics drivers and see if it changes anything, and if not try to create a render context yourself. Copy the code from the CreateRenderContext function of our header and try to create a bare minimum render context with no alpha, no layers, no stencil, etc. and see if it works.


I just got a chance to spend a little time on the person's computer. Using the OpenGL Extensions Viewer I ran some rendering tests and it looks like OpenGL is working fine. I saw that he had Intel HD Graphics 4000, version 9.17.10.3062. I checked Intel's site and it looks like there is a version slightly newer 9.17.10.3071, so I've sent him a link to update and we'll see if that fixes it.

Thanks for the advice!

Autor:  Sentient [ Mi Okt 16, 2013 17:44 ]
Betreff des Beitrags:  Re: CreateRenderingContext failing on Windows 8 with Open GL

Sascha Willems hat geschrieben:
So two advices : Try to install current graphics drivers and see if it changes anything, and if not try to create a render context yourself. Copy the code from the CreateRenderContext function of our header and try to create a bare minimum render context with no alpha, no layers, no stencil, etc. and see if it works.

I tried updating the drivers but that didn't change the error at all.

Edit: Turns out the update didn't actually happen. Also, I found out that the client was using a Surface Pro, and more googling lead to other people having problems with OpenGL on their Surface Pros. So I guess this is solved. Thanks again for the help!

I also tried sending the user having the problem a very simple application that only creates a simple context. The error is still happening right when wglCreateContext is called. Here is the code I am using:
Code:
  1.   DC := GetDC(Handle);
  2.   if not InitOpenGL then Application.Terminate;
  3.  
  4.   FillChar(PFDescriptor, SizeOf(PFDescriptor), 0);
  5.  
  6.   with PFDescriptor do
  7.   begin
  8.     nSize := SizeOf(PFDescriptor);
  9.     nVersion := 1;
  10.     dwFlags := PFD_SUPPORT_OPENGL or PFD_DRAW_TO_WINDOW or PFD_DOUBLEBUFFER;
  11.  
  12.     AType := GetObjectType(DC);
  13.     if AType = 0 then
  14.       RaiseLastOSError;
  15.  
  16.     iPixelType := PFD_TYPE_RGBA;
  17.     cColorBits := 32;
  18.     cDepthBits := 24;
  19.     cStencilBits := 0;
  20.     cAccumBits := 0;
  21.     cAuxBuffers := 0;
  22.  
  23.     iLayerType := PFD_MAIN_PLANE
  24.   end;
  25.  
  26.   PixelFormat := ChoosePixelFormat(DC, @PFDescriptor);
  27.   if PixelFormat = 0 then
  28.     RaiseLastOSError;
  29.  
  30.   if GetPixelFormat(DC) <> PixelFormat then
  31.     if not SetPixelFormat(DC, PixelFormat, @PFDescriptor) then
  32.       RaiseLastOSError;
  33.  
  34.   DescribePixelFormat(DC, PixelFormat, SizeOf(PFDescriptor), PFDescriptor);
  35.  
  36.   RC := wglCreateContext(DC); // user gets exception here

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/