I want to use CGL or NSOpenGL to create an OpenGL window without using XCode (compile with command line gcc). I am developing something that is cross platform, and I’d like to keep the code divergence to a minimum if I can! My codebase is fully C++ at the moment. Is this at all possible? I am new to OSX and I haven’t touched objective C. I looked through the developer docs and grabbed some example files. They are all using xcode. I successfully compiled the source and linked with the right framework, but the whole app bundle, xib, and info.plist thing seems a bit over the top.
Share
Both fltk and SDL should have enough AGL/CGL code. I’ve built and run cmdline GL apps on OS X with fltk-1.3.0. It uses the AGL sub-system however, which is deprecated. SDL uses CGL and NSOpenGL for its Quartz video layer:
./src/video/quartzUse the obj-c flags for the compiler, if you need to build a
src.m, and let the native g++, llvm-g++, clang++, or whatever, take care of the linking. You might need to add-framework CGL -framework OpenGLas well asApplicationServicesandCocoa. A lot of the answer depends on what you mean by ‘code divergence’.