forked from githole/Live-Coder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCore.h
98 lines (72 loc) · 1.44 KB
/
Core.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
#ifndef _CORE_H_
#define _CORE_H_
#include <SDL.h>
#ifdef __WIN32__
#define __NEEDSGLEW__
#endif __WIN32__
#ifdef __linux__
#define __NEEDSGLEW__
#endif __linux__
#ifdef __WIN32__
#include <windows.h>
#endif __WIN32__
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#include <string>
#include <math.h>
#include "Logger.h"
#include "KeyBuffer.h"
#include "MouseBuffer.h"
#include "ShaderGL.h"
#include "BitmapFontGL.h"
#include "TextEditor.h"
#include "KeyAnalyzer.h"
#include "AudioAnalyzer.h"
namespace LiveCoder {
const int DefaultWidth = 800;
const int DefaultHeight = 600;
const int EffectNum = 64;
class Core {
private:
int width;
int height;
int bpp;
bool end;
bool editMode;
bool nowCompiled;
bool errorHighlight;
int nowEffect;
std::string title;
int ProcessSDLEvents();
KeyBuffer keyBuffer;
MouseBuffer mouseBuffer;
ShaderGL shaderGL[EffectNum];
// ShaderGL postEffect;
TextEditor textEditor;
KeyAnalyzer keyAnalyzer;
AudioAnalyzer *audioAnalyzer;
std::string nowSource;
Uint32 baseTime;
float* audioBuffer;
GLuint audioTexture;
// FBOとか
GLuint frameBuffer;
GLuint renderBuffer;
GLuint renderTexture;
// 自分で好きなてくすちゃを使えるとうれしいね
GLuint optionTexture;
public:
int Initialize(std::string title_, int width_, int height_, int SDLflags);
int MainLoop();
void Render();
Core();
virtual ~Core();
};
};
#endif