Hey guys. I ve a small problem with gstream and allegro's mouse controls. Whenever i use gstream i can't use the mouse controls. I m a complete newbie, so please tell me in simple terms what i m doing wrong
void simple()
{
int pos=20, x=20, y=20;
char one_line='\0';
for(int i=1,j=0;i<50 && j < 100; i++)
{
gs>>one_line;
gs<<flush;
if(i==49)
{
i=0;
j++;
gs<<endl;
}
if(mouse_b & 1)
j=100;
}
}
int main()
{
allegro_init();
set_color_depth(16);
set_gfx_mode(GFX_AUTODETECT,1440,900,0,0);
install_keyboard();
install_mouse();
show_mouse(screen);
buffer = create_bitmap(1440,900);
gs.set_bitmap(screen);
simple();
return 0;
}
END_OF_MAIN();
You're supposed to call install_timer() before calling install_mouse().
And please use <code></code> tags when you're posting code.
Ok. Now i m able to click. Problem is, how do i know when exactly i have to click to terminate the loop?
I don't understand you question
Ok see.
Thing is I m using gstream for keyboard input.
For example
char string[100]; for(int i=0;i<N;i++) { gs>>string[i]; if(mouse_b &1) i=N; }
This doesn't work.