Command Lines in OpenGL

This is a discussion on Command Lines in OpenGL within the C++ Programming forums, part of the General Programming Boards category; I want to add a function into my program which lets the user change the ticket price and the show ...

  1. #1
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964

    Command Lines in OpenGL

    I want to add a function into my program which lets the user change the ticket price and the show name, etc. things like that...

    I can do all the background stuff, source code, but the key thing I don't know how to do, is set up so I can write to a command line in my program, using OpenGL....

    Any insight on where to look for this? NeHe doesn't cover this topic :d
    Last edited by Shamino; 09-12-2005 at 09:39 AM.

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Assuming you mean in C++:
    Code:
    #include <iostream>
    
    int main(int argc, char*argv[])
    {
    	for(register short int i=0;i<argc;i++)
    	{
    		std::cout<<i<<'\t'<<argv[i]<<'\n';
    	}
    	return 0;
    }
    and the input/output:
    Code:
    jshao@MCP ~/Programming/C++ $ ./test.exe a b c d
    0       ./test.exe
    1       a
    2       b
    3       c
    4       d
    as you can probably see, int argc holds how many command line arguments are sent (seperated by spaces). char*argv[] holds the actual arguments as character arrays

    if your program was called on the command line, there's always at least one argument (argc>=1) and the first argument is always the title of the program/way it was invoked (argv[0]="./test.exe").
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  3. #3
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    I believe Shamino meant a console (like hitting ~ in World of Warcraft) to type commands in. Theres source code under N at Nehe - NeHe Console by Lolo: http://nehe.gamedev.net/data/downloa...d.asp?letter=N
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  4. #4
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964
    Though not EXACTLY what I was looking for Dae, more like a textured message box on the screen,

    like

    Name: _______ <--- can type in blank space..

    but, console would be quite useful as well

  5. #5
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    a Field? (e.g. the one I'm typing in now, e.g. the one you put url's in on browsers)
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  6. #6
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964
    That would be the word, I need to know how to have a field in my opengl program

  7. #7
    ---
    Join Date
    May 2004
    Posts
    1,379
    Maybe there is some kind of OpenGL GUI library

  8. #8
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Quote Originally Posted by sand_man
    Maybe there is some kind of OpenGL GUI library
    Yeah thats what he needs, I forgot OpenGL is just graphics commands/display (whatever).

    Check my post, under OpenGL Addons, FLTK looks like nice one IMO: Game Programming Links
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  3. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 06:57 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 09:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21