Published: September 8, 2008
By Richard G. Baldwin
File: Allegro00120PracticeTest
1. True or False: When calling the function shown below to create a graphics window on the screen, you can cause the dimensions of the window to be anything that you want provided that it will fit within the overall dimensions of the screen on all Allegro-compatible computers.
set_gfx_mode(GFX_AUTODETECT_WINDOWED,400,400,0,0); |
2. True or False: You can cause an Allegro graphics window to have a solid background color by calling the function named clear_to_color.
3. True or False: When calling the function shown below to create a graphics window on the screen, the horizontal dimension that you specify must be divisible by four on some Allegro-compatible computers.
set_gfx_mode(GFX_AUTODETECT_WINDOWED,400,400,0,0); |
4. True or False: You can cause an Allegro graphics window to have a solid white background color by calling the function named clear_to_white.
5. True or False: The most appropriate way to control the color of an individual pixel in an Allegro graphics window is to call the function named setPixel.
6. True or False: The most appropriate way to control the color of an individual pixel in an Allegro graphics window is to call the function named putpixel.
7. True or False: The most appropriate way to control the color of an individual pixel in an Allegro graphics window is to draw an extremely small colored circle at the location of the pixel.
8. True or False: When you call the Allegro circle function to draw a circle, you specify the coordinates of two diagonal corners of a rectangle in which the circle will be inscribed. If the rectangle is not a square, the result will be an ellipse.
9. True or False: When you call the Allegro circle function to draw a circle, you specify the coordinates of the center of the circle along with the radius of the circle and some other parameters as well.
10. True or False: The floodfill function shown below cannot be used to fill an area between two previously drawn geometric objects (such as concentric circles) with a solid color.
floodfill(screen,5,200,makecol(0,0,255)); |
11. True or False: The behavior of the floodfill function is similar to the behavior of similar features in paint programs, filling the entire area around a point that is inside a closed contour with a specified color.
12. True or False: The Allegro function that is used to draw a circle that is filled with a specified color is named filledCircle.
13. True or False: The Allegro function that is used to draw a circle that is filled with a specified color is named circlefill.
14. True or False: When you call the rect function shown below to draw a rectangle, among other things, you specify the coordinates of the upper-left corner of the rectangle along with the width and the height of the rectangle.
//Draw an empty blue rectangle. rect(screen,150,75,250,125,makecol(0,0,255)); |
15. True or False: When you call the rect function shown below to draw a rectangle, among other things, you specify the coordinates of two diagonal corners of the rectangle.
//Draw an empty blue rectangle. rect(screen,150,75,250,125,makecol(0,0,255)); |
16. True or False: The Allegro function that is used to draw a rectangle that is filled with a specified color is named filledRect.
17. True or False: The Allegro function that is used to draw a rectangle that is filled with a specified color is named rectfill.
18. True or False: When you call the line function to draw a straight line, among other things, you specify the coordinates of the end points of the line.
19. True or False: When you call the line function to draw a straight line, among other things, you specify the coordinates of the beginning point of the line and the length of the line.
20. True or False: The Allegro function named triangle draws a triangle that is filled with a specified color.
21. True or False: The Allegro function named triangle draws an empty triangle with an outline that is a specified color.
Copyright 2008, Richard G. Baldwin.
Reproduction in whole or in part in any form or medium
without express written permission from Richard Baldwin is prohibited.
Richard has participated in numerous consulting projects and he frequently provides onsite training at the high-tech companies located in and around Austin, Texas. He is the author of Baldwin's Programming Tutorials, which have gained a worldwide following among experienced and aspiring programmers. He has also published articles in JavaPro magazine.
In addition to his programming expertise, Richard has many years of practical experience in Digital Signal Processing (DSP). His first job after he earned his Bachelor's degree was doing DSP in the Seismic Research Department of Texas Instruments. (TI is still a world leader in DSP.) In the following years, he applied his programming and DSP expertise to other interesting areas including sonar and underwater acoustics.
Richard holds an MSEE degree from Southern Methodist University and has many years of experience in the application of computer technology to real-world problems.
Copyright 2008, Richard G. Baldwin. Reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.
Richard Baldwin is a college professor (at Austin Community College in Austin, TX) and private consultant whose primary focus is a combination of Java, C#, and XML. In addition to the many platform and/or language independent benefits of Java and C# applications, he believes that a combination of Java, C#, and XML will become the primary driving force in the delivery of structured information on the Web.Richard has participated in numerous consulting projects and he frequently provides onsite training at the high-tech companies located in and around Austin, Texas. He is the author of Baldwin's Programming Tutorials, which have gained a worldwide following among experienced and aspiring programmers. He has also published articles in JavaPro magazine.
In addition to his programming expertise, Richard has many years of practical experience in Digital Signal Processing (DSP). His first job after he earned his Bachelor's degree was doing DSP in the Seismic Research Department of Texas Instruments. (TI is still a world leader in DSP.) In the following years, he applied his programming and DSP expertise to other interesting areas including sonar and underwater acoustics.
Richard holds an MSEE degree from Southern Methodist University and has many years of experience in the application of computer technology to real-world problems.
-end-