There are many way by which you can learn OpenGL. Try Book from Edward Angle. You can also get many simple OpenGL tutorials in this blog as well.
Linked list is tough concept in C/C++. Today we are going to talk about it. There are mainly two kind of linked list -
- Singly Linked list - The linked list that only one link node.
- Doubly Linked list - The linked list with two link node.
In the previous post we had already talk about the Singly Linked List, in this
OpenGL Tutorial post we are going to learn about
C/C++ For Doubly Linked List.
Operation on Doubly Linked List
Like Singly Linked List many operations can be done on doubly linked list at both end of the node(both link). These are few doubly linked list operation which is given below –
- Creation
- Insert at Starting
- Insert at left
- Insert at Right
- Insert Front
- Insert Rear
- Delete at Left
- Delete at Right
- Delete Front
- Delete Rear
- Display
Before Going to the graphical OpenGL program for the Doubly Linked List, kindly refer to C program for Doubly Linked it first. If you understand it, then only go for opengl program.
Similar to the C++ Program, the Graphics program for Doubly Linked list also declare struct for three nodes –
info, rlink, llink. Similar to
Singly Linked List this program also takes input in different window while display in different window.
To display the node three simple rectangle has being drawn. These are linked with the line to other elements in the list. Drawing this in OpenGL is quite easy but need to understand the concept of C, so before going to this OpenGL tutorial program better read C program first.
Different menu has is given to user to choose the operation on the doubly linked list. Just need to right click and choose the Option. While Doing this kindly do slowly and do not do rubbish work else it might not work for you. This is not that effective graphics program but we can make it one window workable program as future enhancement.
Download Source code for
Doubly Linked List OpenGL Tutorial Program