Thanks…
Now I’m trying to make the program to react to a click on the right mousebutton. But nothing happens…Why?
KR// OG
</font><blockquote><font size=“1” face=“Verdana, Arial”>code:</font><hr /><pre style=“font-size:x-small; font-family: monospace;”>#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include “givengui.h”
using namespace std;
bool lbuttonDown = false;
bool init() ;
void mouse(int button, int state, int x, int y) ;
/******** Callbacks called by the GUI ********/
void primitiveMode(int primitive)
{
printf("Primitive %s selected
", primitive == LINE ? “line” : “circle”);
}
void antialias(int doAA)
{
printf("Anti-aliasing %s
", doAA ? “enabled” : “disabled”);
}
void clearScreen()
{
printf("Clear screen
");
}
void circleMode(int mode, int segments)
{
if(mode == MIDPOINT)
printf("Circle mode set to midpoint
");
else
printf("Circle mode set to polygon with %d segments
", segments);
}
/********* End GUI callbacks *********/
/********* GLUT callbacks **********/
void display()
{
/ Draw a grid on the screen */
int x, y, w, h;
w = glutGet(GLUT_WINDOW_WIDTH);
h = glutGet(GLUT_WINDOW_HEIGHT);
/* Clear the screen */
glClear(GL_COLOR_BUFFER_BIT);
/* Begin drawing points */
glBegin(GL_POINTS);
/* Set color to light grey */
glColor3f(0.7, 0.7, 0.7);
/* Loop over all points and set those that are on a multiple of five in
either coordinate to grey, this will give a 5x5 grid */
for(x = 0; x < w; x++)
for(y = 0; y < h; y++)
if(x % 5 == 0