Programming and Graphics
8.2 Graphics events 269 void quit(unsigned char key, int x, int y) { cout << "Key: " << key << " pressed" < ...
270 Introduction to C++ Programming and Graphics //--- keyboard: void keyboard(unsigned char key, int x, int y) { cout <<" ...
8.2 Graphics events 271 This callback specifies the function to be executed when a mouse button is clicked: Ifbtn=GLUTLEFTBUTTO ...
272 Introduction to C++ Programming and Graphics #include <freeglut.h> using namespace std; void blank(); void print(int); ...
8.2 Graphics events 273 Animation To perform animation, we use two memory spaces holding the graphics, one called theback buffer ...
274 Introduction to C++ Programming and Graphics } //--- Draw a circle: void drawCircle() { glBegin(GLLINELOOP); for (int i=0; i ...
8.2 Graphics events 275 To control the animation frequency, we use theglutTimerFunccallback. The following code contained in the ...
276 Introduction to C++ Programming and Graphics void disk() { glClear(GLCOLORBUFFERBIT|GLDEPTHBUFFERBIT); glColor3f(0.8,0.5,0.2 ...
8.2 Graphics events 277 #include <iostream> #include <cmath> #include <freeglut.h> using namespace std; void p ...
278 Introduction to C++ Programming and Graphics /*---------- resize ---------------------*/ void resize(int w, int h) { //--- P ...
8.3 Drop-down menus 279 (a)(b) Figure 8.2.2 The same Pac-Man in the original and resized window. Problems 8.2.1. Write aGlutprog ...
280 Introduction to C++ Programming and Graphics //--- main: int main(int argc, char **argv) { glutInit(&argc, argv); glutIn ...
8.4 GUI programming withGlui 281 glutAddMenuEntry("Quit", 0); // Create an entry glutAttachMenu(GLUTLEFTBUTTON);// respond to th ...
282 Introduction to C++ Programming and Graphics Figure 8.3.1 A drop-down menu generated by GLUT. Clicking on an option changes ...
8.5 GUI programming withGtk+ 283 Figure 8.4.1 A GUI produced byGlui. Data can be entered in the checkbox. #include "glui.h" usin ...
284 Introduction to C++ Programming and Graphics To develop an application, we must link the source code with theGtk+ header and ...
8.5 GUI programming withGtk+ 285 Figure 8.5.1 A window produced by the graphics toolkit GTK+. When the button is clicked, the wi ...
286 Introduction to C++ Programming and Graphics the graphics display by entering the main loop. If we do not enter the main loo ...
Using Matlab^9 Matlabis a software product for interactive numerics and graphics applica- tions produced byThe Mathworkscorporat ...
288 Introduction to C++ Programming and Graphics In this chapter, we explain howMatlabcan be called from C++ code for the purpos ...
«
10
11
12
13
14
15
16
17
18
19
»
Free download pdf