HalfLifeAssetManager icon indicating copy to clipboard operation
HalfLifeAssetManager copied to clipboard

Error Coudn't create OpenGL context

Open davbrasan opened this issue 3 years ago • 15 comments

I do not have a video card, has how to use directX?

davbrasan avatar Apr 05 '21 15:04 davbrasan

This tool only supports OpenGL.

SamVanheer avatar Apr 05 '21 15:04 SamVanheer

OK. thanks for answering

davbrasan avatar Apr 05 '21 16:04 davbrasan

Note: this error was caused by Qt trying to use a different OpenGL implementation that does not support the version of OpenGL used by this program. The latest beta fixes this bug. You can try it or wait for V1.3.0 (should be this weekend) to be released to see if it works on your system.

SamVanheer avatar Aug 13 '21 19:08 SamVanheer

The application runs, it's an error because my OpenGL is 1.1, but when I try to load a file, it doesn't load.

davbrasan avatar Aug 13 '21 21:08 davbrasan

Are you opening a Half-Life 1 model file? Are there any errors?

SamVanheer avatar Aug 13 '21 21:08 SamVanheer

Not. My OpenGl is 1.1. When starting the app it warns that my OpenGl is old, I press OK and it opens the interface but when I try to load a v_usp.mdl file the app freezes and closes.

davbrasan avatar Aug 13 '21 22:08 davbrasan

What are your system specifications? What version of Windows do you have, which graphics card do you have? Do you have multiple graphics cards (e.g. integrated and dedicated card)? Are your drivers up to date?

SamVanheer avatar Aug 14 '21 07:08 SamVanheer

Chipset Intel® G41 Express

davbrasan avatar Aug 14 '21 13:08 davbrasan

According to Intel's documentation your card supports OpenGL 2.0, so this should be working. I'll take a look around, see if maybe i'm accidentally using something newer without checking if it's available, otherwise i'll see if i can get you to provide a more detailed crash report somehow.

The documentation does say that only Windows XP is supported, though i'm finding posts from users that have Windows 8.1. What operating system are you on?

Can you also turn on log output and show what the program writes to it? This page explains how to do that: https://github.com/Solokiller/HL_Tools/wiki/Half-Life-Asset-Manager-Configuring-Log-File-Output

SamVanheer avatar Aug 14 '21 13:08 SamVanheer

Windows 10

davbrasan avatar Aug 14 '21 14:08 davbrasan

I found only one API call that could cause crashes, it'll be replaced in HLAM 2.0. I don't think it's being called though.

Can you try a couple different models to see if it always crashes or only with specific models? If it's a custom model, can you also provide a download link?

Can you also provide the log output so i can see if there's anything problematic being logged?

SamVanheer avatar Aug 16 '21 10:08 SamVanheer

Log:

Debug: QWindowsIntegration::createPlatformOpenGLContext QSurfaceFormat(version 1.0, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 24, redBufferSize 4, greenBufferSize 4, blueBufferSize 4, alphaBufferSize 0, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CompatibilityProfile) (:0, ) Debug: QWindowsGLContext::QWindowsGLContext 0x150adb8 GDI requested: QSurfaceFormat(version 1.0, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 24, redBufferSize 4, greenBufferSize 4, blueBufferSize 4, alphaBufferSize 0, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CompatibilityProfile) obtained # 7 GDI QSurfaceFormat(version 1.1, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 32, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile) PIXELFORMATDESCRIPTOR dwFlags=0x8465 PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_SUPPORT_COMPOSITION PFD_GENERIC_FORMAT PFD_DOUBLEBUFFER iPixelType=0 cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8 cBlueBits=8 cBlueShift=0 cDepthBits=32 cStencilBits=8 iLayerType=0 cAlphaBits=8 cAlphaShift=0 cAccumBits=64 cAccumRedBits=16 cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16 swap interval: -1 default: ContextFormat: v1.1 profile: QSurfaceFormat::NoProfile options: QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions) HGLRC= 0x10001 (:0, )

Screenshot: bandicam 2021-08-16 11-22-02-643 bandicam 2021-08-16 11-23-13-298

davbrasan avatar Aug 16 '21 14:08 davbrasan

I've made a new beta with more log output: https://github.com/Solokiller/HL_Tools/releases/tag/HLAM-V1.3.0-beta008

I don't think i can fix this problem right now. Your driver doesn't support OpenGL well enough, so what i'm going to do is implement shaders with HLAM 2.0.0 and then try get to ANGLE working so you can use that instead. ANGLE implements part of the OpenGL API by using DirectX under the hood which your GPU does support well enough. Hopefully everything will work properly then.

It'll be a few weeks at minimum before i can produce a test build so i'll let you know when it's ready.

SamVanheer avatar Aug 18 '21 10:08 SamVanheer

when I try to load the app closes

log:

