Search Projects

Tuesday, January 27, 2015

Draw Squares in OpenGL with Size Option and Sound

 Squares can be easily easily drawn in OpenGL, using the free open computer graphics libraries.  OpenGL graphics had alot of potential ways to do things. You can go with traditional Method or choose better innovative one.

Today we are going to see a computer graphics c++ program in which we are going to draw squares. Previously we have seen how to draw a circle in OpenGL, now it time to draw square in OpenGL. The program which we are going to see not only draw square but allow to increase or decrease the size of the squares. There is an additional component added to it, that the sound. The squares are formed with left click of mouse while right click give option for increment/decrement size. Sound is auto play when ever squares are formed.

Program is not much lengthy and also very much easy to understand. There is draw_square function in which the functionality  has been defined. It also contain the codes for the sound play. Rest of the program contains the same hello world stuffs (primary codes).

If anyone have question with respect to, how to make changes in the code, try to post it with your comments. Don't forget to mention how you like this post. Also tell how you can use these codes to develop your own project.

Download