Alpha Engine: AEExport.h Source File

AlphaEngine

AEExport.h
Go to the documentation of this file.
1 /******************************************************************************/
15 /******************************************************************************/
16 
17 #ifndef AE_EXPORT_H
18 #define AE_EXPORT_H
19 
20 #ifndef EPSILON
21  #define EPSILON 0.00001f
22 #endif
23 
24 #ifndef PI
25  #define PI 3.1415926f
26 #endif
27 
28 #define HALF_PI (PI * 0.5f)
29 #define TWO_PI (PI * 2.0f)
30 
31 
32 #define EXPORT_WINDOWS 1
33 #define EXPORT_ANDROID 0
34 
35 #if(1 == EXPORT_WINDOWS)
36 
37  #ifdef AE_FINAL
38  #define PRINT(...)
39  #else
40  #define PRINT(...) printf(__VA_ARGS__)
41  #endif
42 
43  #ifdef AE_FINAL
44  #define PRINT_INFO(...)
45  #else
46  #define PRINT_INFO(...) PRINT("File: %s\nLine: %d\nFunc: %s\n\n", \
47  __FILE__,__LINE__, __FUNCTION__);
48  #endif
49 
50 
51 
52 // #ifdef AE_EXPORTS
53  #define AE_API __declspec(dllexport)
54 // #else
55 // #define AE_API __declspec(dllimport)
56  //#define AE_API
57 // #endif
58 
59  #define DECLARE_FUNCTION_FOR_ANDROID(functionName)
60  #define IMPLEMENT_FUNCTION_FOR_ANDROID(functionName)
61 
62  #define DECLARE_FUNCTION_FOR_ANDROID_2_INT(functionName, paramType1, paramType2)
63  #define IMPLEMENT_FUNCTION_FOR_ANDROID_2_INT(functionName, paramType1, paramType2)
64 
65 #elif(1 == EXPORT_ANDROID)
66 
67  #include <jni.h>
68  #include <android/log.h>
69  #define AE_API
70  #define LOG_TAG "AlphaEngine-Lib"
71  #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
72  #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
73 
74  #ifdef AE_FINAL
75  #define PRINT(...)
76  #else
77  #define PRINT(...) LOGI(__VA_ARGS__)
78  #endif
79 
80 
81 
82  #define DECLARE_FUNCTION_FOR_ANDROID(functionName) \
83  JNIEXPORT void Java_com_example_alphaengine_AEGLRenderer_##functionName(JNIEnv * env, jobject obj);
84 
85  #define IMPLEMENT_FUNCTION_FOR_ANDROID(functionName) \
86  JNIEXPORT void Java_com_example_alphaengine_AEGLRenderer_##functionName(JNIEnv * env, jobject obj) \
87  { \
88  functionName(); \
89  }
90 
91 
92  #define DECLARE_FUNCTION_FOR_ANDROID_2_INT(functionName, paramType1, paramType2) \
93  JNIEXPORT s32 Java_com_example_alphaengine_AEGLRenderer_##functionName(JNIEnv * env, jobject obj, paramType1, paramType2);
94 
95  #define IMPLEMENT_FUNCTION_FOR_ANDROID_2_INT(functionName, paramType1, paramType2) \
96  JNIEXPORT s32 Java_com_example_alphaengine_AEGLRenderer_##functionName(JNIEnv * env, jobject obj, paramType1 param1, paramType2 param2) \
97  { \
98  return functionName(param1, param2); \
99  }
100 
101 #endif
102 
103 
104 
105 #endif // File
Generated on Sat Jan 4 2014 02:06:22 for Alpha Engine by   doxygen 1.8.5