Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>chances are, this will not go smoothly if you don't know c++ or similarly, cocoa.</p> <p>otherwise, most of the transition will be monotonous, if you <em>do</em> know what you're doing. otherwise, prepare to learn a few things about objc.</p> <p>first: don't bother converting a functioning c++ program's implementation to objc. it's a huge waste of time. you just wrap, bind, and alter the program to operate in that context. you don't have to write everything in objc.</p> <p>second: you'll have to write some objc bindings/wrappers to use the c++ program. you'll have some wrapping to do, particularly for the ui elements and user events.</p> <p>third: sources should compile as-is. you just add them to your new cocoa template project and gcc will compile it as a cpp file by default if it has the a recognized c++ extension. to use c++ and objc, use objc++ <code>FILENAME.mm</code> (you could also use <code>.M</code>, but that is not supported as well). even better, put the original cpp sources in a separate library, which the app links to.</p> <p>fourth: now that you have a cocoa project template and compiling cpp sources, add the wrappers/bindings so the cocoa events/drawing performs in that context. based on your example code, your starting point uses Open GL so you'll have to use something like an NSOpenGLView if you want a Cocoa app. what exactly you'll need to implement depends on the project.</p> <p>your main function should call NSApplicationMain, then your initial entries for writing the bindings to the c++ code will likely be event handling, NSWindow, NSView, and maybe NSApplication.</p> <p>if you're new to objc, you'll probably have a bit of ramp-up.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload