Couple Code Snippets

This is a discussion on Couple Code Snippets within the Game Programming forums, part of the General Programming Boards category; Alright I have a couple of code snippets I want to know what exactly they do I mean what everything ...

  1. #1
    Unregistered
    Guest

    Couple Code Snippets

    Alright I have a couple of code snippets I want to know what exactly they do I mean what everything means not just what it is doing.

    bActive = !((BOOL)HIWORD(wParam));

    Alright I know it is typecasting HIWORD into a boolean variable but what is HIWORD(wParam) if I remember isn't wParam split into two 16 bit integers. So would HIWORD be taking the first of the two integers?

    Thanks anyone who helps

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,854
    wparam and lparam are additional info passed in a Windows program with a message.

    Code:
    case	WM_SIZE:
    cxSize=(int)(LOWORD(lParam));
    cySize=(int)(HIWORD(lParam));
    this is a size msg recieved in the callback and then the x,y coods are extracted so the window can be redrawn at the correct size.

    In yours it looks like a flag is checked to the see if it is not equal to current.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 11:38 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Math function code - couple probs, tips?
    By Captain Penguin in forum C++ Programming
    Replies: 4
    Last Post: 06-18-2002, 09:54 AM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 4
    Last Post: 01-15-2002, 11:04 PM

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