SFML/examples/cocoa
Chris Thrasher a71d60a0c9 Simplify how warnings are ignored on Apple platforms
Within files that are only compiled on Apple platforms, we don't
need that redundant check for __APPLE__ so that got removed. Further,
Clang will recognize GCC pragmas so we don't need both Clang AND GCC
pragmas so I removed the Clang pragmas.

Currently GCC fails to compile this code but if one day in the future
that gets fixed, the deprecation warnings will continue to get ignored.
2022-08-03 23:41:01 +02:00
..
resources Update year to 2022 (master branch) 2022-02-16 13:52:31 +00:00
CMakeLists.txt Require CMake 3.16 for ObjC and ObjC++ sources 2022-08-03 23:38:17 +02:00
CocoaAppDelegate.h Run clang-format 2022-07-11 20:04:56 +02:00
CocoaAppDelegate.mm Simplify how warnings are ignored on Apple platforms 2022-08-03 23:41:01 +02:00
main.m Format .m files 2022-07-14 21:47:49 +02:00
MainMenu.xib SFML-Cocoa is now part of the cmake-based examples 2012-01-30 12:23:18 +01:00
NSString+stdstring.h Run clang-format 2022-07-11 20:04:56 +02:00
NSString+stdstring.mm Run clang-format 2022-07-11 20:04:56 +02:00
readme.txt Fix whitespace: Convert tabs to spaces and remove trailing whitespace. 2015-04-15 01:53:43 +02:00

SFML IN COCOA APPLICATION
=========================

This is a small example of the integration of SFML in a Cocoa application.

Features
--------

 * This example shows how basic UI elements can interact with SFML
   render areas such as sf::RenderWindow (you can use sf::Window and
   OpenGL code too, of course).
 * It also provides tools for converting NSString to and from
   std::[w]string in an Objective-C Category of NSString.
 * Moreover, it shows how you can prevent annoying the system alerts
   produced when the SFML view has focus and the user press a key
   (see SilentWindow interface in CocoaAppDelegate.[h|mm]).

Special Considerations
----------------------

While mixing SFML into a Cocoa application you have to deal with mixing
C++ and Objective-C. In order to proceed you should use .mm extension for
Objective-C++ files.

Be aware of the limitations of Objective-C++. Please refer to the official
documentation provided by Apple for more information.

You can also work around these limitations by using CSFML.