The Easiest Way to Render Text using SDL2
Handmade Games
This is the easiest way I have found to render text using SDL2.
The font used in my game is the Terminal font, and the game is written using the Odin programming language.
Be sure to include these in the root folder of your project:
SDL2 - https://github.com/odin-lang/Odin/blob/master/vendor/sdl2/SDL2.dll sdl2_TFF.dll - https://github.com/odin-lang/Odin/blob/master/vendor/sdl2/ttf/SDL2_ttf.lib ZLIB1.dll - https://github.com/odin-lang/Odin/blob/master/vendor/sdl2/ttf/zlib1.dll
If you want to see this code in action, you can check out the Space Shooter Tutorial at this commit :: https://github.com/patrickodacre/odin-space-shooter/commit/c63ca06ee28ef2a042b8f72d988166e3ce23170b
#gamedev #sdl2 #indiedev #learntocode #codenewbie #odinlang ... https://www.youtube.com/watch?v=JX4Wvi6E8jQ
32243904 Bytes