Render Static Text with SDL2 in Less Than 5 Minutes
Handmade Games
Rendering static text with SDL2 is quite simple, and it only takes a few minutes to get everything up and running.
š» The Code: https://github.com/patrickodacre/sdl2-odin-examples/tree/master/render-static-text
š¾ The Written Guide: https://github.com/patrickodacre/sdl2-odin-examples/tree/master/render-static-text#readme
If you'd like to keep up to date with all my SDL2 Tutorials I recommend you download or clone the entire repo. You can navigate to any folder and find everything you need to run that specific example.
00:00 - Start 00:05 - What is Static Text? 00:17 - Text to SDL_Surface to SDL_Texture 00:45 - Import SDL TTF and Initialize 01:04 - Opening a Font 01:25 - Creating our Textures 01:34 - Scaling our Textures 01:49 - TTF RenderText_Solid 02:10 - Surface to Texture 02:21 - Destination SDL_Rect 02:34 - Default Params with Odin 02:44 - Text Struct 03:00 - Rendering our Static Text 03:06 - Texts Stored in an Array 03:26 - RenderCopy 03:32 - Changing Font Size 04:06 - We Must Recreate Textures After Font Size Change 04:26 - More About Rendering Dynamic Text
š§āāļø All code is written in the Odin programming language. Learn more about Odin here http://odin-lang.org/
#gamedev #sdl2 #odinlang #tutorial #programming #coding #codenewbie #learntocode ... https://www.youtube.com/watch?v=tsyYXuWapsU
22020315 Bytes