PDA

View Full Version : toggle between display



jsim1982
04-09-2005, 06:35 AM
hi, i need some advice on how to toggle between displaying glutSolidCube and glutWireCube by pressing a keyboard button. Thanx

Aeluned
04-09-2005, 10:16 AM
Wow, this is faaaar from advanced.



global bool bWireRender
OnKeyDown()
{
if(key == 'this')
bWireRender = true;
if(key == 'that')
bWireRender = false;
}

DrawScene()
{
if(bWireRender)
glutWireCube();
else
glutSolidCube();
}

SirKnight
04-09-2005, 07:04 PM
Are you kidding? This is the most advanced question in the history of computer graphics...or just programming in general. Carmack and Sweeney are working around the clock trying to figure it out right now!!

hehe :D

-SirKnight

jsim1982
04-10-2005, 12:31 AM
Thanx for the advice but i suppose this code toggles by using 2 different keyboard buttons. Is there any way i can toggle using 1 keyboard button, for example, i press 'a' to change to glutWireCube and press 'a' again to change back to glutSolidCube?

Matt Zamborsky
04-10-2005, 01:58 AM
bWireRender = !bWireRender and what about this? This isnt adnvaced question, if someone has similar problem doesnt post it here, pls :)