I was checking this out:

, and they start their mouseHandling-chapter
telling me to use this code

bool lbuttonDown = false;

bool init()
	return true;

void display()


And I think it just doesn’t make any sense:
Why should “display” be empty?
Why is this init thing return true always?

KR // OGforever

The answer is in the previous tutorials.

init returns a bool to indicate whether the init function succeeded or not, and an empty init function obviously can’t fail, so it returns true.

display is empty because nothing needs to be displayed.


Now I’m trying to make the program to react to a click on the right mousebutton. But nothing happens…Why?

</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
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;


/* Clear the screen */

/* Begin drawing 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 &lt; w; x++)
    for(y = 0; y &lt; h; y++)
        if(x % 5 == 0

The code you posted is not complete.