質問編集履歴
10
提示コードを修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
ソースコード全文: https://github.com/Shigurechan/AAEditor/tree/e0db42df3945fc1e1ea9879e2746ffe5eeedf9f2
|
23
23
|
|
24
24
|
|
25
|
-
#####
|
25
|
+
##### Camera
|
26
26
|
```cpp
|
27
27
|
|
28
28
|
// ##################################### 初期化 #####################################
|
@@ -361,7 +361,76 @@
|
|
361
361
|
|
362
362
|
```
|
363
363
|
|
364
|
-
|
364
|
+
##### Chracter
|
365
|
-
|
365
|
+
```cpp
|
366
|
-
|
366
|
+
#include "Character.hpp"
|
367
|
+
|
367
|
-
|
368
|
+
Character::Character(glm::vec2 pos,int pixel)
|
369
|
+
{
|
370
|
+
position = pos;
|
371
|
+
character = '\0';
|
372
|
+
pixelSize = pixel;
|
373
|
+
}
|
374
|
+
|
375
|
+
void Character::setCharacter(const char ch)
|
376
|
+
{
|
377
|
+
character = ch;
|
378
|
+
DeleteCharacterTexture(texture);
|
379
|
+
texture = FrameWork::GenCharacterTexture("Asset/font/PressStart2P.ttf", pixelSize, FrameWork::GetRGBAColor(glm::vec4(0, 255, 0, 255)), "%c",ch);
|
380
|
+
}
|
381
|
+
|
382
|
+
void Character::Resize(int pixel)
|
383
|
+
{
|
384
|
+
pixelSize = pixel;
|
385
|
+
DeleteCharacterTexture(texture);
|
386
|
+
texture = FrameWork::GenCharacterTexture("Asset/font/PressStart2P.ttf", pixelSize, FrameWork::GetRGBAColor(glm::vec4(0, 255, 0, 255)), "%c", character);
|
387
|
+
}
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
glm::ivec2 Character::getPosition()
|
392
|
+
{
|
393
|
+
return position;
|
394
|
+
}
|
395
|
+
|
396
|
+
FrameWork::CharacterTexture* Character::getTexture()
|
397
|
+
{
|
398
|
+
return &texture;
|
399
|
+
}
|
400
|
+
|
401
|
+
void Character::Update()
|
402
|
+
{
|
403
|
+
|
404
|
+
}
|
405
|
+
|
406
|
+
void Character::Renderer(const glm::ivec2 pos,const glm::mat4 view)const
|
407
|
+
{
|
408
|
+
switch(character)
|
409
|
+
{
|
410
|
+
|
411
|
+
case 0x28: // (
|
412
|
+
{
|
413
|
+
|
414
|
+
}
|
415
|
+
break;
|
416
|
+
|
417
|
+
case 0x29: // )
|
418
|
+
{
|
419
|
+
|
420
|
+
}
|
421
|
+
break;
|
422
|
+
|
423
|
+
|
424
|
+
default:
|
425
|
+
{
|
426
|
+
|
427
|
+
}
|
428
|
+
break;
|
429
|
+
|
430
|
+
}
|
431
|
+
}
|
432
|
+
```
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
9
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,13 +1,8 @@
|
|
1
|
-
提示コードですが
|
1
|
+
提示コードですがcamera->RendererBuffer()部で下記のエラー出ますこれは何が原因なのでしょうか?
|
2
|
-
|
3
|
-
##### 知りたい事
|
4
|
-
A,Bクラスがどういった影響を受けいるのかわかりません。
|
5
2
|
|
6
3
|
##### 現状
|
7
|
-
提示コードEntryコンストラクタ部ですがA,Bの中身は提示の通りです。
|
8
|
-
Aクラスをコメントアウトするとエラーが出ません。普通に動きます
|
9
|
-
|
4
|
+
Camera->RendererBuffer()をコメントアウトすると普通に動くのですが他のクラスでこの関数を使うとエラーにはなりません。
|
10
|
-
|
5
|
+
これは何が影響しているのでしょうか?
|
11
6
|
|
12
7
|
|
13
8
|
glGetError: https://qiita.com/_ydah/items/da56763e94ba58af3d91
|
@@ -27,76 +22,221 @@
|
|
27
22
|
ソースコード全文: https://github.com/Shigurechan/AAEditor/tree/e0db42df3945fc1e1ea9879e2746ffe5eeedf9f2
|
28
23
|
|
29
24
|
|
30
|
-
#####
|
25
|
+
###### Camera
|
31
26
|
```cpp
|
32
27
|
|
28
|
+
// ##################################### 初期化 #####################################
|
33
|
-
|
29
|
+
FrameWork::Camera::Camera()
|
34
|
-
{
|
30
|
+
{
|
31
|
+
|
32
|
+
// レンダリングポリゴン
|
35
|
-
|
33
|
+
glGenVertexArrays(1, &quadVAO);
|
34
|
+
glGenBuffers(1, &quadVBO);
|
35
|
+
|
36
|
-
|
36
|
+
shader = std::make_shared<FrameWork::Shader>();
|
37
|
+
|
38
|
+
shader->Load("Asset/shader/FrameBuffer.vert", "Asset/shader/FrameBuffer.frag");
|
39
|
+
|
40
|
+
shader->setEnable();
|
41
|
+
glBindVertexArray(quadVAO);
|
42
|
+
glBindBuffer(GL_ARRAY_BUFFER, quadVBO);
|
43
|
+
|
44
|
+
glBufferData(GL_ARRAY_BUFFER, 24 * sizeof(float), &quad, GL_STATIC_DRAW);
|
45
|
+
|
46
|
+
GLuint attrib = shader->getAttribLocation("vertexPosition");
|
47
|
+
glEnableVertexAttribArray(attrib);
|
48
|
+
glVertexAttribPointer(attrib, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), (void*)0);
|
49
|
+
shader->setBindAttribLocation("vertexPosition");
|
50
|
+
|
37
|
-
|
51
|
+
attrib = shader->getAttribLocation("vertexUV");
|
52
|
+
glEnableVertexAttribArray(attrib);
|
38
|
-
|
53
|
+
glVertexAttribPointer(attrib, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), (void*)(2 * sizeof(float)));
|
39
|
-
|
54
|
+
shader->setBindAttribLocation("vertexUV");
|
55
|
+
|
40
|
-
s
|
56
|
+
shader->setDisable();
|
57
|
+
glBindVertexArray(0);
|
58
|
+
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
59
|
+
|
60
|
+
|
61
|
+
|
41
|
-
//
|
62
|
+
//MSAA バッファ
|
63
|
+
glGenFramebuffers(1, &frameBufferFBO);
|
64
|
+
glBindFramebuffer(GL_FRAMEBUFFER, frameBufferFBO);
|
65
|
+
glGenTextures(1, &frameBuffer);
|
66
|
+
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, frameBuffer);
|
67
|
+
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 8, GL_RGB, windowContext->getSize().x, windowContext->getSize().y, GL_TRUE);
|
68
|
+
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, frameBuffer, 0);
|
69
|
+
|
70
|
+
|
42
|
-
|
71
|
+
//レンダリングバッファ
|
43
|
-
|
72
|
+
glGenRenderbuffers(1, &rbo);
|
73
|
+
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
|
74
|
+
glRenderbufferStorageMultisample(GL_RENDERBUFFER, 8, GL_DEPTH24_STENCIL8, windowContext->getSize().x, windowContext->getSize().y);
|
75
|
+
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo);
|
76
|
+
|
44
|
-
|
77
|
+
//MSAA アタッチ
|
45
|
-
|
78
|
+
GLuint attachment = GL_COLOR_ATTACHMENT0;
|
46
|
-
s
|
79
|
+
glDrawBuffers(1,&attachment);
|
80
|
+
|
81
|
+
|
82
|
+
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
|
47
83
|
{
|
48
|
-
case
|
84
|
+
std::cerr << "Framebuffer is not complete: 0x" << glCheckFramebufferStatus(GL_FRAMEBUFFER) << std::endl;
|
49
|
-
{
|
50
|
-
|
85
|
+
assert(0);
|
51
|
-
|
52
|
-
if (title->getSceneType() != SceneType::Title)
|
53
|
-
{
|
54
|
-
scene = title->getSceneType();
|
55
|
-
|
56
|
-
switch (scene)
|
57
|
-
{
|
58
|
-
case SceneType::Edit:
|
59
|
-
{
|
60
|
-
edit = std::make_unique<Edit>();
|
61
|
-
}
|
62
|
-
break;
|
63
|
-
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
}
|
68
|
-
break;
|
69
|
-
|
70
|
-
|
71
|
-
case SceneType::Edit:
|
72
|
-
{
|
73
|
-
|
74
|
-
edit->Loop();
|
75
|
-
|
76
|
-
if (scene != SceneType::Title)
|
77
|
-
{
|
78
|
-
scene = edit->getSceneType();
|
79
|
-
|
80
|
-
switch (scene)
|
81
|
-
{
|
82
|
-
case SceneType::Title:
|
83
|
-
{
|
84
|
-
title = std::make_unique<Title>();
|
85
|
-
}
|
86
|
-
break;
|
87
|
-
|
88
|
-
}
|
89
|
-
}
|
90
|
-
}
|
91
|
-
break;
|
92
|
-
|
93
86
|
}
|
87
|
+
glBindFramebuffer(GL_FRAMEBUFFER,0);
|
88
|
+
|
89
|
+
|
90
|
+
//深度マップ
|
91
|
+
glGenFramebuffers(1, &depthMapFBO);
|
92
|
+
glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO);
|
93
|
+
glGenTextures(1, &depthMap);
|
94
|
+
glBindTexture(GL_TEXTURE_2D, depthMap);
|
95
|
+
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, windowContext->getSize().x, windowContext->getSize().y, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
|
96
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
97
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
98
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
99
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
100
|
+
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthMap, 0);
|
101
|
+
|
102
|
+
//カラーバッファ
|
103
|
+
glGenFramebuffers(1, &colorBufferFBO);
|
104
|
+
glBindFramebuffer(GL_FRAMEBUFFER, colorBufferFBO);
|
105
|
+
glGenTextures(1, &colorBuffer);
|
106
|
+
glBindTexture(GL_TEXTURE_2D, colorBuffer);
|
107
|
+
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, windowContext->getSize().x, windowContext->getSize().y, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
|
108
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
109
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
110
|
+
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorBuffer, 0); // we only need a color buffer
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
position = glm::vec3(0,0,0.5); //座標
|
116
|
+
vecLook = glm::vec3(0,0,-1); //向き
|
117
|
+
|
118
|
+
setPosition(position);
|
119
|
+
setLook(vecLook);
|
120
|
+
|
94
|
-
}
|
121
|
+
}
|
122
|
+
|
123
|
+
|
95
|
-
|
124
|
+
// ##################################### スカイボックスを設定 #####################################
|
96
|
-
|
125
|
+
void FrameWork::Camera::setSkyBox(GLuint tex)
|
126
|
+
{
|
127
|
+
|
128
|
+
}
|
129
|
+
|
130
|
+
|
131
|
+
// ##################################### 描画 #####################################
|
132
|
+
void FrameWork::Camera::View(std::shared_ptr<Actor> actor)
|
133
|
+
{
|
134
|
+
|
135
|
+
glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO);
|
136
|
+
glViewport(0, 0, windowContext->getSize().x, windowContext->getSize().y);
|
137
|
+
|
138
|
+
//actor->Renderer_Depth(getViewPerspective());
|
139
|
+
|
140
|
+
glBindFramebuffer(GL_FRAMEBUFFER, frameBufferFBO);
|
141
|
+
glViewport(0, 0, windowContext->getSize().x, windowContext->getSize().y);
|
142
|
+
|
143
|
+
glEnable(GL_DEPTH_TEST);
|
144
|
+
// actor->Renderer(getViewPerspective());
|
145
|
+
|
146
|
+
glDepthFunc(GL_LEQUAL);
|
147
|
+
|
148
|
+
actor->Renderer(getViewOrthographic());
|
149
|
+
|
150
|
+
|
151
|
+
// actor->Renderer(getViewPerspective());
|
152
|
+
glDepthFunc(GL_LESS);
|
153
|
+
|
154
|
+
glBindFramebuffer(GL_FRAMEBUFFER,0);
|
155
|
+
}
|
156
|
+
|
157
|
+
// ##################################### フレームバッファ クリア #####################################
|
158
|
+
void FrameWork::Camera::ClearBuffer()
|
159
|
+
{
|
160
|
+
glEnable(GL_DEPTH_TEST);
|
161
|
+
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
162
|
+
glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO);
|
163
|
+
glClear(GL_DEPTH_BUFFER_BIT);
|
164
|
+
glBindFramebuffer(GL_FRAMEBUFFER, frameBufferFBO);
|
165
|
+
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
166
|
+
//glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
167
|
+
}
|
168
|
+
|
169
|
+
// ##################################### フレームバッファ 描画 #####################################
|
170
|
+
void FrameWork::Camera::RendererBuffer()
|
171
|
+
{
|
172
|
+
|
173
|
+
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
174
|
+
|
175
|
+
glBindVertexArray(quadVAO);
|
176
|
+
glBindBuffer(GL_ARRAY_BUFFER, quadVBO);
|
177
|
+
shader->setEnable();
|
178
|
+
|
179
|
+
glBindFramebuffer(GL_READ_FRAMEBUFFER, frameBuffer);
|
180
|
+
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, colorBufferFBO);
|
181
|
+
glBlitFramebuffer(0, 0, windowContext->getSize().x, windowContext->getSize().y, 0, 0, windowContext->getSize().x, windowContext->getSize().y, GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
182
|
+
|
183
|
+
|
184
|
+
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
185
|
+
shader->setUniformSampler2D("screenTexture", 0,colorBufferFBO);
|
186
|
+
glDrawArrays(GL_TRIANGLES,0,6);
|
187
|
+
|
188
|
+
shader->setDisable();
|
189
|
+
glBindVertexArray(0);
|
190
|
+
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
191
|
+
|
192
|
+
}
|
193
|
+
|
97
|
-
```
|
194
|
+
```
|
98
|
-
|
99
|
-
#####
|
195
|
+
##### Title.hpp
|
196
|
+
```
|
197
|
+
#include "Title.hpp"
|
198
|
+
#include <FrameWork.hpp>
|
199
|
+
#include "Title_Menu.hpp"
|
200
|
+
|
201
|
+
Title::Title() : Scene(Scene::SceneType::Title)
|
202
|
+
{
|
203
|
+
title = std::make_shared<Title_Menu>();
|
204
|
+
camera = std::make_unique<FrameWork::Camera>();
|
205
|
+
|
206
|
+
}
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
void Title::Update()
|
211
|
+
{
|
212
|
+
//title->Update();
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
}
|
219
|
+
|
220
|
+
void Title::Renderer()
|
221
|
+
{
|
222
|
+
camera->ClearBuffer();
|
223
|
+
|
224
|
+
camera->View(title);
|
225
|
+
|
226
|
+
|
227
|
+
camera->RendererBuffer();
|
228
|
+
|
229
|
+
}
|
230
|
+
|
231
|
+
|
232
|
+
void Title::Loop()
|
233
|
+
{
|
234
|
+
Update();
|
235
|
+
Renderer();
|
236
|
+
}
|
237
|
+
|
238
|
+
```
|
239
|
+
##### Title_menu
|
100
240
|
```cpp
|
101
241
|
#include "Title_Menu.hpp"
|
102
242
|
#include "Layer.hpp"
|
@@ -105,7 +245,7 @@
|
|
105
245
|
|
106
246
|
Title_Menu::Title_Menu() : Actor()
|
107
247
|
{
|
108
|
-
|
248
|
+
renderer = std::make_shared<FrameWork::Text>();
|
109
249
|
layer = std::make_shared<Layer>(glm::ivec2(18,32),25);
|
110
250
|
|
111
251
|
//layer->setCharacter(glm::ivec2(0,0),'A');
|
@@ -117,70 +257,30 @@
|
|
117
257
|
void Title_Menu::Update()
|
118
258
|
{
|
119
259
|
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
120
267
|
}
|
121
268
|
|
122
269
|
void Title_Menu::Renderer(const glm::mat4 view)const
|
123
270
|
{
|
124
|
-
|
271
|
+
/*
|
272
|
+
for (int y = 0; y < layer->getSize().y; y++)
|
273
|
+
{
|
274
|
+
for (int x = 0; x < layer->getSize().x; x++)
|
275
|
+
{
|
276
|
+
renderer->Renderer(view,glm::ivec2(x * 25, y * 25),layer->getCharacter(glm::ivec2(x,y)).getTexture());
|
125
|
-
}
|
277
|
+
}
|
126
|
-
|
278
|
+
}
|
279
|
+
|
280
|
+
*/
|
281
|
+
}
|
282
|
+
|
127
|
-
```
|
283
|
+
```
|
128
|
-
##### Bクラス内部
|
129
|
-
```cpp
|
130
|
-
#include "Edit.hpp"
|
131
|
-
#include "Canvas_Mng.hpp"
|
132
|
-
#include "MenuBar_Mng.hpp"
|
133
|
-
#include "Control.hpp"
|
134
|
-
#include "Scene.hpp"
|
135
|
-
|
136
|
-
|
137
|
-
Edit::Edit() : Scene(Scene::SceneType::Edit)
|
138
|
-
{
|
139
|
-
camera = std::make_shared<FrameWork::Camera>();
|
140
|
-
|
141
|
-
control = std::make_shared<Control>();
|
142
|
-
canvas_Mng = std::make_shared<Canvas_Mng>();
|
143
|
-
menu_bar_Mng = std::make_shared<MenuBar_Mng>();
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
menu_bar_Mng->setControl(control);
|
148
|
-
control->setCanvas_Mng(canvas_Mng);
|
149
|
-
canvas_Mng->setControl(control);
|
150
|
-
}
|
151
|
-
|
152
|
-
void Edit::Update()
|
153
|
-
{
|
154
|
-
|
155
|
-
control->Update();
|
156
|
-
canvas_Mng->Update();
|
157
|
-
menu_bar_Mng->Update();
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
}
|
162
|
-
|
163
|
-
void Edit::Renderer()
|
164
|
-
{
|
165
|
-
camera->ClearBuffer();
|
166
|
-
|
167
|
-
|
168
|
-
camera->View(control);
|
169
|
-
camera->View(canvas_Mng);
|
170
|
-
camera->View(menu_bar_Mng);
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
camera->RendererBuffer();
|
175
|
-
}
|
176
|
-
|
177
|
-
void Edit::Loop()
|
178
|
-
{
|
179
|
-
Update();
|
180
|
-
Renderer();
|
181
|
-
}
|
182
|
-
```
|
183
|
-
|
184
284
|
##### Layer
|
185
285
|
```cpp
|
186
286
|
#include "Layer.hpp"
|
@@ -213,16 +313,21 @@
|
|
213
313
|
std::vector<Character> ch;
|
214
314
|
for (int x = 0; x < s.x - size.x; x++)
|
215
315
|
{
|
216
|
-
|
217
316
|
ch.push_back(Character(glm::ivec2(size.x + x, size.y + y),pixelSize));
|
218
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
219
|
-
ch.back().setCharacter(' ');
|
220
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
221
317
|
}
|
222
|
-
|
223
318
|
character.push_back(ch);
|
224
319
|
}
|
320
|
+
|
321
|
+
for (int y = size.y; y < s.y; y++)
|
322
|
+
{
|
323
|
+
for (int x = size.x; x < s.x; x++)
|
324
|
+
{
|
325
|
+
character.at(y).at(x).setCharacter(' ');
|
326
|
+
}
|
327
|
+
}
|
225
328
|
}
|
329
|
+
|
330
|
+
|
226
331
|
|
227
332
|
size = s;
|
228
333
|
}
|
@@ -256,95 +361,7 @@
|
|
256
361
|
|
257
362
|
```
|
258
363
|
|
259
|
-
|
364
|
+
|
260
|
-
|
365
|
+
|
261
|
-
|
262
|
-
|
366
|
+
|
263
|
-
|
367
|
+
|
264
|
-
character = ch;
|
265
|
-
DeleteCharacterTexture(texture);
|
266
|
-
texture = FrameWork::GenCharacterTexture("Asset/font/PressStart2P.ttf", pixelSize, FrameWork::GetRGBAColor(glm::vec4(0, 255, 0, 255)), "%c",ch);
|
267
|
-
}
|
268
|
-
|
269
|
-
void Character::Resize(int pixel)
|
270
|
-
{
|
271
|
-
|
272
|
-
pixelSize = pixel;
|
273
|
-
DeleteCharacterTexture(texture);
|
274
|
-
texture = FrameWork::GenCharacterTexture("Asset/font/PressStart2P.ttf", pixelSize, FrameWork::GetRGBAColor(glm::vec4(0, 255, 0, 255)), "%c", character);
|
275
|
-
}
|
276
|
-
|
277
|
-
```
|
278
|
-
|
279
|
-
##### Character
|
280
|
-
```cpp
|
281
|
-
#include "Character.hpp"
|
282
|
-
|
283
|
-
Character::Character(glm::vec2 pos,int pixel)
|
284
|
-
{
|
285
|
-
position = pos;
|
286
|
-
character = '\0';
|
287
|
-
pixelSize = pixel;
|
288
|
-
}
|
289
|
-
|
290
|
-
void Character::setCharacter(const char ch)
|
291
|
-
{
|
292
|
-
character = ch;
|
293
|
-
DeleteCharacterTexture(texture);
|
294
|
-
texture = FrameWork::GenCharacterTexture("Asset/font/PressStart2P.ttf", pixelSize, FrameWork::GetRGBAColor(glm::vec4(0, 255, 0, 255)), "%c",ch);
|
295
|
-
}
|
296
|
-
|
297
|
-
void Character::Resize(int pixel)
|
298
|
-
{
|
299
|
-
pixelSize = pixel;
|
300
|
-
DeleteCharacterTexture(texture);
|
301
|
-
texture = FrameWork::GenCharacterTexture("Asset/font/PressStart2P.ttf", pixelSize, FrameWork::GetRGBAColor(glm::vec4(0, 255, 0, 255)), "%c", character);
|
302
|
-
}
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
glm::ivec2 Character::getPosition()
|
307
|
-
{
|
308
|
-
return position;
|
309
|
-
}
|
310
|
-
|
311
|
-
FrameWork::CharacterTexture* Character::getTexture()
|
312
|
-
{
|
313
|
-
return &texture;
|
314
|
-
}
|
315
|
-
|
316
|
-
|
317
|
-
void Character::Update()
|
318
|
-
{
|
319
|
-
|
320
|
-
}
|
321
|
-
|
322
|
-
void Character::Renderer(const glm::ivec2 pos,const glm::mat4 view)const
|
323
|
-
{
|
324
|
-
switch(character)
|
325
|
-
{
|
326
|
-
|
327
|
-
case 0x28: // (
|
328
|
-
{
|
329
|
-
|
330
|
-
}
|
331
|
-
break;
|
332
|
-
|
333
|
-
case 0x29: // )
|
334
|
-
{
|
335
|
-
|
336
|
-
}
|
337
|
-
break;
|
338
|
-
|
339
|
-
|
340
|
-
default:
|
341
|
-
{
|
342
|
-
|
343
|
-
}
|
344
|
-
break;
|
345
|
-
|
346
|
-
}
|
347
|
-
}
|
348
|
-
```
|
349
|
-
|
350
|
-
|
8
文章を修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
glGetError: 0x502が発生する原因が知りたい。
|
test
CHANGED
File without changes
|
7
タイトルを修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
同じクラスでもエラーになる
|
1
|
+
同じクラスでもエラーになる原因が知りいたい。
|
test
CHANGED
File without changes
|
6
タグを修正
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
5
タイトルを修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
同じクラスでも
|
1
|
+
同じクラスでもエラーになる時とそうじゃない時の原因が知りたい
|
test
CHANGED
File without changes
|
4
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -276,93 +276,75 @@
|
|
276
276
|
|
277
277
|
```
|
278
278
|
|
279
|
-
#####
|
280
|
-
```cpp
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
face->glyph->bitmap.buffer
|
352
|
-
);
|
353
|
-
|
354
|
-
//テクスチャタイプを設定
|
355
|
-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
356
|
-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
357
|
-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
358
|
-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
359
|
-
glBindTexture(GL_TEXTURE_2D, 0);
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
return ch;
|
364
|
-
}
|
365
|
-
|
366
|
-
```
|
367
|
-
|
368
|
-
|
279
|
+
##### Character
|
280
|
+
```cpp
|
281
|
+
#include "Character.hpp"
|
282
|
+
|
283
|
+
Character::Character(glm::vec2 pos,int pixel)
|
284
|
+
{
|
285
|
+
position = pos;
|
286
|
+
character = '\0';
|
287
|
+
pixelSize = pixel;
|
288
|
+
}
|
289
|
+
|
290
|
+
void Character::setCharacter(const char ch)
|
291
|
+
{
|
292
|
+
character = ch;
|
293
|
+
DeleteCharacterTexture(texture);
|
294
|
+
texture = FrameWork::GenCharacterTexture("Asset/font/PressStart2P.ttf", pixelSize, FrameWork::GetRGBAColor(glm::vec4(0, 255, 0, 255)), "%c",ch);
|
295
|
+
}
|
296
|
+
|
297
|
+
void Character::Resize(int pixel)
|
298
|
+
{
|
299
|
+
pixelSize = pixel;
|
300
|
+
DeleteCharacterTexture(texture);
|
301
|
+
texture = FrameWork::GenCharacterTexture("Asset/font/PressStart2P.ttf", pixelSize, FrameWork::GetRGBAColor(glm::vec4(0, 255, 0, 255)), "%c", character);
|
302
|
+
}
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
glm::ivec2 Character::getPosition()
|
307
|
+
{
|
308
|
+
return position;
|
309
|
+
}
|
310
|
+
|
311
|
+
FrameWork::CharacterTexture* Character::getTexture()
|
312
|
+
{
|
313
|
+
return &texture;
|
314
|
+
}
|
315
|
+
|
316
|
+
|
317
|
+
void Character::Update()
|
318
|
+
{
|
319
|
+
|
320
|
+
}
|
321
|
+
|
322
|
+
void Character::Renderer(const glm::ivec2 pos,const glm::mat4 view)const
|
323
|
+
{
|
324
|
+
switch(character)
|
325
|
+
{
|
326
|
+
|
327
|
+
case 0x28: // (
|
328
|
+
{
|
329
|
+
|
330
|
+
}
|
331
|
+
break;
|
332
|
+
|
333
|
+
case 0x29: // )
|
334
|
+
{
|
335
|
+
|
336
|
+
}
|
337
|
+
break;
|
338
|
+
|
339
|
+
|
340
|
+
default:
|
341
|
+
{
|
342
|
+
|
343
|
+
}
|
344
|
+
break;
|
345
|
+
|
346
|
+
}
|
347
|
+
}
|
348
|
+
```
|
349
|
+
|
350
|
+
|
3
タイトルを修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
同じクラスでも使うクラスによってエラーになる原因が知りたい。
|
test
CHANGED
File without changes
|
2
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,6 +16,15 @@
|
|
16
16
|
0x502: 現在のステートで無効な操作をしている場合、もしくは廃止された関数を呼び出した場合(*1)
|
17
17
|
```
|
18
18
|
|
19
|
+
利用ライブラリ:
|
20
|
+
opengl
|
21
|
+
freetype
|
22
|
+
glew
|
23
|
+
glfw
|
24
|
+
stbi
|
25
|
+
|
26
|
+
|
27
|
+
ソースコード全文: https://github.com/Shigurechan/AAEditor/tree/e0db42df3945fc1e1ea9879e2746ffe5eeedf9f2
|
19
28
|
|
20
29
|
|
21
30
|
##### Entry
|
1
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
提示コードEntryコンストラクタ部ですがA,Bの中身は提示の通りです。
|
8
8
|
Aクラスをコメントアウトするとエラーが出ません。普通に動きます
|
9
9
|
AをコメントアウトしないでBクラスのcamra->RendererBuffer();関数をコメントアウトすると動きます。
|
10
|
-
|
10
|
+
Aクラスのコンストラクタ部のlayer変数部をコメントアウトすると普通に動きます。
|
11
11
|
|
12
12
|
|
13
13
|
glGetError: https://qiita.com/_ydah/items/da56763e94ba58af3d91
|