# Game Development

**URL:** https://discourse.libsdl.org/c/game-development/7.md

[Latest](https://discourse.libsdl.org/latest.md) · [Categories](https://discourse.libsdl.org/categories.md)

---

## [About the Game Development category](https://discourse.libsdl.org/t/about-the-game-development-category/14)

<div class="topic-metadata">

**Author:** [@icculus](https://discourse.libsdl.org/u/icculus)\
**Replies:** 0\
**Last updated:** [March 26, 2017, 3:39am UTC](https://discourse.libsdl.org/t/about-the-game-development-category/14 "2017-03-26T03:39:44Z")

</div>

This is where non-SDL discussion about making games can go. If you prefer to use this as a mailing list instead of a web forum, emails to gamedev@discourse.libsdl.org will show up here as new topics. Turn on mailing li…

---

## [Why are the enemies not appearing on the screen?](https://discourse.libsdl.org/t/why-are-the-enemies-not-appearing-on-the-screen/69403)

<div class="topic-metadata">

**Author:** [@Al881](https://discourse.libsdl.org/u/Al881)\
**Replies:** 48\
**Last updated:** [October 4, 2026, 3:14pm UTC](https://discourse.libsdl.org/t/why-are-the-enemies-not-appearing-on-the-screen/69403 "2026-10-04T15:14:27Z")

</div>

I’m writing a game based on these two tutorials Lazy Foo' Productions - Motion I managed to get enemies on the screen with now I’m trying to get the enemies firing back but they are not appearing on the screen. Csn…

---

## [Tweeny, an interpolation library: ten years later](https://discourse.libsdl.org/t/tweeny-an-interpolation-library-ten-years-later/69047)

<div class="topic-metadata">

**Author:** [@Leonardo\_Guilherme](https://discourse.libsdl.org/u/Leonardo_Guilherme)\
**Replies:** 2\
**Last updated:** [September 27, 2026, 6:00pm UTC](https://discourse.libsdl.org/t/tweeny-an-interpolation-library-ten-years-later/69047 "2026-09-27T18:00:05Z")

</div>

Hello! Almost ten years ago I announced Tweeny on this forum: Today I’m releasing Tweeny 4.0.0, a rewrite of that library. Still header-only, no external dependencies, C++17. Fluent builder API, 30+ easings, multi-p…

---

## [Why are my enemy sprites not appearing on the screen?](https://discourse.libsdl.org/t/why-are-my-enemy-sprites-not-appearing-on-the-screen/69365)

<div class="topic-metadata">

**Author:** [@Al881](https://discourse.libsdl.org/u/Al881)\
**Replies:** 2\
**Last updated:** [September 22, 2026, 7:17am UTC](https://discourse.libsdl.org/t/why-are-my-enemy-sprites-not-appearing-on-the-screen/69365 "2026-09-22T07:17:49Z")

</div>

Hi, I’m hacking together code from Lazy Foo' Productions - Beginning Game Programming v2.0 and SDL2 - Creating a 2D Shoot 'Em Up - parallelrealities.co.uk I have changed some strucys in t classes and replaced free and m…

---

## [\[SDL2\] Help to smooth player update based on V\_SYNC](https://discourse.libsdl.org/t/sdl2-help-to-smooth-player-update-based-on-v-sync/69334)

<div class="topic-metadata">

**Author:** [@gabrielsmoreira](https://discourse.libsdl.org/u/gabrielsmoreira)\
**Replies:** 2\
**Last updated:** [September 18, 2026, 2:33pm UTC](https://discourse.libsdl.org/t/sdl2-help-to-smooth-player-update-based-on-v-sync/69334 "2026-09-18T14:33:54Z")

</div>

Hello, i need some help I’m using SDL3 to make a space shooter, just for fun not profit, i make the player move left or right up/down according to the position of the mouse int player\_speed = 5; SDL\_AppResult SDL\_AppIte…

---

## [Migration from SDL1.2 to SDL3](https://discourse.libsdl.org/t/migration-from-sdl1-2-to-sdl3/69065)

<div class="topic-metadata">

**Author:** [@Midhun](https://discourse.libsdl.org/u/Midhun)\
**Replies:** 3\
**Last updated:** [August 19, 2026, 6:36am UTC](https://discourse.libsdl.org/t/migration-from-sdl1-2-to-sdl3/69065 "2026-08-19T06:36:59Z")

</div>

Iam working on a game written in SDL1.2 called the tuxtype so i wish to move it to the next sdl version. So if i move to the sdl3 will there be issues? or should i choose sdl2 ? or should i move directly to sdl3 ?

---

## [Single Game Instancing](https://discourse.libsdl.org/t/single-game-instancing/65993)

<div class="topic-metadata">

**Author:** [@Sward](https://discourse.libsdl.org/u/Sward)\
**Replies:** 4\
**Last updated:** [July 31, 2026, 4:09pm UTC](https://discourse.libsdl.org/t/single-game-instancing/65993 "2026-07-31T16:09:09Z")

</div>

What do you use in order to guarantee that only one instance of your game is running? I see programs like Gnome-Mahjong and Firefox Browser both have the ability to intercept the launch of another instance of their pro…

---

## [Efficient object properties](https://discourse.libsdl.org/t/efficient-object-properties/68886)

<div class="topic-metadata">

**Author:** [@krapp](https://discourse.libsdl.org/u/krapp)\
**Replies:** 3\
**Last updated:** [July 24, 2026, 2:51am UTC](https://discourse.libsdl.org/t/efficient-object-properties/68886 "2026-07-24T02:51:35Z")

</div>

I have an implementation of a tileset using SDL3 and the Tiled API. I’m using the properties API to implement properties. The tileset and individual tiles (and objects and lots of other things) can have their own propert…

---

## [Birdy wants crisps 🐦](https://discourse.libsdl.org/t/birdy-wants-crisps/68027)

<div class="topic-metadata">

**Author:** [@xolatgames](https://discourse.libsdl.org/u/xolatgames)\
**Replies:** 1\
**Last updated:** [July 20, 2026, 3:38pm UTC](https://discourse.libsdl.org/t/birdy-wants-crisps/68027 "2026-07-20T15:38:17Z")

</div>

Hello everyone! :victory\_hand: I’m not so much newcommer, we already have seen each other at some time :slightly\_smiling\_face:, but I’m will glad to see you again :grin: I came here to tell you about my game …

---

## [SDL\_DialogFileCallback and multithreading](https://discourse.libsdl.org/t/sdl-dialogfilecallback-and-multithreading/68878)

<div class="topic-metadata">

**Author:** [@UbuntuJackson](https://discourse.libsdl.org/u/UbuntuJackson)\
**Replies:** 8\
**Last updated:** [July 19, 2026, 8:52am UTC](https://discourse.libsdl.org/t/sdl-dialogfilecallback-and-multithreading/68878 "2026-07-19T08:52:49Z")

</div>

Hello, I read about SDL\_ShowOpenFileDialog and I saw the following piece of information about the callback you pass to it: “Note that the callback may be called from a different thread than the one the function was invo…

---

## [Tons of undefined stuff when trying to compile SDL3\_mixer](https://discourse.libsdl.org/t/tons-of-undefined-stuff-when-trying-to-compile-sdl3-mixer/67672)

<div class="topic-metadata">

**Author:** [@UbuntuJackson](https://discourse.libsdl.org/u/UbuntuJackson)\
**Replies:** 2\
**Last updated:** [July 18, 2026, 10:58pm UTC](https://discourse.libsdl.org/t/tons-of-undefined-stuff-when-trying-to-compile-sdl3-mixer/67672 "2026-07-18T22:58:24Z")

</div>

Hello, I tried a some troubleshooting, making sure the submodules in SDL3\_mixer are initialised, and then I tried to just compile it and include it in my project. I’m on Linux Mint, 22.2. However there’s all this stuff w…

---

## [Can SDL's storage API parse files to/from class or struct?](https://discourse.libsdl.org/t/can-sdls-storage-api-parse-files-to-from-class-or-struct/68798)

<div class="topic-metadata">

**Author:** [@SCSR](https://discourse.libsdl.org/u/SCSR)\
**Replies:** 1\
**Last updated:** [July 10, 2026, 7:54am UTC](https://discourse.libsdl.org/t/can-sdls-storage-api-parse-files-to-from-class-or-struct/68798 "2026-07-10T07:54:57Z")

</div>

I was thinking of holding the currently loaded save data in a class or struct. I am wondering if the storage API is able to do the parsing on it’s own when I read or write the save data or if I have to parse it manually …

---

## [why is the lazer not appearing](https://discourse.libsdl.org/t/why-is-the-lazer-not-appearing/68727)

<div class="topic-metadata">

**Author:** [@Al881](https://discourse.libsdl.org/u/Al881)\
**Replies:** 6\
**Last updated:** [July 8, 2026, 8:05am UTC](https://discourse.libsdl.org/t/why-is-the-lazer-not-appearing/68727 "2026-07-08T08:05:59Z")

</div>

hello I am a c++ and sdl2 noob and I have succssfully managed to combine code from lazy foo and parallel realities. I get a successful compilation but the lazer does not appear when the ctrl key is pressed. Can anyone he…

---

## [why is the lazer not firing?](https://discourse.libsdl.org/t/why-is-the-lazer-not-firing/68589)

<div class="topic-metadata">

**Author:** [@Al881](https://discourse.libsdl.org/u/Al881)\
**Replies:** 1\
**Last updated:** [June 20, 2026, 1:47pm UTC](https://discourse.libsdl.org/t/why-is-the-lazer-not-firing/68589 "2026-06-20T13:47:20Z")

</div>

I have hacked together examples from lazy foo and parallel realities to try and make a game. I have a ship and moving background from lazy foo. I have a lazer from parallel realities. The ship and background are fine but…

---

## [why is my window not displaying a picture?](https://discourse.libsdl.org/t/why-is-my-window-not-displaying-a-picture/68552)

<div class="topic-metadata">

**Author:** [@Al881](https://discourse.libsdl.org/u/Al881)\
**Replies:** 1\
**Last updated:** [June 17, 2026, 8:12pm UTC](https://discourse.libsdl.org/t/why-is-my-window-not-displaying-a-picture/68552 "2026-06-17T20:12:59Z")

</div>

Hi I am a c++ sdl2 noob and I am trying to hack together a couple of online tutorials to make a game. Can anyone help me fix this code to display a picture? Thanks. //Using SDL, SDL\_image, standard IO, vectors, and st…

---

## [What is the right logic to get the bullet to fire](https://discourse.libsdl.org/t/what-is-the-right-logic-to-get-the-bullet-to-fire/68530)

<div class="topic-metadata">

**Author:** [@Al881](https://discourse.libsdl.org/u/Al881)\
**Replies:** 1\
**Last updated:** [June 16, 2026, 2:20pm UTC](https://discourse.libsdl.org/t/what-is-the-right-logic-to-get-the-bullet-to-fire/68530 "2026-06-16T14:20:31Z")

</div>

Hi Im a beginner in c++ and sdl2. Im trying to make a side scrolling space shooter. Ive got a ship moving around on a scrolling background but I cant get the lazer to fire when I press the space bar. Can anyone show me t…

---

## [how do I make the lazer move all the way across the screen?](https://discourse.libsdl.org/t/how-do-i-make-the-lazer-move-all-the-way-across-the-screen/68447)

<div class="topic-metadata">

**Author:** [@Al881](https://discourse.libsdl.org/u/Al881)\
**Replies:** 1\
**Last updated:** [June 10, 2026, 4:03pm UTC](https://discourse.libsdl.org/t/how-do-i-make-the-lazer-move-all-the-way-across-the-screen/68447 "2026-06-10T16:03:01Z")

</div>

Hello Im a newb to c++ and sdl2. Im trying to write a program that makes a lazer move all the way across the screen when I press the space bar. At the moment movement stops if I let go of the space bar. How do I make it …

---

## [Scrolling PNG background not working](https://discourse.libsdl.org/t/scrolling-png-background-not-working/67611)

<div class="topic-metadata">

**Author:** [@Al881](https://discourse.libsdl.org/u/Al881)\
**Replies:** 4\
**Last updated:** [May 20, 2026, 1:16pm UTC](https://discourse.libsdl.org/t/scrolling-png-background-not-working/67611 "2026-05-20T13:16:16Z")

</div>

I am a noob to linux, c++ and sdl2. I a trying to write a game. I am starting with a scrolling background. I got the code of google gemini. When I run it I just get a transparent window instead of a scrolling background.…

---

## [Building SDL3 applications on Windows with CMake](https://discourse.libsdl.org/t/building-sdl3-applications-on-windows-with-cmake/66908)

<div class="topic-metadata">

**Author:** [@Edge-One](https://discourse.libsdl.org/u/Edge-One)\
**Replies:** 4\
**Last updated:** [April 27, 2026, 10:00am UTC](https://discourse.libsdl.org/t/building-sdl3-applications-on-windows-with-cmake/66908 "2026-04-27T10:00:40Z")

</div>

Hi, I can’t figure out how to build a basic SDL3 application using CMake. Can anybody help? Thanks.

---

## [SDL\_RenderPresent latency and frame stuttering when running background automation environments](https://discourse.libsdl.org/t/sdl-renderpresent-latency-and-frame-stuttering-when-running-background-automation-environments/67430)

<div class="topic-metadata">

**Author:** [@bonnie868](https://discourse.libsdl.org/u/bonnie868)\
**Replies:** 0\
**Last updated:** [April 24, 2026, 7:42pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-latency-and-frame-stuttering-when-running-background-automation-environments/67430 "2026-04-24T19:42:42Z")

</div>

Hi everyone, I’m currently developing a cross-platform 2D engine using SDL2/SDL3, but I’ve hit a strange performance snag where my frame times become highly inconsistent whenever I have my automation tools active in the…

---

## [use own main func?](https://discourse.libsdl.org/t/use-own-main-func/67310)

<div class="topic-metadata">

**Author:** [@monkee](https://discourse.libsdl.org/u/monkee)\
**Replies:** 1\
**Last updated:** [April 19, 2026, 12:29am UTC](https://discourse.libsdl.org/t/use-own-main-func/67310 "2026-04-19T00:29:46Z")

</div>

Hi, How to use my own main() from stdio.h instead of sdl3 conflicting, how can it be done? tried to do so from an example, helloc: #define SDL\_MAIN\_USE\_CALLBACKS 1 /\* use the callbacks instead of main() \*/ #include "…

---

## [SDL3 GPU这个场景怎么办](https://discourse.libsdl.org/t/sdl3-gpu/66683)

<div class="topic-metadata">

**Author:** [@zhaoxue](https://discourse.libsdl.org/u/zhaoxue)\
**Replies:** 0\
**Last updated:** [March 12, 2026, 6:37pm UTC](https://discourse.libsdl.org/t/sdl3-gpu/66683 "2026-03-12T18:37:28Z")

</div>

场景是这样的：每加载一个绘制资源，就需要向GPU Buffer传输一些辅助绘制的数据，这个数据是加载一次后，一直常驻在GPU Buffer，直到资源销毁时才会销毁，着色器读取这个GPU Buffer进行辅助绘制，问题来了：怎么样传输到GPU Buffer的效果最好？我需要的是尽量不影响主线程绘制的情况下加载资源，我想到了以下方案：1、后台线程对每个资源都申请一个GPU Buffer进行上传，这样的话主线程可以直接绘制，不参与上传，但是这…

---

## [Separate fps and tick rate. How to do that correctly?](https://discourse.libsdl.org/t/separate-fps-and-tick-rate-how-to-do-that-correctly/66361)

<div class="topic-metadata">

**Author:** [@gera](https://discourse.libsdl.org/u/gera)\
**Replies:** 3\
**Last updated:** [March 2, 2026, 5:48pm UTC](https://discourse.libsdl.org/t/separate-fps-and-tick-rate-how-to-do-that-correctly/66361 "2026-03-02T17:48:50Z")

</div>

I’m trying to have tick rate and fps configurable via constants. Right now I have these two coupled together, so if I double the fps i would also have double the ticks per second. How do I have tick rate separate from fr…

---

## [How to load a texture in SDL2 e convert it to textureid to ImGui?](https://discourse.libsdl.org/t/how-to-load-a-texture-in-sdl2-e-convert-it-to-textureid-to-imgui/66441)

<div class="topic-metadata">

**Author:** [@samleo](https://discourse.libsdl.org/u/samleo)\
**Replies:** 0\
**Last updated:** [February 27, 2026, 5:35pm UTC](https://discourse.libsdl.org/t/how-to-load-a-texture-in-sdl2-e-convert-it-to-textureid-to-imgui/66441 "2026-02-27T17:35:20Z")

</div>

Hi! I’ve searched to a example but in the doc of ImGui is showing something with stdb and SDL2, but I want only use SDL2+ImGui. So, can any one give me a example of how to convert a SDL\_Texture or Surface to TexturID t…

---

## [New SDL Game Goes Live As Linux Flatpak On Flathub Distribution Site!](https://discourse.libsdl.org/t/new-sdl-game-goes-live-as-linux-flatpak-on-flathub-distribution-site/66276)

<div class="topic-metadata">

**Author:** [@savantsavior](https://discourse.libsdl.org/u/savantsavior)\
**Replies:** 0\
**Last updated:** [February 17, 2026, 6:33pm UTC](https://discourse.libsdl.org/t/new-sdl-game-goes-live-as-linux-flatpak-on-flathub-distribution-site/66276 "2026-02-17T18:33:39Z")

</div>

---

## [SDL3 custom bitmap font transparency](https://discourse.libsdl.org/t/sdl3-custom-bitmap-font-transparency/66093)

<div class="topic-metadata">

**Author:** [@paulross](https://discourse.libsdl.org/u/paulross)\
**Replies:** 3\
**Last updated:** [February 8, 2026, 7:46pm UTC](https://discourse.libsdl.org/t/sdl3-custom-bitmap-font-transparency/66093 "2026-02-08T19:46:12Z")

</div>

Hello! I’m trying to load a bitmap font from a PGM grayscale file, which was generated by my own tool using stb\_truetype. The file is good because I can preview it on my file explorer. Now Im trying to load this as a te…

---

## [SDL leaks memory, as reported by valgrind](https://discourse.libsdl.org/t/sdl-leaks-memory-as-reported-by-valgrind/25722)

<div class="topic-metadata">

**Author:** [@zzzhhh](https://discourse.libsdl.org/u/zzzhhh)\
**Replies:** 7\
**Last updated:** [January 31, 2026, 5:42pm UTC](https://discourse.libsdl.org/t/sdl-leaks-memory-as-reported-by-valgrind/25722 "2026-01-31T17:42:17Z")

</div>

Even the simplest SDL program leaks memory, as reported by valgrind. This is the program: #include "SDL.h" int main(int argc, char\* args\[\]) { SDL\_Init(SDL\_INIT\_VIDEO); SDL\_Quit(); return 0; } This is the o…

---

## [C4droid apk export macht "hässliches setup"](https://discourse.libsdl.org/t/c4droid-apk-export-macht-hassliches-setup/65621)

<div class="topic-metadata">

**Author:** [@Patty1991](https://discourse.libsdl.org/u/Patty1991)\
**Replies:** 0\
**Last updated:** [January 10, 2026, 1:45am UTC](https://discourse.libsdl.org/t/c4droid-apk-export-macht-hassliches-setup/65621 "2026-01-10T01:45:46Z")

</div>

Hallo, kann mir wer sagen was ich falsch mache beim apk export? Alles funktioniert aber Installation würde kein normaler android User hinnehmen oder liegt das am Compiler selbst, dass der sich mit der version Andro.16 b…

---

## [need some advice on tilemap+sprites performance](https://discourse.libsdl.org/t/need-some-advice-on-tilemap-sprites-performance/64523)

<div class="topic-metadata">

**Author:** [@oriwhu](https://discourse.libsdl.org/u/oriwhu)\
**Replies:** 6\
**Last updated:** [January 6, 2026, 10:21am UTC](https://discourse.libsdl.org/t/need-some-advice-on-tilemap-sprites-performance/64523 "2026-01-06T10:21:04Z")

</div>

I’m developing a game demo using sdl2 (using most recent version I think). The map consists of a lot of 40x40 tiles. when player moves around, the map scrolls. the player and monsters are all animated sprites with multip…

---

## [how do i make a pixel perfect button](https://discourse.libsdl.org/t/how-do-i-make-a-pixel-perfect-button/65501)

<div class="topic-metadata">

**Author:** [@nerdiest\_cat](https://discourse.libsdl.org/u/nerdiest_cat)\
**Replies:** 26\
**Last updated:** [January 5, 2026, 4:40pm UTC](https://discourse.libsdl.org/t/how-do-i-make-a-pixel-perfect-button/65501 "2026-01-05T16:40:31Z")

</div>

making normal rectangular buttons is good but i want something more precise because if i have a shape that wraps around another the normal rectangle method says that you pressed both shapes when you pressed one or the ot…

[Next page](https://discourse.libsdl.org/c/game-development/7.md?page=1)