Debug: QWindowsIntegration::createPlatformOpenGLContext QSurfaceFormat(version 1.0, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 24, redBufferSize 4, greenBufferSize 4, blueBufferSize 4, alphaBufferSize 0, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CompatibilityProfile) (:0, ) Debug: QWindowsGLContext::QWindowsGLContext 0x666270 GDI requested: QSurfaceFormat(version 1.0, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 24, redBufferSize 4, greenBufferSize 4, blueBufferSize 4, alphaBufferSize 0, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CompatibilityProfile) obtained # 7 GDI QSurfaceFormat(version 1.1, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 32, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile) PIXELFORMATDESCRIPTOR dwFlags=0x8465 PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_SUPPORT_COMPOSITION PFD_GENERIC_FORMAT PFD_DOUBLEBUFFER iPixelType=0 cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8 cBlueBits=8 cBlueShift=0 cDepthBits=32 cStencilBits=8 iLayerType=0 cAlphaBits=8 cAlphaShift=0 cAccumBits=64 cAccumRedBits=16 cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16 swap interval: -1 default: ContextFormat: v1.1 profile: QSurfaceFormat::NoProfile options: QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions) HGLRC= 0x10001 (:0, ) Debug: Trying to load asset "C:/Downloads/Ferramentas/p_ak47.mdl" (C:\Users\Sam\Documents\Programs\C++_Programs\HL_Tools_dev\HL_Tools\src\tools\hlam\ui\MainWindow.cpp:378, bool __thiscall ui::MainWindow::TryLoadAsset(class QString)) Debug: Trying to load model "C:/Downloads/Ferramentas/p_ak47.mdl" (C:\Users\Sam\Documents\Programs\C++_Programs\HL_Tools_dev\HL_Tools\src\tools\hlam\ui\assets\studiomodel\StudioModelAsset.cpp:587, class std::unique_ptr<class ui::assets::Asset,struct std::default_delete<class ui::assets::Asset> > __thiscall ui::assets::studiomodel::StudioModelAssetProvider::Load(class ui::EditorContext *,const class QString &,struct _iobuf *) const) Debug: Loaded model "C:/Downloads/Ferramentas/p_ak47.mdl" as "C:/Downloads/Ferramentas/p_ak47.mdl" (C:\Users\Sam\Documents\Programs\C++_Programs\HL_Tools_dev\HL_Tools\src\tools\hlam\ui\assets\studiomodel\StudioModelAsset.cpp:604, class std::unique_ptr<class ui::assets::Asset,struct std::default_delete<class ui::assets::Asset> > __thiscall ui::assets::studiomodel::StudioModelAssetProvider::Load(class ui::EditorContext *,const class QString &,struct _iobuf *) const) Debug: Asset "C:/Downloads/Ferramentas/p_ak47.mdl" loaded as "C:/Downloads/Ferramentas/p_ak47.mdl" (C:\Users\Sam\Documents\Programs\C++_Programs\HL_Tools_dev\HL_Tools\src\tools\hlam\ui\MainWindow.cpp:395, bool __thiscall ui::MainWindow::TryLoadAsset(class QString)) Debug: QWindowsIntegration::createPlatformOpenGLContext QSurfaceFormat(version 1.0, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 24, redBufferSize 4, greenBufferSize 4, blueBufferSize 4, alphaBufferSize 0, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CompatibilityProfile) (:0, ) Debug: QWindowsGLContext::QWindowsGLContext 0x97424d0 GDI requested: QSurfaceFormat(version 1.0, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 24, redBufferSize 4, greenBufferSize 4, blueBufferSize 4, alphaBufferSize 0, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::CompatibilityProfile) obtained # 7 GDI QSurfaceFormat(version 1.1, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 32, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile) PIXELFORMATDESCRIPTOR dwFlags=0x8465 PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_SUPPORT_COMPOSITION PFD_GENERIC_FORMAT PFD_DOUBLEBUFFER iPixelType=0 cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8 cBlueBits=8 cBlueShift=0 cDepthBits=32 cStencilBits=8 iLayerType=0 cAlphaBits=8 cAlphaShift=0 cAccumBits=64 cAccumRedBits=16 cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16 swap interval: -1 default: ContextFormat: v1.1 profile: QSurfaceFormat::NoProfile options: QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions) HGLRC= 0x10002 (:0, ) Debug: Initializing OpenGL (C:\Users\Sam\Documents\Programs\C++_Programs\HL_Tools_dev\HL_Tools\src\tools\hlam\ui\SceneWidget.cpp:59, void __thiscall ui::SceneWidget::initializeGL(void)) Debug: Initialized OpenGL (C:\Users\Sam\Documents\Programs\C++_Programs\HL_Tools_dev\HL_Tools\src\tools\hlam\ui\SceneWidget.cpp:66, void __thiscall ui::SceneWidget::initializeGL(void)) Debug: Loaded asset "C:/Downloads/Ferramentas/p_ak47.mdl" (C:\Users\Sam\Documents\Programs\C++_Programs\HL_Tools_dev\HL_Tools\src\tools\hlam\ui\MainWindow.cpp:421, bool __thiscall ui::MainWindow::TryLoadAsset(class QString))

davbrasan avatar Aug 18 '21 11:08 davbrasan

Is there anything in the log file?

Ok so it's probably some OpenGL feature that your driver doesn't support. Once HLAM 2.0.0 is ready for testing we can take another look at this to see if there's anything else going wrong.

SamVanheer avatar Aug 18 '21 11:08 SamVanheer

I've investigated this further: ANGLE doesn't support the use of deprecated OpenGL functions so it won't be possible to rely on the ANGLE renderer to solve this problem right now.

HLAM 2.0.0 won't upgrade the graphics code to use shaders so it probably won't work for you. I'm planning to do that upgrade in 3.0.0 but i don't know if it'll work any better.

Your graphics card only supports DirectX 10 whereas the shader upgrade will be using the equivalent of DirectX 11 so i doubt this'll work for you.

Since this is an integrated card it may be better to get a dedicated GPU. Even a cheap one should support OpenGL 3.3+ and DirectX 11+. Even if it doesn't support those it should have full support for deprecated desktop OpenGL functions. The lack of support from the integrated card is why the current version fails to work so any dedicated GPU you can get should allow you to run the current version.

SamVanheer avatar Dec 21 '22 11:12 SamVanheer

HLAM won't work at all once it's been upgraded to use newer OpenGL functionality, so it will not be possible to make it work with your integrated graphics card. I'd recommend acquiring a dedicated graphics card that supports OpenGL 3.3 or newer.

SamVanheer avatar Mar 03 '24 22:03 SamVanheer