-
Notifications
You must be signed in to change notification settings - Fork 12
/
StarMain.h
executable file
·121 lines (99 loc) · 2.25 KB
/
StarMain.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//
// StarMain.h
//
// Created by sungwoo choi on 8/25/12.
// Copyright (c) 2012 SungLab. All rights reserved.
//
#ifndef StarEngine_Main_Header
#define StarEngine_Main_Header
#ifdef __cplusplus
#include <algorithm>
#include <vector>
#endif
// IOS
#if defined(IOS)
#ifndef METAL
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import <UIKit/UIKit.h>
#include <iostream>
#import "GLView.h"
#endif
#endif
// ANDROID
#ifdef ANDROID
#include <android/log.h>
#include <jni.h>
#define GL_GLEXT_PROTOTYPES
#include <GLES3/gl3.h>
#include <GLES2/gl2ext.h>
#include <GLES3/gl31.h>
/*
// GLES 2.0
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
*/
#include <stdlib.h>
#include <string.h>
#include <iostream>
#define LOG_TAG "StarEngine"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
#endif
#if (StarQt)
#include <QOpenGLBuffer>
#include <QOpenGLFramebufferObject>
#include <QOpenGLFunctions>
#endif
// MAC
#if (MAC && !StarQt)
#import <Cocoa/Cocoa.h>
#import <OpenGL/gl3.h>
#import <OpenGL/glext.h>
#elif _WIN32 //Windows
#include <GL/glew.h>
#include <SDL.h>
#include <SDL_opengl.h>
#include <gl/glu.h>
#include <stdio.h>
#include <cstdlib>
#include <string>
void winprintf(const char* fmt, ...);
#endif
//OS Free
#include "./math/StarMath.h"
#include "./tool/StarTimer.h"
#include "./tool/StarTouch.h"
#include "./tool/StarUtil.h"
#ifndef METAL
#include "./renderer/StarFBO.h"
#include "./renderer/StarShader.h"
#include "./renderer/StarTexture.h"
#include "./ai/StarAnt.h"
#include "./geometry/StarGeo.h"
#include "./geometry/StarMesh.h"
#include "./geometry/StarOBJ.h"
#include "./geometry/StarStructure.h"
#include "./ui/StarScene.h"
#include "./ui/StarView.h"
#include "./effect/StarEffect.h"
#endif
#define ToInt(x) static_cast<int>(x)
#define ToUInt(x) static_cast<unsigned int>(x)
#define ToLong(x) static_cast<long>(x)
#define ToFloat(x) static_cast<float>(x)
#define ToDouble(x) static_cast<double>(x)
#define STRINGIFY(A) #A
#define XSTRINGIFY(A) STRINGIFY(A)
#if StarQt
#define starLOG qDebug
#elif IOS
#define starLOG printf
#elif MAC
#define starLOG printf
#elif ANDROID
#define starLOG LOGE
#elif _WIN32
#define starLOG winprintf
#endif
#endif