Simple application skeleton without nib

Discussion in 'Mac Programming' started by win32user, Oct 6, 2010.

  1. macrumors newbie

    Joined:
    Oct 6, 2010
    #1
    Hi All
    Could you help me to write simple cocoa OpenGL application without nib?

    1. I need to be able handle next events:

    - Application become active (WM_SETFOCUS windows analog)
    - Application become inactive (WM_KILLFOCUS windows analog)
    - Resize window event (WM_SIZE windows analog)
    - Mouse events (WM_MOUSEMOVE, WM_MOUSEWHEEL, WM_LBUTTONUP, ...)
    - Keyboard events (WM_KEYUP, WM_KEYDOWN, WM_SYSKEYUP, WM_SYSKEYDOWN)

    2.Also I need to change screen resolution in may app
    How can I do that?

    3.Also I need to show / hide mouse cursor

    4.I need to center mouse cursor to get mouse stride instead of mouse position

    It will be cool if you will get my sample code with all functionality listed below

    Thanks!!!

    PS: Sorry for my noobity :)
     
  2. macrumors 68000

    Joined:
    Mar 29, 2009
    Location:
    USA
    #2
    Look into SDL
     
  3. thread starter macrumors newbie

    Joined:
    Oct 6, 2010
    #3
    So SDL is the huge monster library...
    Maybe some body has a little sample code?
     
  4. macrumors 68000

    Joined:
    Mar 29, 2009
    Location:
    USA
    #4
    http://isovega.net/macgameprog/index.php?catid=2&blogid=1

    Start at the bottom, it starts out with setting up Xcode to use SDL, then a sample program that draws a couple lines, then it gets into keyboard input, etc
     

Share This Page