Advertisement

school project.....

Started by November 04, 2001 03:46 AM
6 comments, last by nic2082 23 years, 3 months ago
hey there i was wondering if anyone could help me out for a sec, how do i make it so that text that i write to the screen stays there until a key is pressed? would i use a case senario having the variable incrementing every time that key is pressed? well any help is welcome, u guys are the coolest haha
bool cool;

main_loop()
{
cool = true;

if(cool)
{
write_cool_text("cool");
}

if(GetKey(VK_UP))
{
cool = false;
}
}


Note that the getkey function merely checks the state of a given key. Depending on the type of program you are writing, you may find out this in any of a number of ways.

Your sec is up *g*
Advertisement
cin.peek();

Waits until a key is pressed until returning (it does not remove anything from the input stream, so you need to use cin.ignore (1,'' '') if you want to eat the key press).
Or if its dos and old school you can use kbhit() (keyboard hit)
Thanks u guys for the tips
now i have like one day to make the program heh i think ill just take a shortcut by using nehe''s basecode
well catch u guys later, ive got to get onto the assgnment now.
Nic, do you by any chance attend school at the CAT program at Lakewood High School?

~Scraniel~
Advertisement
nup, wheres that?!
i go to carine senior high school, in perth wa, australia

im relatively new to opengl, and , when my cousin mentioned i should do my physics oral presentation in opengl
i decided to try to make it, until i find out that the schools computers dont support opengl awww
anyways
catcha later
Ok, never mind, I asked because this website''s tutorials are used by my old high school for a new programming class there. Just wondering.

~Scraniel~

This topic is closed to new replies.

Advertisement