# How do I attach SDL2 to my code?

**URL:** https://fortran-lang.discourse.group/t/how-do-i-attach-sdl2-to-my-code/8909
**Category:** Help
**Created:** [November 30, 2024, 10:35pm UTC](https://fortran-lang.discourse.group/t/how-do-i-attach-sdl2-to-my-code/8909 "2024-11-30T22:35:20Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)
#### Post date: [December 1, 2024, 11:33pm UTC](https://fortran-lang.discourse.group/t/how-do-i-attach-sdl2-to-my-code/8909/4 "2024-12-01T23:33:15Z")

</div>

Game of Life was going to be my next idea for a (nightly) Fortran SDL project. I’m glad you’ve done it already. 😂

I also created a custom SDL2 [backend](https://github.com/ivan-pi/fc8/blob/main/src/sdl2/fc8_io.c) in C with Fortran bindings for the [Fortran CHIP8](https://fortran-lang.discourse.group/t/fortran-chip-8-interpreter/6772) virtual machine. SDL2 was easier to use than [Xlib](https://en.wikipedia.org/wiki/Xlib). Initially I tried using [EGGX/ProCall](https://www.ir.isas.jaxa.jp/~cyamauch/eggx_procall/) but it lacked the functionality to distinguish key _releases_ from key _presses_.

---

_[View the full topic](https://fortran-lang.discourse.group/t/how-do-i-attach-sdl2-to-my-code/8909)._
