diff --git a/_posts/2023-07-20-introduction-to-game-dev-with-sdl2.markdown b/_posts/2023-07-20-introduction-to-game-dev-with-sdl2.markdown index bab53553..ed34c82a 100644 --- a/_posts/2023-07-20-introduction-to-game-dev-with-sdl2.markdown +++ b/_posts/2023-07-20-introduction-to-game-dev-with-sdl2.markdown @@ -83,7 +83,11 @@ int main(int argc, char *argv[]) } ``` -This is the minimum you need to just open a window. ![screenshot of a basic windows opened by SDL using WSL2 on Windows for the GUI](https://lh5.googleusercontent.com/j8dGvVzUyGzsniCbhgZ5pPiIuupsbBPlMEuuS2bAnQwZeV12vmMBv1kYKFabNNS2cKlr9Un4VU3d23HF1OviIZGVQ_nsHwK5lHP6zffts3hiQK25MVNANbhJyJQXXHWsPkFiEepoVHq4hEPGBLS1Tnc) +This is the minimum you need to just open a window. + +

+ screenshot of a basic windows opened by SDL using WSL2 on Windows for the GUI +

> **Note**: On mac, applications and windows exist differently so you will notice it on your dock but most likely not pop-up. @@ -157,7 +161,9 @@ Make sure to add the header include for this library `#include SDL2/SDL_image.h> Looking into the code, there are a few things to remark. Images are loaded from disk and then converted into a texture. Everything we will display needs to be a texture. With the texture, we can query what has been filled and work backwards to center the image on the window. -![basic game window with a Conan 2.0 logo cube center](https://lh6.googleusercontent.com/IBeQZbK_cDHPTsGJ55Mj2TGHP9biAtxMO8hMIUAS7VfxcCLFMazXBTdeMevX1Pyq6wbPUr7ph25EbnPo6g4Z5Fs5dvmKJlQlXQFUyFb2pwMzaT1F91FBcS--JqF958Nco24wB-NxQKD3GD3zYW5bDSo) +

+ basic game window with a Conan 2.0 logo cube center +

Success! We have our Conan 2.0 logo rendered in our window. @@ -266,9 +272,6 @@ Now, we will need to replace some of the temporary code that pops the windows an We should have the basis for our game! - - Try moving the cube around and watch it step around! @@ -351,7 +354,9 @@ Now to call it during our game loop Just a note here, the helper function we wrote recreates the same texture on each iteration of the loop. This won't affect our example but if your game got complicated this could be quite inefficient. -![simple game windows from SDL with a cube that moves and text render from a texture using SDL_ttf and TTF](https://lh6.googleusercontent.com/nVXX3IaNu8kWxS4BF376QvikVQEjAAim6JJkCCFgXeaKL3mVBALylrBiyxCoUZ1opppG9AS2GDHWFXMO9-Xakbqnp3UBYu5DkjYmjm-b2HdN5s6S4fnHoaej3EoBnjzocS5U5X82pG8P2cTIpBxQIa8) +

+ simple game windows from SDL with a cube that moves and text render from a texture using SDL_ttf and TTF +

### 5: Cleaning up and freeing resources diff --git a/assets/post_images/2023-07-20/basic_windows.png b/assets/post_images/2023-07-20/basic_windows.png new file mode 100644 index 00000000..0546fc8c Binary files /dev/null and b/assets/post_images/2023-07-20/basic_windows.png differ diff --git a/assets/post_images/2023-07-20/final_image.png b/assets/post_images/2023-07-20/final_image.png new file mode 100644 index 00000000..b0521ba8 Binary files /dev/null and b/assets/post_images/2023-07-20/final_image.png differ diff --git a/assets/post_images/2023-07-20/logo_cube.png b/assets/post_images/2023-07-20/logo_cube.png new file mode 100644 index 00000000..5e36f626 Binary files /dev/null and b/assets/post_images/2023-07-20/logo_cube.png differ