Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Cinder.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010, The Barbarian Group
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
6  the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice, this list of conditions and
9  the following disclaimer.
10  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
11  the following disclaimer in the documentation and/or other materials provided with the distribution.
12 
13  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
14  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
15  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
16  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
17  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
18  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
19  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20  POSSIBILITY OF SUCH DAMAGE.
21 */
22 
23 #pragma once
24 
25 #if __clang__
26  #if ! __has_include( <cstdint> )
27  #error "<cstdint> is missing - Cinder requires libc++ on Mac OS X and iOS"
28  #endif
29 #endif
30 
31 #include <cstdint>
32 #include <boost/version.hpp>
33 
34 #if BOOST_VERSION < 105500
35  #error "Cinder requires Boost version 1.55 or later"
36 #endif
37 
38 // CINDER_VERSION % 100 is the patch level
39 // CINDER_VERSION / 100 % 1000 is the minor version
40 // CINDER_VERSION / 100000 is the major version
41 #define CINDER_VERSION 806
42 #define CINDER_VERSION_STR "0.8.6dev"
43 
44 namespace cinder {
45 using std::int8_t;
46 using std::uint8_t;
47 using std::int16_t;
48 using std::uint16_t;
49 using std::int32_t;
50 using std::uint32_t;
51 using std::int64_t;
52 using std::uint64_t;
53 
54 #define CINDER_CINDER
55 
56 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
57  #if defined(WINAPI_PARTITION_DESKTOP)
58  #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
59  #define CINDER_MSW
60  #else
61  #define CINDER_WINRT
62  #if BOOST_VERSION != 105500
63  #error "Incorrect Boost version See include/winrt/boost/README.txt for more info."
64  #endif
65  #endif
66  #else
67  #define CINDER_MSW
68  #endif
69 #elif defined(linux) || defined(__linux) || defined(__linux__)
70  #define CINDER_LINUX
71 #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
72  #define CINDER_COCOA
73  #include "TargetConditionals.h"
74  #if TARGET_OS_IPHONE
75  #define CINDER_COCOA_TOUCH
76  #if TARGET_IPHONE_SIMULATOR
77  #define CINDER_COCOA_TOUCH_SIMULATOR
78  #else
79  #define CINDER_COCOA_TOUCH_DEVICE
80  #endif
81  #else
82  #define CINDER_MAC
83  #endif
84  // This is defined to prevent the inclusion of some unfortunate macros in <AssertMacros.h>
85  #define __ASSERTMACROS__
86 #else
87  #error "cinder compile error: Unknown platform"
88 #endif
89 
90 #define CINDER_LITTLE_ENDIAN
91 
92 } // namespace cinder
93 
94 #if defined( CINDER_WINRT )
95  #include <functional>
96  #include <chrono>
97  #include <memory>
98  #include <vector>
99  #ifndef FALSE
100  #define FALSE 0
101  #endif
102 #elif defined( _MSC_VER ) && ( _MSC_VER >= 1600 )
103  #include <memory>
104  #include <vector>
105  #include <functional>
106  #if _MSC_VER >= 1700
107  #include <chrono>
108  #else
109  #include <boost/chrono.hpp>
110  #endif
111 #elif defined( CINDER_COCOA ) && defined( _LIBCPP_VERSION ) // libc++
112  #include <chrono>
113  #include <memory>
114 #elif defined( CINDER_COCOA ) // libstdc++
115  #error "Cinder requires libc++ on Mac OS X and iOS"
116 #else
117  #error "Unkown platform configuration"
118 #endif
119 
120 #include <boost/checked_delete.hpp> // necessary for checked_array_deleter
121 using boost::checked_array_deleter;
122 
123 // Create a namepace alias as shorthand for cinder::
124 #if ! defined( CINDER_NO_NS_ALIAS )
125  namespace ci = cinder;
126 #endif // ! defined( CINDER_NO_NS_ALIAS )
typedef int64_t(APIENTRYP GLEEPFNGLXSWAPBUFFERSMSCOMLPROC)(Display *dpy