Fixes compile warning.
Fixes some compile time warnings.
Fixes compile time warnings. A bit of code cleanup.
Skips some unneeded initialization.
There was no need for static variables in this function. Code more thread safe.
Undoing part of a previous change, which was dealing with some if statements which i'm not sure i want to change.

Don't understand fully the ramifications of fouling around with that if statement.
fix mac os link error

add IOKit OpenGL and Cocoa framework dependence