- A note on grading, many people have been unclear on this. You will not turn in your source, and the grader will probably not ask to see it. Make it nice for your own sake, but grade-wise a working program is all that you need. In addition, you will be asked a few questions about the program. Everyone in your team will be expected to understand the basic structure of the program (mainly just the parts that you modified to complete the project).
- The class CImpBrush provides an abstract brush interface. You should subclass this and override the virtual methods to create your own brushes. There are seven important methods: BrushBegin, BrushMove, and BrushEnd are called when the left mouse button is pressed, dragged, and released, respectively. These should do the actual drawing. SelectBegin, SelectMove, and SelectEnd are similar, but use the right mouse button. BrushSelect is called whenever the brush is "picked up"; that is, whenever it is selected from the brushes dialog.
One instance of each brush type is created in CImpressionistDoc::OnNewDocument. When you add new brush types, you should modify this function to create the new brush object.
You are welcome to use the class wizard to generate all the new brush classes, but it may be easier to just copy DotBrush.cpp and DotBrush.h, change the class names, and add these files to the project.
- If some feature of OpenGL appears not to be working, make sure that it is enabled! OpenGL can use much faster rendering algorithms with some particular features turned off, so you must explcitly tell it when you want to use something with the glEnable and glDisable functions. (Extra Hint: This is important to keep in mind when impementing the opacity (alpha) control)
There is more information in the Intro to OpenGL.
- To modify the brush dialog window click on the ResourceView tab in the workspace window (View->Workspace) and go to Impressionist resources->Dialog->IDD_BRUSH. See the Intro to MFC for more info.
- Adding new sliders to the dialog box can be tricky, since they must be tied to static text items to display their values, and there is a special MFC message for handling dragging the slider. Look at the one slider that is already implemented, and duplicate its code in the CBrushDialog class.
- Other controls (such as checkboxes) are easier to add to the dialog box. Check out the Visual C++ documentation on CWnd::GetDlgItem for information on getting a pointer to the control's associated data structure.
- If you create combo box from scratch you may notice that it does not drop down as much as you like. In the dialog editor select the combo box and click on the down arrow. The frame around the combo box should get bigger. This defines how far down your combo box will drop. Stretch the frame down to increase the space in which the combo box can drop.
- It is common to lose the floating Controls window that is used to build dialogs. To get it back, first make sure the dialog you are editing is selected, then go to Tools->Customize->Toolbars and check Controls.
- If you ever make significant changes to your program and after recompiling run into strange problems, it is a good idea to recompile from scratch. This is a good thing to keep in mind no matter what programing environment you are working in. In Visual Studio, from the Build menu select Clean and then Update All Dependencies. You can then Build everything again. It will take a little while to recompile everything, but this will sometimes save you a lot of trouble.
- In the past we have experienced trouble with OpenGL and its interaction with the video hardware and drivers in the graphics lab. The major symptom is the Impressionist canvas becoming garbled when you move the window around the screen. You may also have to click twice to paint every stroke on the canvas. If you experience this problem, first close Impressionist. Then double click on the NetPower icon (it looks like a monitor) in the bottom right corner of the screen. Select Other OpenGL Applications, Sony 20" (Model GDM-20E03), and 1280x1024. After you are done, right click on the NetPower icon again and check that Other OpenGL Applications is selected. Finally, right click in blank area of the screen and select Properies. Change the video mode to something new (maybe 1280x1024 if that is not the current setting). Making some sort of change is all that seems to matter, you can always change back.