Skip to Content
C++ for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners
book

C++ for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners

by Will Briggs
October 2019
Beginner
655 pages
12h 5m
English
Apress
Content preview from C++ for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners
© Will Briggs 2019
W. BriggsC++ for Lazy Programmershttps://doi.org/10.1007/978-1-4842-5187-4_2

2. Images and Sound

Will Briggs1 
(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.

C++ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++20 for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners

C++20 for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners

Will Briggs

Publisher Resources

ISBN: 9781484251874Purchase LinkPublisher Website