Thread: Game Console in OpenGL

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    1

    Post Game Console in OpenGL

    Hello to you reader!!!!
    I am new to this forum so i salute you all.
    I have a question about keyboard handling in games.
    My initial idea is a game console enviroment for a (someday wannabe) 3d game engine. I have a little problem on how to take the right keyboard input and "build" the console command inside a game loop???
    Does it make any sense??????
    I mean how can i be sure that everything i type from the keyboard will be printed on screen???
    Or how can i be sure that a single key press will not print a line of same letters????
    Inside a game loop, if the fps is big, the keyboard handling function will be executed many times within a second and then a single keypress will be equal to a 20 keypresses.
    If anyone understood what i just said and knows a solution to my problem please inform me.

    Forgive my terrible English.
    HellRaiZer.

  2. #2
    monotonously living Dissata's Avatar
    Join Date
    Aug 2001
    Posts
    341
    it executes the loop then moves on to the rest of the functions.
    i.e. while ( firekey() != false){
    pfire();
    }

    while firekey is the function for keyboard input (different for each graphics library.
    and pfire is the function that fires a weapon or does the initial command
    if a contradiction was contradicted would that contradition contradict the origional crontradiction?

  3. #3
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    Or how can i be sure that a single key press will not print a line of same letters????
    if glwKEYS[glw[0]) //This is the key beign pressed
    {
    do this great code;
    glwKEYS[0]=FALSE; //This will tell the computer to ignore this keyboard command until it is pressed again
    }
    My site to register for all my other websites!
    'Clifton Bazaar'

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 06-12-2006, 03:51 PM
  2. Game console programming
    By swgh in forum Game Programming
    Replies: 10
    Last Post: 05-07-2006, 12:24 PM
  3. beach bar (sims type game)
    By DrKillPatient in forum Game Programming
    Replies: 1
    Last Post: 03-06-2006, 01:32 PM
  4. Shadows in OpenGL 2D game
    By MathFan in forum Game Programming
    Replies: 0
    Last Post: 07-13-2004, 03:03 AM
  5. Console Game Problem
    By CodeMonkey in forum Game Programming
    Replies: 6
    Last Post: 03-17-2002, 05:33 PM