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_4

4. Mouse, and if

Will Briggs1 
(1)
Lynchburg, VA, USA
 

In this chapter we’ll get mouse input, and the art of making decisions, computer style.

Mouse functions

Example 4-1 shows a program to detect where you clicked the mouse and report the result. Amazing, huh? Thus, we introduce three mouse functions: SSDL_GetMouseX, SSDL_GetMouseY, and SSDL_WaitMouse.
//Program to get a mouse click, and report its location
//            -- from _C++ for Lazy Programmers_
#include "SSDL.h"
int main(int argc, char** argv)
{
    sout << "Click the mouse and we'll see where you clicked.\n";
    //Get the mouse click
    SSDL_WaitMouse();                   //wait for click...
    int ...
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