Link List with Graphics For this project you will be creating a link list and drawing the nodes to the screen. Each node will be drawn as a rectangle. Each node will have the ability to link to at least 4 other nodes. Create a SDL2 project to open a graphics window for this assignment. Set the background color to something dull. Create a Node structure as follows to create the nodes for the link list. Node: • rectangle SDL_Rect • color SDL_Color or rgb values, your choice • 4 Node pointers (links) • draw() Draws a solid (filled) rectangle • Node() Add arguments to your constructor(s) as you see fit Before your main loop create 5 Node objects on the heap. Link the nodes to each other in the pattern shown below. Begin by linking each node to the node adjacent to it. The center node will be linked to all 4 surrounding nodes. Then link each outer node to the node on the opposite side, creating a wrap￾around effect as indicated by the green arrows. Create a Node pointer called current and set it to one of the five nodes. In the main loop collect input from the user using an event switch. Implement keyboard controls using the WASD keys to change the current pointer to one of the linked nodes. Example, if the current node is the center node, then pressing W will change it to the left of the center, pressing W again will change it to the node right of the center. Call draw() on all of the nodes. Finally, draw a rectangle around the current node using a contrasting color. Pressing the Esc key should free up all memory and end the program. Tips: • Follow this assignment line by line, 1 step at a time. • The 4 pointers in the structure can be called whatever you want, but up, down, left and right may be most intuitive. • Initialize all pointers to nullptr. • Hard code the size of the rectangles in the Node constructor, but pass in the x and y location

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Link List with Graphics
For this project you will be creating a link list and drawing the nodes to the screen. Each node will be 
drawn as a rectangle. Each node will have the ability to link to at least 4 other nodes. Create a SDL2 
project to open a graphics window for this assignment. Set the background color to something dull. 
Create a Node structure as follows to create the nodes for the link list. 
Node:
• rectangle SDL_Rect
• color SDL_Color or rgb values, your choice
• 4 Node pointers (links)
• draw() Draws a solid (filled) rectangle
• Node() Add arguments to your constructor(s) as you see fit
Before your main loop create 5 Node objects on the heap. Link the nodes to each other in the pattern 
shown below. Begin by linking each node to the node adjacent to it. The center node will be linked to 
all 4 surrounding nodes. Then link each outer node to the node on the opposite side, creating a wrap￾around effect as indicated by the green arrows. 
Create a Node pointer called current and set it to one of the five nodes. 
In the main loop collect input from the user using an event switch. Implement keyboard controls using 
the WASD keys to change the current pointer to one of the linked nodes. Example, if the current node 
is the center node, then pressing W will change it to the left of the center, pressing W again will change 
it to the node right of the center. 
Call draw() on all of the nodes. 
Finally, draw a rectangle around the current node using a contrasting color. 
Pressing the Esc key should free up all memory and end the program. 
Tips:
• Follow this assignment line by line, 1 step at a time. 
• The 4 pointers in the structure can be called whatever you want, but up, down, left and right
may be most intuitive. 
• Initialize all pointers to nullptr.
• Hard code the size of the rectangles in the Node constructor, but pass in the x and y location

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY