PDA

View Full Version : Simple application skeleton without nib




win32user
Oct 6, 2010, 05:35 AM
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 :)



robvas
Oct 6, 2010, 07:22 AM
Look into SDL

win32user
Oct 6, 2010, 07:32 AM
So SDL is the huge monster library...
Maybe some body has a little sample code?

robvas
Oct 6, 2010, 08:09 AM
So SDL is the huge monster library...
Maybe some body has a little sample code?

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