Archived

This topic is now archived and is closed to further replies.

nic2082

school project.....

Recommended Posts

nic2082    122
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

Share this post


Link to post
Share on other sites
TheGilb    372
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*

Share this post


Link to post
Share on other sites
invective    118
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).

Share this post


Link to post
Share on other sites
nic2082    122
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.

Share this post


Link to post
Share on other sites
nic2082    122
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

Share this post


Link to post
Share on other sites
Scraniel    122
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~

Share this post


Link to post
Share on other sites