#2847 closed defect (fixed)
[PATCH] SDL2: Atlas fails to start on Linux
Reported by: | historic_bruno | Owned by: | ben |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 18 |
Component: | Atlas editor | Keywords: | patch |
Cc: | yashi, againsttcpa84@… | Patch: |
Description
This is an OpenGL context initialization problem, yashi has been debugging it and made a patch on #2041.
#7 0x0000000000a7ddc7 in ogl_Init () at ../../../source/lib/ogl.cpp:479 #8 0x00000000009b3e31 in AtlasMessage::fInitGraphics (msg=0x168ade0) at ../../../source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp:84 #9 0x00000000009b3de7 in AtlasMessage::fInitGraphics_wrapper (msg=0x168ade0) at ../../../source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp:64 #10 0x0000000000979714 in RunEngine (data=0x7fffffffe100) at ../../../source/tools/atlas/GameInterface/GameLoop.cpp:174 #11 0x00007ffff3c7f0a4 in start_thread (arg=0x7fffe077f700) at pthread_create.c:309 #12 0x00007ffff39b4c2d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111 (gdb) f 7 #7 0x0000000000a7ddc7 in ogl_Init () at ../../../source/lib/ogl.cpp:479 479 ENSURE(exts); // else: called before OpenGL is ready for use (gdb) p exts $1 = 0x0 (gdb)
Attachments (2)
Change History (15)
comment:1 by , 10 years ago
Priority: | Should Have → Must Have |
---|
comment:2 by , 9 years ago
Cc: | added |
---|
comment:4 by , 9 years ago
Keywords: | patch review added |
---|---|
Milestone: | Backlog → Alpha 18 |
Summary: | SDL2: Atlas fails to start on Linux → [PATCH] SDL2: Atlas fails to start on Linux |
I haven't tested that the patch works, it should definitely be a Linux-only patch as it breaks on Windows. But looking at the wxWidgets source code, it seems the hack that makes this possible requires wxWidgets 3.0.2? At least on my Ubuntu 14.04 VM, the latest I have is 3.0.0, so to test I need a custom wxWidgets build.
comment:5 by , 9 years ago
Keywords: | review removed |
---|
There was some discussion and testing in IRC on 2015-02-17.
I built wxWidgets 3.0.2 on my Ubuntu VM and tested the above patch, unfortunately the error still occurred.
OpenGL vendor string: VMware, Inc. OpenGL renderer string: Gallium 0.4 on SVGA3D; build: RELEASE; OpenGL version string: 2.1 Mesa 10.1.3 OpenGL shading language version string: 1.20
by , 9 years ago
Attachment: | fix-atlas-sdl2.diff added |
---|
cleaned up version of yashi's patch from #2041
follow-up: 8 comment:6 by , 9 years ago
Finally got around to testing yashi's patch from #2041 and it solves the main problem. I cleaned it up slightly and added a new InitSDL message. So the Atlas init order is now: 1) Init 2) InitSDL 3) SetCanvas 4) InitGraphics
So far I have tested it on Ubuntu 14.04 with both SDL 1.2.15 and SDL 2.0.2, as well as wxWidgets 2.8.12 and 3.0.2, and on Windows (SDL 2.0.3/wxWidgets 3.0.2). Please test on as many systems as possible to help get this into A18!
The OpenGL 3+ issue is not addressed by the patch, and I don't have a system that can reproduce that problem. I'm going to consider it a separate issue for now. If anyone has a Linux system w/ OpenGL 3+ and can test Atlas with wxWidgets 3.0.2, that would be great.
comment:7 by , 9 years ago
Keywords: | review added |
---|
comment:8 by , 9 years ago
Tested with Yosemite and everything looks ok from atlas
Replying to historic_bruno:
Finally got around to testing yashi's patch from #2041 and it solves the main problem. I cleaned it up slightly and added a new InitSDL message. So the Atlas init order is now: 1) Init 2) InitSDL 3) SetCanvas 4) InitGraphics
So far I have tested it on Ubuntu 14.04 with both SDL 1.2.15 and SDL 2.0.2, as well as wxWidgets 2.8.12 and 3.0.2, and on Windows (SDL 2.0.3/wxWidgets 3.0.2). Please test on as many systems as possible to help get this into A18!
The OpenGL 3+ GL_EXTENSIONS issue is not addressed by the patch, and I don't have a system that can reproduce that problem. I'm going to consider it a separate issue for now. If anyone has a Linux system w/ OpenGL 3+ and can test Atlas with wxWidgets 3.0.2, that would be great.
comment:9 by , 9 years ago
The patch (http://trac.wildfiregames.com/attachment/ticket/2847/fix-atlas-sdl2.diff) works on my system and Atlas doesn't crash & works as expected.
System Info: -Ubuntu 14.10 -OpenGL version string: 4.4.12968 Compatibility Profile Context 14.501.1003 -AMD Graphics card with fglrx driver from the repository -compiled 0ad against SDL2
comment:10 by , 9 years ago
It breaks the windows build though. VS reports an access violation and breaks line 495 in HWDETECT.cpp
System Info :
- Windows 8.1.1 64Bits
comment:11 by , 9 years ago
Works for me, with the first patch, the problem was the way I was building atlas.
comment:13 by , 8 years ago
Keywords: | review removed |
---|
Atlas use wxGLCanvas, it create opengl context, if you look in the code for linux https://github.com/wxWidgets/wxWidgets/blob/master/src/unix/glx11.cpp#L119
so by default use opengl version 3 if you already can use in linux. and glGetString(GL_EXTENSIONS) is obsolete as of OpenGL 3.0. most drivers seem to be tolerant of its continued use, but at least some cases on Linux are NOT, and this call returns NULL, thus causing an actual crash in the code.
One way to fix this is to set in atlas.