© Will Briggs 2019
Will BriggsC++ for Lazy Programmershttps://doi.org/10.1007/978-1-4842-5187-4_2

2. Images and Sound

Will Briggs
(1)
Lynchburg, VA, USA
 
Enough of these line drawings: let’s have something pretty.

Images and changing window characteristics

Let’s start by displaying an image, using the code in Example 2-1.
//Program to show an image on the screen
//            -- from _C++ for Lazy Programmers_
//Simple version
#include "SSDL.h"
int main (int argc, char **argv)
{
      //Show image
      const SSDL_Image BEACH = SSDL_LoadImage ("beach.jpg");
      SSDL_RenderImage(BEACH, 0, 0);
      SSDL_WaitKey();
      return 0;
}
Example 2-1
Displaying an image
This program loads an image called beach.jpg and shows it at location 0, 0 on the screen.
That’s it. ...

Get C++ for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.