Thread: How to tell what was clicked on? (OpenGL)

  1. #1
    napKINfolk.com napkin111's Avatar
    Join Date
    Apr 2002
    Posts
    310

    Question How to tell what was clicked on? (OpenGL)

    I'm trying to make a simple level editor for a game I'm making. Its probably going to be tile based, and I want to be able to click on a tile to select it, then press 1-9 to change that tile to the corresponding number (1 for dirt, 2 for grass, etc). The problem is I don't know how to tell what was clicked on...

    Any suggestions would be appreciated!

    //napKIN

  2. #2
    Registered User Bieh's Avatar
    Join Date
    Sep 2002
    Posts
    83
    Try:
    NeHe's 'Picking, Alpha Blending, Alpha Testing, Sorting' tutorial (the 'picking' part is what you're after), or GameTutorials Object-Selection tutorial.

    Hope that helps
    "It always takes longer than you think, even when you take Hofstadter's Law into account."
    -Hofstadter's Law

    Bored? Try my game SpaceWars , made in Allegro and VC++
    or see my new game Redoubt , made in OpenGL and VC++

  3. #3
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Here's an example program from OpenGL Superbible. You'll need GLUT installed to compile.

  4. #4
    napKINfolk.com napkin111's Avatar
    Join Date
    Apr 2002
    Posts
    310
    Awesome, thanks guys!

    //napKIN

  5. #5
    is that ogl superbible available as a e-book anywhere?

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, 07: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, 10:01 PM