Results 1 to 7 of 7

Thread: Help: Wireframe toggle button?

  1. #1
    Guest

    Help: Wireframe toggle button?

    I am not an expert on programming, just learning, but I can design maps. Now this is my problem:
    I need a button for changing between wireframe and normal mode in an open gl based game, for inspecting bugs in my maps.
    Can anyone help me to provide codes for wireframe toggeling, if possible?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Help: Wireframe toggle button?

    By button do you mean keypress of dialog box button?

    glPolygonMode("GL_FRONT, GL_BACK, GL_FRONT_AND_BACK", " GL_POINT, GL_LINE, and GL_FILL")

    in keyboard routine

    if (key == "X" ) debug_mode = abs(debug_mode - 1); //X toggles debug on/off


    in drawing routine:

    if(debug_mode)
    {
    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); Draw only lines no fill
    }glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); // normal mode

    Originally posted by School kid:
    I am not an expert on programming, just learning, but I can design maps. Now this is my problem:
    I need a button for changing between wireframe and normal mode in an open gl based game, for inspecting bugs in my maps.
    Can anyone help me to provide codes for wireframe toggeling, if possible?

  3. #3
    Guest

    Re: Help: Wireframe toggle button?

    Like I said, I'm no programmer.
    But what I'm looking for is both a toggle button, like a or F1, and a hold "to get wireframe button", wireframe while holding F2 or q.

  4. #4
    Guest

    Re: Help: Wireframe toggle button?

    Is it posible to change into wireframe while running the game?,if not please give me all the commands assosiated with wireframe.

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2004
    Location
    Scotland
    Posts
    18

    Re: Help: Wireframe toggle button?

    The opengl part of this question has already been answered. Use GL_LINE instead of GL_FILL.

    For the keypress you need (in pseudocode) :

    // Q or F1 toggles between on/off
    if key Q or key F1 is pressed
    {
    debug_mode = !debug_mode // toggle
    }

    // A or F2 always shows wireframe if held
    if key A or key F2 is pressed
    {
    debug_mode = true
    }
    else
    {
    debug_mode = false
    }

    targe
    There are 10 kinds of people in this world. Those who understand binary and those who don't

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Help: Wireframe toggle button?

    I answered your question, on how to switch between the two modes.
    But we are here to help guide you not write your whole program for you.

    I think before you even try to do openGL programming, you should at least learn the basics of programming. This way when someone gives you an answer, you will be able to at least have a clue what they are talking about.

    nehe.gamedev.net is a good place to start learning the basics.

  7. #7
    Guest

    Re: Help: Wireframe toggle button?

    Thanks alot, I really appriciate this.
    I'm also taking two classes in programming with vbasic next semester.

Similar Threads

  1. toggle between display
    By jsim1982 in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 04-10-2005, 02:58 AM
  2. Replies: 2
    Last Post: 04-11-2004, 08:16 PM
  3. toggle between hw/sw renderer?
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-10-2003, 05:48 PM
  4. help on shading toggle
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-26-2003, 10:59 PM
  5. FullScreen Toggle
    By diligent in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-02-2000, 06:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean