Mark Sachs (ksleet) wrote,
Mark Sachs
ksleet

  • Mood:
  • Music:

All units, we have a report of pirates fighting ninjas, please respond.

So yes, I worked on NaGaWriMo today. Specifically there's just not much more to getting a functioning graphics system for Star Castle than shapes and lines, so I decided to look into the input system. It turns out that GLUT wants to handle this, too! (Man, that library's pushy.) The way it works is different from DirectInput, in which you poll the input device and get back an object containing its entire state -- in the case of the keyboard, whether each key is currently up or down -- and instead is much more like basic Windows, where a callback function is fired when keys are pressed or released. So the question is, do I want to manually accumulate them into an array I can easily poll once a frame, DirectInput style? Or do I want to bite the bullet and accept keyboard interrupts at any time? I suppose it's not that hard to have a flag on the player's ship, say, indicating that it wishes to fire its gun this frame; set it to true whenever the player mashes the fire button; but only check and reset it once per frame.

The conclusion I came to is that I didn't get enough sleep last night and am tired, so I'll button up the input system tomorrow. Ha, "button up," see what I did there? That was totally by accident. But anyway, one clear point I'm learning is that GLUT wants things its own way, which is absolutely not the same as DirectX does, and the more I try to wrench it into the DirectX paradigm the more complicated things will get. I should probably go along with how it wants things to be.
Tags: nagawrimo
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments