![]() If you have Cygwin Xfree86 environment with OpenGL setup on your computer, you can compile and execute the program using the command lines below: c++ -o paint paint.cpp -lglut32 -1glu32 -lopengi32 Center> paint Center> // Student Name: // Student ID: // paint.cpp #define LINE 1 #define RECTANGLE 2 #define TRIANGLE 3 #define POINTS 4 #define TEXT 5 #include #include // global variables GLsizei wh = 500, ww = 500 // initial window size GLfloat size = 3.0 // half side length of square int draw_mode=0 // drawing mode int rx, rv. c) fill menu with two entries "Fill on” and “Fill off". ![]() b) pixel menu with two entries "Increase pixel size" and "Decrease pixel size”. ![]() Create your right menu containing the following submenus and main entries: a) color menu with eight entries "Red", "Green”, “Blue”, “Cyan”, “Magenta", "Yellow", "White”, and “Black”. Write function "myinit” of your own where you must a) setup viewport, b)set clear color to black and clear window, and c) setup matrix mode and viewing. Using the Code The source code includes a control named GLCanvas2D based on. Read the program carefully and complete the source code by: 1. In this article, I will try to explain how I created a control utilizing OpenGL for a 2D shape drawing. The program can also accept keyboard input and display the text on the screen when work in text mode. Using the complete program, one can draw line segments, rectangles, triangles, pixels with specified color. ![]() Transcribed image text: Following is an OpenGL program named paint.cpp.
0 Comments
Leave a Reply. |