PDA

View Full Version : newbie : problems resizing window



sagilca
09-02-2001, 05:38 AM
Hi!!

I've written the source for a noughts and crosses game, but now i want the mouse detecting right the coordinates on resizing the window, an i don't know how.I'm a completely beginner and i have needed quite a lot of help so far.I copy some lines of the code...

void mouse(...)
{
int winx=350, winy=350;
...
if( (btn==GLUT_LEFT_BUTTON)&& state==GLUT_DOWN ){
scnx=((GLfloat)x/(GLfloat)winx)*5.0;
scny=((GLfloat)y/(GLfloat)winy)*5.0;
/*Passing from x,y to grids*/
if(scnx<2.0)
...}

void init(...){
...
glOrtho(0.0, 5.0, 0.0, 5.0, -1.0, 1.0);
...}