Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CinderResources.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 // This header defines the macro CINDER_RESOURCE, which does the right thing on all platforms for defining resources.
24 
25 #pragma once
26 
27 #ifdef RC_INVOKED
28  #define WORKING_DIR "./"
29  #define QUOTE_PATH(x) #x
30  #define CINDER_RESOURCE( LOCALPREFIX, PATH, ID, TYPE ) \
31  ID TYPE QUOTE_PATH( ./##LOCALPREFIX##PATH )
32 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
33  #if defined(WINAPI_PARTITION_DESKTOP) // MSW RESOURCE
34  #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
35  #define QUOTE_PATH(x) #x
36  #define CINDER_RESOURCE( LOCALPREFIX, PATH, ID, TYPE ) \
37  QUOTE_PATH(LOCALPREFIX##PATH),ID,#TYPE
38  #else // WINRT RESOURCE
39  #define CINDER_RESOURCE( LOCALPREFIX, PATH, ID, TYPE ) #PATH
40  #endif
41  #else // MSW RESOURCE
42  #define QUOTE_PATH(x) #x
43  #define CINDER_RESOURCE( LOCALPREFIX, PATH, ID, TYPE ) \
44  QUOTE_PATH(LOCALPREFIX##PATH),ID,#TYPE
45  #endif
46 #else // MAC or iOS RESOURCE
47  #define CINDER_RESOURCE( LOCALPREFIX, PATH, ID, TYPE ) #PATH
48 #endif