An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.

Related tags

Game sdl sdl2
Overview
                         Simple DirectMedia Layer

                                  (SDL)

                               sdl12-compat

---
https://www.libsdl.org/

This is the Simple DirectMedia Layer, a general API that provides low
level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
and 2D framebuffer across multiple platforms.

This code is a compatibility layer; it provides a binary-compatible API for
programs written against SDL 1.2, but it uses SDL 2.0 behind the scenes. If
you are writing new code, please target SDL 2.0 directly and do not use this
layer.

If you absolutely must have the real SDL 1.2 ("SDL 1.2 Classic"), please use
the source tree at https://github.com/libsdl-org/SDL-1.2, which occasionally
gets bug fixes but no formal release. But we strongly encourage you not to do
that.
Issues
  • Build all packages in Fedora with sdl12-compat instead of SDL 1.2...

    Build all packages in Fedora with sdl12-compat instead of SDL 1.2...

    Fedora project's proposal:

    https://fedoraproject.org/wiki/Changes/SDL12onSDL2

    Thread with discussion of package lists:

    https://twitter.com/icculus/status/1398319367222444034

    Some initial automation work:

    https://github.com/libsdl-org/sdl12-compat/issues/34#issuecomment-847326194

    opened by icculus 41
  • dosbox keyboard layout issues

    dosbox keyboard layout issues

    dosbox-0.74 on CentOS-6.10 / i686.

    With 'normal' SDL-1.2, dosbox doesn't respect my keyboard layout (which is Turkish-F) and behave as is I were using US layout.

    With sdl12-compat (latest git master) talking to SDL2-latest git master, it does use my keyboard layout but not fully correctly:

    • The key next to left-shift should report <, > or | (plain, with shift, with AltGr) but it prints \, | or none: all behaving like US-layout.

    • The key next to right shift should report , or ; (plain or shift), but it prints , (which is good) or < (bad: US-layout).

    • The key left to it should report . or :, but it prints . (good) or > (bad: US-layout).

    • Similar stuff with the keys on the numbers' row -- e.g. the key below Esc prints nothing, ...

    opened by sezero 36
  • cdrom code

    cdrom code

    We have stubs for cdrom code in sdl12-compat.

    Should we import the code from SDL-1.2? If we ever do that, would there be licence issues (can any of the authors still be reached, etc)?

    If we'll keep the stubs, close this.

    opened by sezero 31
  • Port to Windows

    Port to Windows

    This bug report was migrated from our old Bugzilla tracker.

    Reported in version: unspecified Reported for operating system, platform: Other, x86

    Comments on the original bug report:

    On 2019-03-13 19:45:13 +0000, Ryan C. Gordon wrote:

    Most of the sdl12-compat code will work out of the box on Windows, but I probably need to sort out the SDL_main politics.

    --ryan.

    On 2019-03-14 17:13:16 +0000, Rohit Nirmal wrote:

    A few notes:

    1. CloseSDL20Library() for _WINDOWS has an extra open bracket that causes compile errors.
    2. On MinGW, _WINDOWS is not defined, causing the #error to trigger.
    3. stdio.h needs to be #included for stderr.
    4. stdlib.h needs to be #included to avoid an implicit declaration warning for abort().
    5. On MinGW, SDL20_CreateMutex and SDL20_CreateSemaphore are undefined for some reason. As a quick fix, I changed them to SDL20_SYM from SDL20_SYM_PASSTHROUGH in SDL20_syms.h and created SDL_CreateMutex and SDL_CreateSemaphore functions in SDL12_compat.c to simply call them.
    opened by SDLBugzilla 24
  • GBM+GLES?

    GBM+GLES?

    Last I tested this on my Rockchip RK3328 using an application compiled for GBM and GLES2. I dropped this in place of the SDL1.2 library, the application crashed as it was initializing it's graphics stack. It was months ago so wanted to check if this was a known issue and has since been resolved or if I should plan to get logs for a future issue report. Thanks in advance!

    opened by mrfixit2001 20
  • Awesomenauts (Steam, free-to-play): black window, no titlebar or borders

    Awesomenauts (Steam, free-to-play): black window, no titlebar or borders

    • Debian 10 host system, AMD GPU, Mesa
    • run Steam with a modified Steam Runtime that contains sdl12-compat 1.2.52 instead of "real" SDL 1.2
    • launch https://store.steampowered.com/app/204300/Awesomenauts__the_2D_moba/

    Expected result: normal gameplay

    Actual result: a black window with no titlebar or borders (but the game is running and sounds still play)

    opened by smcv 18
  • SDL OpenGL header license is non-free (SGI Free B v1.1)

    SDL OpenGL header license is non-free (SGI Free B v1.1)

    During a review, it was discovered that there is some code that's listed under the terms of the SGI Free B v1.1 license:

    https://github.com/libsdl-org/sdl12-compat/blob/c0504eb42c7cabc23c6b4a16f5915ee49962ddff/include/SDL/SDL_opengl.h#L1-L30

    This license is non-free, but it's easy enough to fix as the license has a clause to allow upgrading to the SGI Free B v2.0 license (which is effectively MIT).

    Can the license terms be updated accordingly?

    opened by Conan-Kudo 18
  • Dynamite Jack hangs at the title screen

    Dynamite Jack hangs at the title screen

    Tried a few things to no avail. Original SDL1 works fine.

    Game::init ...
    SDL Runtime Version: 1.2.50
    SDL Compile Version: 1.2.14
    SDL_BYTEORDER == SDL_LIL_ENDIAN
    == joystick init.............
    irrKlang sound library version 1.4.0
    Loaded plugin: ikpMP3.so
    Loaded plugin: ikpFlac.so
    Using ALSA driver
    udid:1c1b0d9de366-1633903719, name:Anonymous, uid:a:1c1b0d9de366-1633903719 token:0cda58aa2be38f43503552146d446cec
    init_video: 1024 768 640 480 320 320 0
    _try_init_video(1024,768,0)
    VideoInfo->vfmt->BitsPerPixel:32
    res: 1
    GL_RED_SIZE:0
    GL_GREEN_SIZE:0
    GL_BLUE_SIZE:0
    GL_ALPHA_SIZE:0
    GL_DEPTH_SIZE:0
    GL_BUFFER_SIZE:0
    GL_DOUBLEBUFFER:0
    GL_STENCIL_SIZE:0
    res: 1024 x 768
    vinfo: 1920 x 1080
    trying load tex atlas2
    doing load tex atlas2 (1)
    driver_tex_load ../data/atlas2.png
    loaded ../data/atlas2.png as 1
    gfx_tex_load: 255 ms, total 255 ms
    create_fbo success
    create_fbo success
    create_fbo success
    unable to find img 
    trying load tex atlas1
    doing load tex atlas1 (2)
    driver_tex_load ../data/atlas1.png
    loaded ../data/atlas1.png as 5
    gfx_tex_load: 0 ms, total 255 ms
    trying load tex atlas3
    doing load tex atlas3 (3)
    driver_tex_load ../data/atlas3.png
    loaded ../data/atlas3.png as 6
    gfx_tex_load: 0 ms, total 255 ms
    trying load tex atlas4
    doing load tex atlas4 (4)
    driver_tex_load ../data/atlas4.png
    loaded ../data/atlas4.png as 7
    gfx_tex_load: 77 ms, total 332 ms
    trying load tex atlas5
    doing load tex atlas5 (5)
    driver_tex_load ../data/atlas5.png
    loaded ../data/atlas5.png as 8
    gfx_tex_load: 240 ms, total 572 ms
    trying load tex atlas6
    doing load tex atlas6 (6)
    driver_tex_load ../data/atlas6.png
    loaded ../data/atlas6.png as 9
    gfx_tex_load: 232 ms, total 804 ms
    trying load tex atlas7
    doing load tex atlas7 (7)
    driver_tex_load ../data/atlas7.png
    loaded ../data/atlas7.png as 10
    gfx_tex_load: 1 ms, total 805 ms
    trying load tex atlas8
    doing load tex atlas8 (8)
    driver_tex_load ../data/atlas8.png
    loaded ../data/atlas8.png as 11
    gfx_tex_load: 231 ms, total 1036 ms
    trying load tex atlas9
    doing load tex atlas9 (9)
    driver_tex_load ../data/atlas9.png
    loaded ../data/atlas9.png as 12
    gfx_tex_load: 0 ms, total 1036 ms
    trying load tex beam.png
    doing load tex beam.png (10)
    driver_tex_load ../data/beam.png
    loaded ../data/beam.png as 13
    gfx_tex_load: 0 ms, total 1036 ms
    trying load tex black.png
    doing load tex black.png (11)
    driver_tex_load ../data/black.png
    loaded ../data/black.png as 14
    gfx_tex_load: 2 ms, total 1038 ms
    trying load tex blank.png
    doing load tex blank.png (12)
    driver_tex_load ../data/blank.png
    loaded ../data/blank.png as 15
    gfx_tex_load: 0 ms, total 1038 ms
    trying load tex blast1.png
    doing load tex blast1.png (13)
    driver_tex_load ../data/blast1.png
    loaded ../data/blast1.png as 16
    gfx_tex_load: 1 ms, total 1039 ms
    trying load tex blast2.png
    doing load tex blast2.png (14)
    driver_tex_load ../data/blast2.png
    loaded ../data/blast2.png as 17
    gfx_tex_load: 0 ms, total 1039 ms
    trying load tex blast3.png
    doing load tex blast3.png (15)
    driver_tex_load ../data/blast3.png
    loaded ../data/blast3.png as 18
    gfx_tex_load: 1 ms, total 1040 ms
    trying load tex blast4.png
    doing load tex blast4.png (16)
    driver_tex_load ../data/blast4.png
    loaded ../data/blast4.png as 19
    gfx_tex_load: 1 ms, total 1041 ms
    trying load tex blast5.png
    doing load tex blast5.png (17)
    driver_tex_load ../data/blast5.png
    loaded ../data/blast5.png as 20
    gfx_tex_load: 1 ms, total 1042 ms
    trying load tex box1.png
    doing load tex box1.png (18)
    driver_tex_load ../data/box1.png
    loaded ../data/box1.png as 21
    gfx_tex_load: 0 ms, total 1042 ms
    trying load tex box2.png
    doing load tex box2.png (19)
    driver_tex_load ../data/box2.png
    loaded ../data/box2.png as 22
    gfx_tex_load: 1 ms, total 1043 ms
    trying load tex box3.png
    doing load tex box3.png (20)
    driver_tex_load ../data/box3.png
    loaded ../data/box3.png as 23
    gfx_tex_load: 1 ms, total 1044 ms
    trying load tex box4.png
    doing load tex box4.png (21)
    driver_tex_load ../data/box4.png
    loaded ../data/box4.png as 24
    gfx_tex_load: 0 ms, total 1044 ms
    trying load tex dot.png
    doing load tex dot.png (22)
    driver_tex_load ../data/dot.png
    loaded ../data/dot.png as 25
    gfx_tex_load: 1 ms, total 1045 ms
    trying load tex fan.png
    doing load tex fan.png (23)
    driver_tex_load ../data/fan.png
    loaded ../data/fan.png as 26
    gfx_tex_load: 6 ms, total 1051 ms
    trying load tex font1.png
    doing load tex font1.png (24)
    driver_tex_load ../data/font1.png
    loaded ../data/font1.png as 27
    gfx_tex_load: 16 ms, total 1067 ms
    trying load tex font15.png
    doing load tex font15.png (25)
    driver_tex_load ../data/font15.png
    loaded ../data/font15.png as 28
    gfx_tex_load: 10 ms, total 1077 ms
    trying load tex font1s.png
    doing load tex font1s.png (26)
    driver_tex_load ../data/font1s.png
    loaded ../data/font1s.png as 29
    gfx_tex_load: 16 ms, total 1093 ms
    trying load tex font2.png
    doing load tex font2.png (27)
    driver_tex_load ../data/font2.png
    loaded ../data/font2.png as 30
    gfx_tex_load: 5 ms, total 1098 ms
    trying load tex font2s.png
    doing load tex font2s.png (28)
    driver_tex_load ../data/font2s.png
    loaded ../data/font2s.png as 31
    gfx_tex_load: 5 ms, total 1103 ms
    trying load tex font3.png
    doing load tex font3.png (29)
    driver_tex_load ../data/font3.png
    loaded ../data/font3.png as 32
    gfx_tex_load: 2 ms, total 1105 ms
    trying load tex guard_atlas
    doing load tex guard_atlas (30)
    driver_tex_load ../data/guard.png
    loaded ../data/guard.png as 33
    gfx_tex_load: 117 ms, total 1222 ms
    trying load tex laser_atlas
    doing load tex laser_atlas (31)
    driver_tex_load ../data/laser.png
    loaded ../data/laser.png as 34
    gfx_tex_load: 0 ms, total 1222 ms
    trying load tex player_atlas
    doing load tex player_atlas (32)
    driver_tex_load ../data/player.png
    loaded ../data/player.png as 35
    gfx_tex_load: 0 ms, total 1222 ms
    trying load tex sniper_atlas
    doing load tex sniper_atlas (33)
    driver_tex_load ../data/sniper.png
    loaded ../data/sniper.png as 36
    gfx_tex_load: 0 ms, total 1222 ms
    trying load tex spider_atlas
    doing load tex spider_atlas (34)
    driver_tex_load ../data/spider.png
    loaded ../data/spider.png as 37
    gfx_tex_load: 1 ms, total 1223 ms
    trying load tex white.png
    doing load tex white.png (35)
    driver_tex_load ../data/white.png
    loaded ../data/white.png as 38
    gfx_tex_load: 1 ms, total 1224 ms
    trying load tex zombie_atlas
    doing load tex zombie_atlas (36)
    driver_tex_load ../data/zombie.png
    loaded ../data/zombie.png as 39
    gfx_tex_load: 0 ms, total 1224 ms
    opening ../data/gameinfo.db in READONLY mode
    :: trying load sample sfx-blast
    doing load sample sfx-blast
    loading: ../data/sfx-blast.wav as 1
    :: trying load sample sfx-bomb-drop
    doing load sample sfx-bomb-drop
    loading: ../data/sfx-bomb-drop.wav as 2
    :: trying load sample sfx-bomb-get
    doing load sample sfx-bomb-get
    loading: ../data/sfx-bomb-get.wav as 3
    :: trying load sample sfx-bomb-step
    doing load sample sfx-bomb-step
    loading: ../data/sfx-bomb-step.wav as 4
    :: trying load sample sfx-cartridge-get
    doing load sample sfx-cartridge-get
    loading: ../data/sfx-cartridge-get.wav as 5
    :: trying load sample sfx-detonator-get
    doing load sample sfx-detonator-get
    loading: ../data/sfx-detonator-get.wav as 6
    :: trying load sample sfx-detonator-missing
    doing load sample sfx-detonator-missing
    loading: ../data/sfx-detonator-missing.wav as 7
    :: trying load sample sfx-detonator-use
    doing load sample sfx-detonator-use
    loading: ../data/sfx-detonator-use.wav as 8
    :: trying load sample sfx-die-blast
    doing load sample sfx-die-blast
    loading: ../data/sfx-die-blast.wav as 9
    :: trying load sample sfx-die-guard
    doing load sample sfx-die-guard
    loading: ../data/sfx-die-guard.wav as 10
    :: trying load sample sfx-die-laser
    doing load sample sfx-die-laser
    loading: ../data/sfx-die-laser.wav as 11
    :: trying load sample sfx-die-pit
    doing load sample sfx-die-pit
    loading: ../data/sfx-die-pit.wav as 12
    :: trying load sample sfx-die-sniper
    doing load sample sfx-die-sniper
    loading: ../data/sfx-die-sniper.wav as 13
    :: trying load sample sfx-die-spider
    doing load sample sfx-die-spider
    loading: ../data/sfx-die-spider.wav as 14
    :: trying load sample sfx-die-zombie
    doing load sample sfx-die-zombie
    loading: ../data/sfx-die-zombie.wav as 15
    :: trying load sample sfx-exit
    doing load sample sfx-exit
    loading: ../data/sfx-exit.wav as 16
    :: trying load sample sfx-flashlight-get
    doing load sample sfx-flashlight-get
    loading: ../data/sfx-flashlight-get.wav as 17
    :: trying load sample sfx-flashlight-off
    doing load sample sfx-flashlight-off
    loading: ../data/sfx-flashlight-off.wav as 18
    :: trying load sample sfx-flashlight-on
    doing load sample sfx-flashlight-on
    loading: ../data/sfx-flashlight-on.wav as 19
    :: trying load sample sfx-blast-guard
    doing load sample sfx-blast-guard
    loading: ../data/sfx-blast-guard.wav as 20
    :: trying load sample sfx-blast-laser
    doing load sample sfx-blast-laser
    loading: ../data/sfx-blast-laser.wav as 21
    :: trying load sample sfx-blast-sniper
    doing load sample sfx-blast-sniper
    loading: ../data/sfx-blast-sniper.wav as 22
    :: trying load sample sfx-blast-zombie
    doing load sample sfx-blast-zombie
    loading: ../data/sfx-blast-zombie.wav as 23
    :: trying load sample sfx-guard-alert
    doing load sample sfx-guard-alert
    loading: ../data/sfx-guard-alert.wav as 24
    :: trying load sample sfx-jewel-get
    doing load sample sfx-jewel-get
    loading: ../data/sfx-jewel-get.wav as 25
    :: trying load sample sfx-keycard-get
    doing load sample sfx-keycard-get
    loading: ../data/sfx-keycard-get.wav as 26
    :: trying load sample sfx-lock-locked
    doing load sample sfx-lock-locked
    loading: ../data/sfx-lock-locked.wav as 27
    :: trying load sample sfx-lock-unlock
    doing load sample sfx-lock-unlock
    loading: ../data/sfx-lock-unlock.wav as 28
    :: trying load sample sfx-savept-restore
    doing load sample sfx-savept-restore
    loading: ../data/sfx-savept-restore.wav as 29
    :: trying load sample sfx-savept-save
    doing load sample sfx-savept-save
    loading: ../data/sfx-savept-save.wav as 30
    :: trying load sample sfx-sniper-alert
    doing load sample sfx-sniper-alert
    loading: ../data/sfx-sniper-alert.wav as 31
    :: trying load sample sfx-spider-alert
    doing load sample sfx-spider-alert
    loading: ../data/sfx-spider-alert.wav as 32
    :: trying load sample sfx-tech-blast
    doing load sample sfx-tech-blast
    loading: ../data/sfx-tech-blast.wav as 33
    :: trying load sample sfx-tech-locked
    doing load sample sfx-tech-locked
    loading: ../data/sfx-tech-locked.wav as 34
    :: trying load sample sfx-tech-unlock
    doing load sample sfx-tech-unlock
    loading: ../data/sfx-tech-unlock.wav as 35
    :: trying load sample sfx-trans-fade
    doing load sample sfx-trans-fade
    loading: ../data/sfx-trans-fade.wav as 36
    :: trying load sample sfx-zombie-growl
    doing load sample sfx-zombie-growl
    loading: ../data/sfx-zombie-growl.wav as 37
    :: trying load sample sfx-gui-change
    doing load sample sfx-gui-change
    loading: ../data/sfx-gui-change.wav as 38
    :: trying load sample sfx-gui-click
    doing load sample sfx-gui-click
    loading: ../data/sfx-gui-click.wav as 39
    :: trying load sample sfx-gui-down
    doing load sample sfx-gui-down
    loading: ../data/sfx-gui-down.wav as 40
    :: trying load sample sfx-gui-enter
    doing load sample sfx-gui-enter
    loading: ../data/sfx-gui-enter.wav as 41
    :: trying load sample sfx-map-scroll
    doing load sample sfx-map-scroll
    loading: ../data/sfx-map-scroll.wav as 42
    :: trying load sample sfx-die-scream1
    doing load sample sfx-die-scream1
    loading: ../data/sfx-die-scream1.wav as 43
    :: trying load sample sfx-die-scream2
    doing load sample sfx-die-scream2
    loading: ../data/sfx-die-scream2.wav as 44
    :: trying load sample sfx-die-scream3
    doing load sample sfx-die-scream3
    loading: ../data/sfx-die-scream3.wav as 45
    :: trying load sample sfx-die-scream4
    doing load sample sfx-die-scream4
    loading: ../data/sfx-die-scream4.wav as 46
    :: trying load sample sfx-die-scream5
    doing load sample sfx-die-scream5
    loading: ../data/sfx-die-scream5.wav as 47
    opening ../data/gameinfo.db in READONLY mode
    n:0,value:0
    init_tile: 0 none
    n:1,value:0
    init_tile: 1 floor1
    n:2,value:0
    init_tile: 2 wall1
    n:3,value:0
    init_tile: 3 pit
    n:4,value:257
    init_tile: 4 player
    n:5,value:258
    init_tile: 5 guard
    n:6,value:0
    init_tile: 6 flashlight
    n:7,value:261
    init_tile: 7 exit
    n:8,value:259
    init_tile: 8 arrow1
    n:9,value:259
    init_tile: 9 arrow2
    n:10,value:259
    init_tile: 10 arrow3
    n:11,value:259
    init_tile: 11 arrow4
    n:12,value:259
    init_tile: 12 arrow6
    n:13,value:259
    init_tile: 13 arrow7
    n:14,value:259
    init_tile: 14 arrow8
    n:15,value:259
    init_tile: 15 arrow9
    n:16,value:0
    init_tile: 16 edge
    n:17,value:0
    init_tile: 17 detonator
    n:18,value:0
    init_tile: 18 jewel
    n:19,value:0
    init_tile: 19 cartridge
    n:20,value:0
    init_tile: 20 tech1
    n:21,value:0
    init_tile: 21 sandbag
    n:22,value:0
    init_tile: 22 light1
    n:23,value:0
    init_tile: 23 light2
    n:24,value:0
    init_tile: 24 light3
    n:25,value:0
    init_tile: 25 light4
    n:26,value:0
    init_tile: 26 reaction1
    n:27,value:0
    init_tile: 27 icon-0
    n:28,value:1
    init_tile: 28 icon-1
    n:29,value:2
    init_tile: 29 icon-2
    n:30,value:3
    init_tile: 30 icon-3
    n:31,value:4
    init_tile: 31 icon-4
    n:32,value:5
    init_tile: 32 icon-5
    n:33,value:6
    init_tile: 33 icon-6
    n:34,value:7
    init_tile: 34 icon-7
    n:35,value:8
    init_tile: 35 icon-8
    n:36,value:9
    init_tile: 36 icon-9
    n:37,value:10
    init_tile: 37 icon-a
    n:38,value:11
    init_tile: 38 icon-b
    n:39,value:12
    init_tile: 39 icon-c
    n:40,value:13
    init_tile: 40 icon-d
    n:41,value:14
    init_tile: 41 icon-e
    n:42,value:15
    init_tile: 42 icon-f
    n:43,value:0
    init_tile: 43 tech2
    n:44,value:0
    init_tile: 44 tech3
    n:45,value:0
    init_tile: 45 lock1
    n:46,value:0
    init_tile: 46 lock2
    n:47,value:0
    init_tile: 47 lock3
    n:48,value:0
    init_tile: 48 reaction2
    n:49,value:0
    init_tile: 49 reaction3
    n:50,value:0
    init_tile: 50 unlock
    n:51,value:0
    init_tile: 51 floor2
    n:52,value:0
    init_tile: 52 wall2
    n:53,value:0
    init_tile: 53 wall3
    n:54,value:0
    init_tile: 54 floor3
    n:55,value:260
    init_tile: 55 clight1
    n:56,value:260
    init_tile: 56 clight2
    n:57,value:260
    init_tile: 57 clight3
    n:58,value:260
    init_tile: 58 clight4
    n:59,value:262
    init_tile: 59 toggle-on
    n:60,value:262
    init_tile: 60 toggle-off
    n:61,value:263
    init_tile: 61 sniper
    n:62,value:0
    init_tile: 62 light5
    n:63,value:260
    init_tile: 63 clight5
    n:64,value:0
    init_tile: 64 secret
    n:65,value:0
    init_tile: 65 floor4
    n:66,value:0
    init_tile: 66 floor5
    n:67,value:0
    init_tile: 67 wall4
    n:68,value:0
    init_tile: 68 wall5
    n:69,value:0
    init_tile: 69 floor6
    n:70,value:0
    init_tile: 70 floor7
    n:71,value:0
    init_tile: 71 floor8
    n:72,value:0
    init_tile: 72 floor9
    n:73,value:0
    init_tile: 73 floor10
    n:74,value:0
    init_tile: 74 floor11
    n:75,value:0
    init_tile: 75 floor12
    n:76,value:0
    init_tile: 76 floor13
    n:77,value:0
    init_tile: 77 floor14
    n:78,value:0
    init_tile: 78 floor15
    n:79,value:0
    init_tile: 79 floor16
    n:80,value:264
    init_tile: 80 zombie
    n:81,value:0
    init_tile: 81 savept
    n:82,value:0
    init_tile: 82 dust
    n:83,value:0
    init_tile: 83 noguard
    n:84,value:0
    init_tile: 84 keycard1
    n:85,value:0
    init_tile: 85 keycard2
    n:86,value:0
    init_tile: 86 keycard3
    n:87,value:0
    init_tile: 87 gate1
    n:88,value:0
    init_tile: 88 gate2
    n:89,value:0
    init_tile: 89 gate3
    n:90,value:265
    init_tile: 90 laser1
    n:91,value:265
    init_tile: 91 laser2
    n:92,value:265
    init_tile: 92 laser3
    n:93,value:0
    init_tile: 93 crystal
    n:94,value:266
    init_tile: 94 spider
    init_level: 1 easybomber
    init_level: 2 square-mini-maze
    init_level: 3 dark03
    init_level: 4 intro-take-5
    init_level: 5 smallbomber
    init_level: 6 smallgenerator
    init_level: 7 advanced-lab
    init_level: 8 triplelab
    init_level: 9 the-halls
    init_level: 10 dualcity
    init_level: 11 big-tech-cave-crystals
    init_level: 12 prison1
    init_level: 13 castle17
    init_level: 14 the-core
    init_level: 15 palace89
    init_level: 16 laser-lab
    init_level: 17 stealthgems
    init_level: 18 large-castle
    init_level: 19 unobtainium
    init_level: 20 factory-7
    init_level: 21 crystalrefinery
    init_level: 22 difficult-cave
    init_level: 23 final4
    init_level: 24 final7
    init_level: 25 final3c
    init_level: 26 crystal234
    init_level: 27 abandonedmine
    init_level: 28 windswept
    init_ach: 1 mercy
    init_ach: 2 nolight
    init_ach: 3 nokeys
    init_ach: 4 cartridges
    init_ach: 5 kills
    init_ach: 6 bombs
    init_ach: 7 slow
    init_ach: 8 fast
    init_ach: 9 tutorial
    init_ach: 10 win
    init_ach: 11 deaths
    init_ach: 12 jewels
    init_ach: 13 packrat
    init_ach: 14 completion
    init_ach: 15 nodeaths
    unable to find img arrow1
    
    unable to find img jewel
    unable to find img sandbag
    unable to find img toggle-on
    unable to find img toggle-off
    unable to find img dust
    alpha.dat: 262144
    opening /home/chewi/.dynamitejack/userns.db in READWRITE/CREATE mode
    sqlite3:prepare [1] table levels already exists; sql=create table levels (id text primary key, data blob, ts int, author text, title text, q text, uid text, stars float, skulls float)
    sqlite3:prepare [1] table ratings already exists; sql=create table ratings (lid text primary key, stars int, skulls int)
    sqlite3:prepare [1] duplicate column name: type; sql=alter table levels add type text
    sqlite3:prepare [1] duplicate column name: value; sql=alter table levels add value int
    sqlite3:prepare [1] duplicate column name: intro; sql=alter table levels add intro text
    sqlite3:prepare [1] duplicate column name: name; sql=alter table levels add name text
    sqlite3:prepare [1] duplicate column name: style; sql=alter table levels add style text
    sqlite3:prepare [1] index idx_levels_q already exists; sql=create index idx_levels_q on levels (q)
    opening /home/chewi/.dynamitejack/shared.db in READWRITE/CREATE mode
    sqlite3:prepare [1] table levels already exists; sql=create table levels (id text primary key, data blob, ts int, author text, title text, q text, uid text, stars float, skulls float)
    sqlite3:prepare [1] table ratings already exists; sql=create table ratings (lid text primary key, stars int, skulls int)
    sqlite3:prepare [1] duplicate column name: type; sql=alter table levels add type text
    sqlite3:prepare [1] duplicate column name: value; sql=alter table levels add value int
    sqlite3:prepare [1] duplicate column name: intro; sql=alter table levels add intro text
    sqlite3:prepare [1] duplicate column name: name; sql=alter table levels add name text
    sqlite3:prepare [1] duplicate column name: style; sql=alter table levels add style text
    sqlite3:prepare [1] index idx_levels_q already exists; sql=create index idx_levels_q on levels (q)
    orient: 0.000000 -> 0.000000
    trying load stream mus-menus
    doing load stream mus-menus
    stream_load in ticks: 1
    opening ../data/gameinfo.db in READONLY mode
    trying load font font1
    doing load font font1 (1)
    trying load font font15
    doing load font font15 (2)
    trying load font font2
    doing load font font2 (3)
    opening /home/chewi/.dynamitejack/reliable.db in READWRITE/CREATE mode
    sqlite3:prepare [1] table events already exists; sql=create table events (n text primary key, name text, data blob, ts int)
    sizeof(Entity) = 580 b
    sizeof(level) = 117k
    sizeof(game) = 433k
    udid:1c1b0d9de366-1633903719, name:Anonymous, uid:a:1c1b0d9de366-1633903719 token:0cda58aa2be38f43503552146d446cec
    gethostbyname ...
    cuz_gethostbyname('www.galcon.com') cached
    setvol: 0
    setplayposition: 0
    setispaused: 0
    Pos: set: 0 get: 0 tt:1575
    
    opened by chewi 17
  • Convert SDL2 Scancodes into SDLKey, not SDL2 Keycodes

    Convert SDL2 Scancodes into SDLKey, not SDL2 Keycodes

    [WARNING: This completely changes a lot of the keyboard input behaviour, and so is quite likely to cause some regressions. It seems to work okay for me, but there may be implications of this I've not noticed…]

    SDL 1.2's keysym appears to be entirely layout-indpendent: it always acts as though there is a US keyboard layout. i.e., the values represent the positions on the keyboard, not the "meaning" of the key. This matches what SDL 2.0 scancodes do, but not SDL 2.0 keycodes, which are translated according to the current keyboard layout.

    This means that many SDL 1.2 applications would suddenly start using the user's keyboard layout, rather than the US one, which -- while quite convenient in some cases -- is a change in behaviour and could break things.

    Instead of converting SDL_Keycode→SDLKey, this patch converts from SDL_Scancode→SDLKey, preserving the original behaviour. SDL 1.2 applications will still get translated values in the 'unicode' Keysym variable if enabled, so text input in many applications will still work as expected.

    On the implementation side, this currently just has the one CASESCANCODE20TOKEY12 function which takes both the SDL_Scancode and SDLKey names, even though these are identical most of the time. The previous implementation had a separate macro for the case there were the same: I found it easier to copy-paste things without it, but I'm happy to do that if we prefer.

    The other option is to keep both implementations, and have an environment variable to switch between them. That might allow us to add keyboard layout support to some SDL 1.2 titles which previously didn't support it, but could break some things (e.g. DOSBox's own keyboard layout support with usescancodes=false, as seen in #84) if we used Keycodes by default.

    opened by sulix 17
  • Non-US Keyboard layouts not supported

    Non-US Keyboard layouts not supported

    Just to make sure this is in a proper issue and not just in comments on a closed PR: SDL1.2 did support non-US layouts. Maybe not as well as SDL2 does, but contrary to the assumptions in #97 it did not just use scancodes.

    (Pasting my comment from #97:)

    For example, look at SDL1.2's X11_TranslateKeycode(): https://github.com/libsdl-org/SDL-1.2/blob/main/src/video/x11/SDL_x11events.c#L1155 It translates the X11 KeyCode (which is kinda like a SDL scancode) to a X11 KeySym (which is supposed to be the thing printed on the keyboard's keycaps, i.e. like SDL2 SDL_KeyCode, see https://tronche.com/gui/x/xlib/input/keyboard-encoding.html) and then translates that to a SDLKey which is used in SDL_keysym::sym (see https://github.com/libsdl-org/SDL-1.2/blob/main/src/video/x11/SDL_x11events.c#L606 ).

    So SDLKey indeed is based on the name of (printed on) the key and not the scancode.

    So https://github.com/libsdl-org/sdl12-compat/blob/36a09e450a007c86ed0f91812fbbba0d783be120/src/SDL12_compat.c#L2564 should be turned to #if 1 and maybe some additional work could be done to support more (non-ASCII) keys; I'm not sure how exactly those (e.g. German Umlaut keys) were handled in SDL1.2.

    I hope I'll get around to look into this a bit, but I don't know when so I can't promise anything right now.

    opened by DanielGibson 16
  • Hammerfight mouse stuck in place

    Hammerfight mouse stuck in place

    Hammerfight superficially works (audio plays, pixels are drawn) but something is badly wrong with the mouse capture: the cursor stays in one place, unless I Alt+Tab away and then back, in which case it moves once but then stays where it moved to. I get the same results by disabling Steam Linux Runtime, so I think maybe Hammerfight's bundled copy of SDL 1.2 (which I disabled here) has been patched to use a different mouse capture mode or something.

    opened by slouken 15
  • Documentation about what time you must set the environment variables

    Documentation about what time you must set the environment variables

    Can the environment variables be set after the program has started, and if so, when? Before SDL_Init call? Before SDL_SetVideoMode call? Is it different for different environment variables, or for which subsystems are initialized? You should document this.

    opened by zzo38 0
  • OpenXcom opengl video filters cause crashes with sdl12-compat

    OpenXcom opengl video filters cause crashes with sdl12-compat

    Arch Linux recently replaced sdl with sdl12-compat 1.2.52-2, and this seems to have caused OpenXcom's OpenGL-using video filters to cause crashes when they are enabled. The following log output is generated by the game in relation to the crash:

    [04-05-2022_20-44-58]   [FATAL] A fatal error has occurred: Use SDL_GL_SwapBuffers() on OpenGL surfaces
    [04-05-2022_20-44-58]   [FATAL] /usr/bin/openxcom(OpenXcom::CrossPlatform::stackTrace(void*)+0x3b) [0x55ac75b606cb]
    [04-05-2022_20-44-58]   [FATAL] /usr/bin/openxcom(OpenXcom::CrossPlatform::crashDump(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x4c6) [0x55ac75b61c76]
    [04-05-2022_20-44-58]   [FATAL] /usr/bin/openxcom(exceptionLogger()+0x4d) [0x55ac7595283d]
    [04-05-2022_20-44-58]   [FATAL] /usr/lib/libstdc++.so.6(+0xa5c4c) [0x7f1dcc7f4c4c]
    [04-05-2022_20-44-58]   [FATAL] /usr/lib/libstdc++.so.6(+0xa5cb9) [0x7f1dcc7f4cb9]
    [04-05-2022_20-44-58]   [FATAL] /usr/lib/libstdc++.so.6(+0xa5f5e) [0x7f1dcc7f4f5e]
    [04-05-2022_20-44-58]   [FATAL] /usr/bin/openxcom(+0x273d06) [0x55ac758dfd06]
    [04-05-2022_20-44-58]   [FATAL] /usr/bin/openxcom(OpenXcom::Game::run()+0x65a) [0x55ac75b8547a]
    [04-05-2022_20-44-58]   [FATAL] /usr/bin/openxcom(main+0x15e) [0x55ac759303ee]
    [04-05-2022_20-44-58]   [FATAL] /usr/lib/libc.so.6(+0x2d310) [0x7f1dcc46f310]
    [04-05-2022_20-44-58]   [FATAL] /usr/lib/libc.so.6(__libc_start_main+0x81) [0x7f1dcc46f3c1]
    [04-05-2022_20-44-58]   [FATAL] /usr/bin/openxcom(_start+0x25) [0x55ac759359a5]
    [04-05-2022_20-45-02]   [FATAL] OpenXcom has crashed: Use SDL_GL_SwapBuffers() on OpenGL surfaces
    

    Unfortunately I haven't been able to get any extra info from gdb.

    Downgrading to the old sdl package fixes the issue.

    opened by WorMzy 0
  • tucnak broken video and coredump

    tucnak broken video and coredump

    Noticed this in RedHat bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2037565

    tucnak & associated libzia: http://tucnak.nagano.cz

    As noted in the original bug report, video is broken with sdl12-compat but not with real SDL-1.2. Reproduced the coredump, which happens with SDL2 built with -O3 but not with lower optimization levels for me:

    (gdb) bt
    #0  0x00164424 in __kernel_vsyscall ()
    #1  0x008f87c1 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
    #2  0x008fa09a in abort () at abort.c:92
    #3  0x009386c5 in __libc_message (do_abort=2, fmt=0xa27910 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:198
    #4  0x0093ec31 in malloc_printerr (action=<value optimized out>, str=<value optimized out>, ptr=0xb6203e80, ar_ptr=0xb6200010) at malloc.c:6360
    #5  0x00941691 in _int_free (av=0xb6200010, p=0xb6203e78, have_lock=0) at malloc.c:4846
    #6  0x012918dc in ?? () from /usr/lib/dri/radeonsi_dri.so
    #7  0x0129c8cf in ?? () from /usr/lib/dri/radeonsi_dri.so
    #8  0x00fa4350 in ?? () from /usr/lib/dri/radeonsi_dri.so
    #9  0x00fa01a9 in ?? () from /usr/lib/dri/radeonsi_dri.so
    #10 0x00fa73eb in ?? () from /usr/lib/dri/radeonsi_dri.so
    #11 0x00e4eb2b in ?? () from /usr/lib/dri/radeonsi_dri.so
    #12 0x07caf156 in shared_dispatch_stub_203 () from /usr/lib/libglapi.so.0
    #13 0x0033c733 in GL_RunCommandQueue (renderer=0x854a830, cmd=0x87bf2a8, vertices=0x8895ab8, vertsize=120) at /home/ozzie/3/SDL/src/render/opengl/SDL_render_gl.c:1291
    #14 0x00329a07 in FlushRenderCommands (renderer=0x854a830) at /home/ozzie/3/SDL/src/render/SDL_render.c:244
    #15 0x00329d37 in SDL_RenderPresent_REAL (renderer=0x854a830) at /home/ozzie/3/SDL/src/render/SDL_render.c:4225
    #16 0x002f2ede in SDL_RenderPresent (a=0x854a830) at /home/ozzie/3/SDL/src/dynapi/SDL_dynapi_procs.h:377
    #17 0x00289273 in PresentScreen () at SDL12_compat.c:5839
    #18 0x00289e55 in SDL_PumpEvents () at SDL12_compat.c:6113
    #19 0x08102bfc in sdl_event_thread (handle=0xe) at tsdl.c:998
    #20 0x00b42680 in ?? () from /lib/libglib-2.0.so.0
    #21 0x00a99bc9 in start_thread (arg=0xb6da7b70) at pthread_create.c:301
    #22 0x009b111e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133
    

    The segmentation fault seems to go away by the following change, but the broken video remains. (The change to PresentScreen() is the segfault fix, zeroing PendingKeydownEvent in Quit12Video() is possibly unnecessary...)

    diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
    index 0b13d95..db22c30 100644
    --- a/src/SDL12_compat.c
    +++ b/src/SDL12_compat.c
    @@ -2137,6 +2137,7 @@ Quit12Video(void)
         VideoInfoVfmt20 = NULL;
         EventFilter12 = NULL;
         EventQueueAvailable = EventQueueHead = EventQueueTail = NULL;
    +    SDL20_memset(&PendingKeydownEvent, 0, sizeof(SDL12_Event));
         SDL_FreeCursor(CurrentCursor12);
         VideoModes = NULL;
         VideoModesCount = 0;
    @@ -5825,6 +5826,10 @@ SDL_DisplayFormatAlpha(SDL12_Surface *surface12)
     static void
     PresentScreen(void)
     {
    +    if (!VideoRenderer20) {
    +        return;
    +    }
    +
         SDL20_RenderClear(VideoRenderer20);
         SDL20_RenderCopy(VideoRenderer20, VideoTexture20, NULL, NULL);
     
    

    CC: @Conan-Kudo

    opened by sezero 5
  • Rendering without graphics on GLES3 compatible cards

    Rendering without graphics on GLES3 compatible cards

    There isn't a segfault but the programs render without graphics.

    Everything runs fine when I run the application on a RK3328 that uses a Mali UTGard 450 that supports only GLES2.

    However when I run the same programs on a RK3399 that uses a Mali Midgard 860 that supports up to GLES3 then I see a number of applications rendering without graphics. No crashes, and audio plays, but no graphics are rendered.

    The only application where I can absolutely confirm that sdl12-compat is the issue is netsurf, so for now I'll limit the scope of the issue to that, but I expect other applications will be affected by the same bug.

    I see another issue opened for netsurf so I've run the recommended GDB on that binary to confirm it's selected KMSDRM. https://github.com/libsdl-org/sdl12-compat/issues/155

    I can confirm when using normal SDL1.2 that netsurf does display properly.

    I have tested with both SDL v2.0.18 and v2.0.20.

    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/libthread_db.so.1".
    INFO: sdl12-compat, built on Mar 21 2022 at 14:47:25, talking to SDL2 2.0.20
    Identified kernel 4.4, initializing full graphics stack
    [Detaching after vfork from child process 24230]
    REQUESTING RESOLUTION: 1024x768
    Found encoder crtc
    [New Thread 0xf55753c0 (LWP 24252)]
    [New Thread 0xf4d743c0 (LWP 24253)]
    [New Thread 0xf45733c0 (LWP 24254)]
    [New Thread 0xf3d723c0 (LWP 24255)]
    [New Thread 0xf35713c0 (LWP 24256)]
    [New Thread 0xf2d703c0 (LWP 24257)]
    [New Thread 0xf256f3c0 (LWP 24258)]
    [New Thread 0xf1d6e3c0 (LWP 24259)]
    [New Thread 0xf156d3c0 (LWP 24260)]
    arm_release_ver of this libmali is 'r18p0-01rel0', rk_so_ver is '4'.Using display 0x3e91c8 with EGL version 1.4
    EGL Version "1.4 Midgard-"r18p0-01rel0""
    EGL Vendor "ARM"
    EGL Extensions "EGL_KHR_partial_update EGL_KHR_image_pixmap EGL_EXT_image_dma_buf_import EGL_KHR_config_attribs EGL_KHR_ima ge EGL_KHR_image_base EGL_KHR_fence_sync EGL_KHR_wait_sync EGL_KHR_gl_colorspace EGL_KHR_get_all_proc_addresses EGL_IMG_con text_priority EGL_ARM_pixmap_multisample_discard EGL_ARM_implicit_external_sync EGL_KHR_gl_texture_2D_image EGL_KHR_gl_rend erbuffer_image EGL_KHR_create_context EGL_KHR_surfaceless_context EGL_KHR_gl_texture_cubemap_image EGL_EXT_create_context_r obustness"
    GL Extensions: "GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL _OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ET C1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_O ES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_m apbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OE S_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_text ure_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjo int_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_s torage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_s torage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB  GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_blend_equation_ advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_ EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_cl amp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader _multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_s hader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_ extension_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_EXT_copy_image GL _OES_copy_image GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multivie w2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_eleme nts_base_vertex GL_OES_draw_elements_base_vertex "
    INFO: FIXME: there is never a parachute in SDL2, should we catch segfaults ourselves? (SDL_Init:1866)
    INFO: FIXME: support SDL_INIT_EVENTTHREAD where it makes sense? (SDL_InitSubSystem:1832)
    
    Thread 1 "netsurf-fb" hit Breakpoint 1, 0xf55d10a8 in SDL_Init_REAL () from /usr/lib/libSDL2-2.0.so.0
    (gdb) fin
    Run till exit from #0  0xf55d10a8 in SDL_Init_REAL () from /usr/lib/libSDL2-2.0.so.0
    [New Thread 0xf08ff3c0 (LWP 24265)]
    0xf5e595c0 in SDL_InitSubSystem () from /usr/lib/libSDL-1.2.so.0
    (gdb) p (const char *) SDL_GetCurrentVideoDriver()
    $1 = 0xf56e5c44 "KMSDRM"
    (gdb)
    

    In case it's somehow related, I experienced a similar behavior in a prior issue that is still open and was able to resolve by limiting to a single thread. I don't have an easy config for that in netsurf. https://github.com/libsdl-org/sdl12-compat/issues/110

    opened by mrfixit2001 0
  • Misc. issues affecting Loki port of Civilization: Call to Power

    Misc. issues affecting Loki port of Civilization: Call to Power

    [Just dropping my notes about this here: I may split things up and/or fix them if I get some time…]

    There are a large number of issues with Civilization: Call to Power v1.2a (it being an ancient SDL 1.1 game with a bunch of glibc/libstdc++ incompatibilities). Getting it to run even with real SDL 1.2 on a modern system (i.e., with modern glibc, etc, dynamically linked) is a chore, involving a lot of hex editing and patching. See: https://gist.github.com/sulix/09f059c468fcb58eefbca8ef46006ccb

    That being said, while it does crash occasionally regardless, it does work considerably better with the real SDL 1.2 than with sdl12-compat. Maybe some of the issues could affect other games as well:

    • [X] SDL_INIT_EVENTTHREAD: CivCTP uses this, and doesn't often call SDL_PumpEvents() otherwise. Hacked around by calling SDL_PumpEvents() from within SDL_PeepEvents(). There may need to be more work on it to fix the next issue, though…
    • [ ] Multithreaded SDL_UpdateRects(): CivCTP calls SDL_UpdateRects() from two different threads, only one of which is the original thread. Under wayland (and nvidia+x11), this results in eglMakeCurrent failing in the renderer, and the texture locking/reupload failing a lot of the time (mouse cursor only visible sometimes, YUV overlays show up green, etc). It might be contributing to the random crashing in the renderer/Mesa on X11/Intel, too. Maybe we should keep a shadow surface in local memory (without needing to call into GL to lock it each call), and then defer the actual updates to present, which we can defer to the main thread? Though that might not work, as the "main" thread might not be doing any SDL calls at all during some parts of the game…
    • [ ] Stack realignment: CivCTP's stacks are 4-byte aligned. Most distros are built with 16-byte aligned stacks to use SSE. Use __attribute__((force_align_arg_pointer)) to realign stacks in sdl12-compat to bridge this gap.
    • [ ] CD audio / game audio device re-opening: The format conversion between the 22050/mono/8bit and 44100/stereo/16bit big-endian when mixing CD audio and SDL audio is broken if the (real) device is closed/re-opened to pick a better common format. Forcing sdl12-compat to always open the real device at 44100/stereo/16bit works around this, but there's clearly a real bug here.
    • [x] SDL_FreeYUVOverlay() should reset QueuedDisplayOverlay12 = NULL;: I don't think this is the cause of any of the issues, but seems like it's a real bug.
    • [X] X11 Usage: CivCTP calls XNextEvent, XSync, XGetWindowAttributes, XFree, XInternAtom, XSendEvent and XQueryPointer. This doesn't seem to cause any issues, though, even under Wayland?
    opened by sulix 9
  • Psychonauts: Mouse cannot escape window on wayland.

    Psychonauts: Mouse cannot escape window on wayland.

    As I'm sure is well documented, the psychonauts linux port has many issues related to sdl1, mainly those of being unable to alt tab, and input being forced in. Now on x11 while alt tabbing works fine with the compat layer, mouse escape does not in windowed mode (Meaning you can remove input from the game by moving the mouse away from it)

    Now on wayland things change, as wayland has guarantees about always being able to alt tab, and indeed when using the real sdl1.2, you can alt tab on wayland. And when using real sdl1 on wayland, you can escape mouse control in windowed mode by shaking your mouse out, however when using the compat layer, mouse input is 100% locked unless you alt tab.

    Sorry if this is poorly worded or not even an issue, but I felt it was worth noting as technicality on Wayland, its better to NOT run the layer.

    opened by Bitwolfies 1
Releases(release-1.2.52)
  • release-1.2.52(Mar 3, 2022)

Owner
Simple Directmedia Layer
Simple Directmedia Layer (SDL) is a framework for creating cross-platform games and applications.
Simple Directmedia Layer
Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!

DEPRECATED The 1.2 branch of SDL is deprecated. While we occasionally collect fixes in revision control, there has not been a formal release since 201

Simple Directmedia Layer 38 Jul 25, 2022
Simple DirectMedia Layer (SDL) 1.2 for Symbian S60v1 devices such as the Nokia N-Gage.

SDL 1.2 Even though SDL 1.2 is outdated and officially no longer supported, this is an attempt to get it running on Symbian S60v1 devices such as the

N-Gage SDK. 4 Apr 4, 2022
DxWrapper is a .dll file designed to wrap DirectX files to fix compatibility issues in older games

DxWrapper Introduction DxWrapper is a .dll file designed to wrap DirectX files to fix compatibility issues in older games. This project is primarily t

Elisha Riedlinger 692 Aug 1, 2022
Image decoding for many popular formats for Simple Directmedia Layer.

SDL_image 2.0 The latest version of this library is available from: http://www.libsdl.org/projects/SDL_image/ This is a simple library to load image

Simple Directmedia Layer 165 Aug 8, 2022
Simple Directmedia Layer

Simple DirectMedia Layer (SDL) Version 2.0 --- https://www.libsdl.org/ Simple Di

Simple Directmedia Layer 3.5k Aug 6, 2022
Simple Directmedia Layer

hb-sdl Harbour bindings for SDL 2.0.16, a Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to aud

Rafał Jopek 1 Jan 19, 2022
A library for high-performance, modern 2D graphics with SDL written in C.

SDL_gpu, a library for making hardware-accelerated 2D graphics easy. by Jonathan Dearborn SDL_gpu is licensed under the terms of the MIT License. See

Jonathan Dearborn 1k Jul 29, 2022
Minecraft 4k: decompiled, translated to C using SDL for graphics and input, and improved upon

M4KC Minecraft 4K - C Rewrite For those who don't know, Minecraft 4K was a stripped down version of Minecraft submitted by Notch to the Java 4K Game P

Sasha Koshka 34 Jul 25, 2022
Cross-platform version of Heboris C7EX using a hardware-accelerated SDL 2.0 renderer

Heboris C7EX - unofficial version (YGS2K EX) This version contains the source code for Heboris C7EX. It requires a C compiler, SDL 2.0, SDL 2.0 mixer,

Brandon McGriff 9 May 27, 2022
sdl based game framework

Hallow Engine an sdl-based game framework Install Procedure Install SDL2[https://libsdl.org] and take the .h(header) files from the include/ folder, t

Hallow - The Game Framework 6 Nov 24, 2021
A simple game framework written in C++ using SDL

SGF SGF (Simple Game Framework) is, as the name implies; a very simple and easy to use game framework written in C++ using SDL. Currently the project

Cam K. 1 Nov 4, 2021
Raycaster demo in SDL, inspired by 3DSage

raycastersdl -Coded following 3DSage's tutorial. Part 1 -> https://www.youtube.com/watch?v=gYRrGTC7GtA Remeber to install SDL2 libraries first: sudo a

Velorek1 1 Oct 30, 2021
A very simple 2D game engine written in C++, using SDL and Lua.

2D Game Engine written in C++, SDL, and Lua. This is a simple 2D game engine written in C++ and using SDL and Lua scripting

Gustavo Pezzi 16 Jul 13, 2022
A Binary Clock. Written 3 different ways. C and SDL, Python and PyGame, Python and PyGame Zero.

Super Clock A Binary Clock. Written 3 different ways. Python with PyGame Zero, Python with PyGame and C with SDL2. Time is displayed in 3 groups of 8

null 3 Dec 8, 2021
A demo test game made from scratch using C++ and SDL

Dethroning Table of contents About This Game How to Compile the game About This Game This is a Cross-Platform Game Demo. How to Compile the game Run t

Haider Mirza 1 Jan 21, 2022
A faster drop-in replacement for giflib. It uses more RAM, but you get more speed.

GIFLIB-Turbo What is it? A faster drop-in replacement for GIFLIB Why did you write it? Starting in the late 80's, I was fascinated with computer graph

Larry Bank 27 Jun 9, 2022
✔️The smallest header-only GUI library(4 KLOC) for all platforms

Welcome to GUI-lite The smallest header-only GUI library (4 KLOC) for all platforms. 中文 Lightweight ✂️ Small: 4,000+ lines of C++ code, zero dependenc

null 6.3k Jul 31, 2022
LibreSSL Portable itself. This includes the build scaffold and compatibility layer that builds portable LibreSSL from the OpenBSD source code.

LibreSSL Portable itself. This includes the build scaffold and compatibility layer that builds portable LibreSSL from the OpenBSD source code.

OpenBSD LibreSSL Portable 1.1k Jul 29, 2022
Investigating the bug behind CVE-2021-26708

vsock_poc Investigating the bug behind CVE-2021-26708 This repo contains a small writeup about CVE-2021-26708, and how this bug can be turned into a U

Jordan 23 May 14, 2022
Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.

Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.

Storm Devs 637 Aug 6, 2022
GnuTLS implements the TLS/SSL (Transport Layer Security aka Secure Sockets Layer) protocol

GnuTLS implements the TLS/SSL (Transport Layer Security aka Secure Sockets Layer) protocol

Jonathan Bastien-Filiatrault 3 Jun 3, 2021
Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!

DEPRECATED The 1.2 branch of SDL is deprecated. While we occasionally collect fixes in revision control, there has not been a formal release since 201

Simple Directmedia Layer 38 Jul 25, 2022
Simple DirectMedia Layer (SDL) 1.2 for Symbian S60v1 devices such as the Nokia N-Gage.

SDL 1.2 Even though SDL 1.2 is outdated and officially no longer supported, this is an attempt to get it running on Symbian S60v1 devices such as the

N-Gage SDK. 4 Apr 4, 2022
A RGB-D SLAM system for structural scenes, which makes use of point-line-plane features and the Manhattan World assumption.

This repo proposes a RGB-D SLAM system specifically designed for structured environments and aimed at improved tracking and mapping accuracy by relying on geometric features that are extracted from the surrounding.

Yanyan Li 233 Jul 28, 2022
This repository is used for automatic calibration between high resolution LiDAR and camera in targetless scenes.

livox_camera_calib livox_camera_calib is a robust, high accuracy extrinsic calibration tool between high resolution LiDAR (e.g. Livox) and camera in t

HKU-Mars-Lab 393 Jul 29, 2022
Visual-inertial-wheel fusion odometry, better performance in scenes with drastic changes in light

VIW-Fusion An visual-inertial-wheel fusion odometry VIW-Fusion is an optimization-based viusla-inertial-wheel fusion odometry, which is developed as a

庄庭达 189 Aug 6, 2022
BAAF-Net - Semantic Segmentation for Real Point Cloud Scenes via Bilateral Augmentation and Adaptive Fusion (CVPR 2021)

Semantic Segmentation for Real Point Cloud Scenes via Bilateral Augmentation and Adaptive Fusion (CVPR 2021) This repository is for BAAF-Net introduce

null 84 Jul 17, 2022
A BSD-based OS project that aims to provide an experience like and some compatibility with macOS

What is Helium? Helium is a new open source OS project that aims to provide a similar experience and some compatibiilty with macOS on x86-64 sytems. I

Zoë Knox 2.5k Aug 5, 2022
OceanBase is an enterprise distributed relational database with high availability, high performance, horizontal scalability, and compatibility with SQL standards.

What is OceanBase database OceanBase Database is a native distributed relational database. It is developed entirely by Alibaba and Ant Group. OceanBas

OceanBase 4.5k Aug 9, 2022