質問編集履歴
3
文章を修正しました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
glDeleteTexture
|
1
|
+
OpenGL どこでglDeleteTexture();関数を置けばいいかわからない。
|
test
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
+
以下のコードですが以下コンストラクタ部のfor文ループが原因でメモリリークしてしまうのですがこれはどうすればいいのでしょか?
|
2
|
+
|
3
|
+
for文の最後にglDeleteTexture();関数を置くとバインドしてテクスチャを削除してしまうので描画されなくなります。またデストラクタの置くと
|
4
|
+
|
1
|
-
|
5
|
+
メモリリークしてしまいます。試しにglDeleteTexture(128,&texture)としましたがやはりメモリリークしていします。これはどうやって防いだらいいのでしょうか?色々試したがその時のコードは消してしまいました。
|
2
6
|
|
3
7
|
|
4
8
|
|
@@ -40,344 +44,360 @@
|
|
40
44
|
|
41
45
|
// シェーダープログラム
|
42
46
|
|
43
|
-
// ShaderProgram = new Shader(g, "Shader/2D/Text.vert", "Shader/2D/Text.frag");
|
44
|
-
|
45
|
-
ShaderProgram = std::make_unique<Shader>(g,"Shader/2D/Text.vert","Shader/2D/Text.frag");
|
47
|
+
ShaderProgram = std::make_unique<Shader>(g, "Shader/2D/Text.vert", "Shader/2D/Text.frag");
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
FT_Error fe[100] = { 0 }; //エラー配列
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
//FreeTypeを初期化
|
56
|
+
|
57
|
+
fe[0] = FT_Init_FreeType(&ft);
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
//利用フォント
|
62
|
+
|
63
|
+
std::string font_name = "C:/Windows/Fonts/msgothic.ttc";
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
//フォントを読み込む
|
68
|
+
|
69
|
+
fe[1] = FT_New_Face(ft, font_name.c_str(), 0, &face);
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
//ピクセルの大きさを指定する。
|
74
|
+
|
75
|
+
fe[2] = FT_Set_Pixel_Sizes(face, 0, 25);
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
//ピクセルストレージモードを設定する
|
80
|
+
|
81
|
+
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
// エラー表示
|
86
|
+
|
87
|
+
printf("%d\n", fe[0]);
|
88
|
+
|
89
|
+
printf("%d\n", fe[1]);
|
90
|
+
|
91
|
+
printf("%d\n", fe[2]);
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
100
|
+
|
101
|
+
//128文字のASCIIを読み込み
|
102
|
+
|
103
|
+
for (unsigned char c = 0; c < 128; c++)
|
104
|
+
|
105
|
+
{
|
106
|
+
|
107
|
+
//テクスチャをバインド
|
108
|
+
|
109
|
+
glGenTextures(1, &texture);
|
110
|
+
|
111
|
+
glBindTexture(GL_TEXTURE_2D, texture);
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
// 文字のグリフをロードする
|
118
|
+
|
119
|
+
if (FT_Load_Char(face, c, FT_LOAD_RENDER))
|
120
|
+
|
121
|
+
{
|
122
|
+
|
123
|
+
std::cout << "ERROR::FREETYTPE: Failed to load Glyph" << std::endl;
|
124
|
+
|
125
|
+
continue;
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
glTexImage2D(
|
134
|
+
|
135
|
+
GL_TEXTURE_2D,
|
136
|
+
|
137
|
+
0,
|
138
|
+
|
139
|
+
GL_RED,
|
140
|
+
|
141
|
+
face->glyph->bitmap.width,
|
142
|
+
|
143
|
+
face->glyph->bitmap.rows,
|
144
|
+
|
145
|
+
0,
|
146
|
+
|
147
|
+
GL_RED,
|
148
|
+
|
149
|
+
GL_UNSIGNED_BYTE,
|
150
|
+
|
151
|
+
face->glyph->bitmap.buffer
|
152
|
+
|
153
|
+
);
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
//テクスチャ設定
|
158
|
+
|
159
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
160
|
+
|
161
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
162
|
+
|
163
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
164
|
+
|
165
|
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
//現在の文字情報を格納
|
170
|
+
|
171
|
+
Character character = {
|
172
|
+
|
173
|
+
texture,
|
174
|
+
|
175
|
+
glm::ivec2(face->glyph->bitmap.width, face->glyph->bitmap.rows),
|
176
|
+
|
177
|
+
glm::ivec2(face->glyph->bitmap_left, face->glyph->bitmap_top),
|
178
|
+
|
179
|
+
static_cast<unsigned int>(face->glyph->advance.x)
|
180
|
+
|
181
|
+
};
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
Characters.insert(std::pair<char, Character>(c, character));
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
//glBindTexture(GL_TEXTURE_2D, 0);
|
194
|
+
|
195
|
+
}
|
196
|
+
|
197
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
198
|
+
|
199
|
+
//FreeTypeの終了処理
|
200
|
+
|
201
|
+
FT_Done_Face(face);
|
202
|
+
|
203
|
+
FT_Done_FreeType(ft);
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
//VAO
|
208
|
+
|
209
|
+
glGenVertexArrays(1, &VAO);
|
210
|
+
|
211
|
+
glBindVertexArray(VAO);
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
//VBO
|
216
|
+
|
217
|
+
glGenBuffers(1, &VBO);
|
218
|
+
|
219
|
+
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
//
|
224
|
+
|
225
|
+
glEnableVertexAttribArray(0);
|
226
|
+
|
227
|
+
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 6 * 4, NULL, GL_DYNAMIC_DRAW);
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
//
|
232
|
+
|
233
|
+
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0);
|
234
|
+
|
235
|
+
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
//文字を表示
|
244
|
+
|
245
|
+
void Text::RenderText(float x, float y, float scale, glm::vec3 color, const char* format, ...)
|
246
|
+
|
247
|
+
{
|
248
|
+
|
249
|
+
//文字を生成
|
250
|
+
|
251
|
+
std::string text; //生成した文字を格納
|
252
|
+
|
253
|
+
va_list ap;
|
254
|
+
|
255
|
+
char str[10000];
|
256
|
+
|
257
|
+
va_start(ap, format);
|
258
|
+
|
259
|
+
vsprintf_s(str, sizeof(str), format, ap);
|
260
|
+
|
261
|
+
va_end(ap);
|
262
|
+
|
263
|
+
text = std::string(str);
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
//シェーダー
|
270
|
+
|
271
|
+
ShaderProgram->Enable(); //アクティブにする
|
272
|
+
|
273
|
+
ShaderProgram->SetFloatUniform_3m("uViewMatrix", Transform_2D::getViewMatrix()); //ビュー行列
|
274
|
+
|
275
|
+
ShaderProgram->SetFloatUniform_3m("uWorldMatrix", Transform_2D::getWorldMatrix()); //ワール行列
|
276
|
+
|
277
|
+
ShaderProgram->SetFloatUniform_3f("uTextColor", color); //色を設定 RGB
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
Transform_2D::setTransform_Move(glm::vec2(x, y)); //座標
|
282
|
+
|
283
|
+
Transform_2D::UpdateTransform(); //
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
glActiveTexture(GL_TEXTURE0);
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
std::string::const_iterator itr;
|
292
|
+
|
293
|
+
for (itr = text.begin(); itr != text.end(); itr++)
|
294
|
+
|
295
|
+
{
|
296
|
+
|
297
|
+
Character ch = (Character)Characters[*itr];
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
float w = ch.Size.x * scale;
|
302
|
+
|
303
|
+
float h = ch.Size.y * scale;
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
float xpos = (x + (ch.Bearing.x * scale));
|
308
|
+
|
309
|
+
float ypos = (y - ((ch.Size.y - ch.Bearing.y) * scale));
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
//頂点情報を書き換え
|
314
|
+
|
315
|
+
float vertices[6][4] = {
|
316
|
+
|
317
|
+
{ xpos , ypos + h, 0.0f, 0.0f },
|
318
|
+
|
319
|
+
{ xpos, ypos, 0.0f, 1.0f },
|
320
|
+
|
321
|
+
{ xpos + w, ypos, 1.0f, 1.0f },
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
{ xpos, ypos + h, 0.0f, 0.0f },
|
326
|
+
|
327
|
+
{ xpos + w, ypos, 1.0f, 1.0f },
|
328
|
+
|
329
|
+
{ xpos + w, ypos + h, 1.0f, 0.0f }
|
330
|
+
|
331
|
+
};
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
//テクスチャを設定
|
340
|
+
|
341
|
+
glBindTexture(GL_TEXTURE_2D, ch.TextureID);
|
342
|
+
|
343
|
+
glBindVertexArray(VAO);
|
344
|
+
|
345
|
+
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
346
|
+
|
347
|
+
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices); //
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
// ポリゴンをレンダリング
|
356
|
+
|
357
|
+
glDrawArrays(GL_TRIANGLES, 0, 6);
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
x += (ch.Advance >> 6) * scale; // 次のグリフにカーソルを進める
|
364
|
+
|
365
|
+
}
|
366
|
+
|
367
|
+
|
46
368
|
|
47
369
|
|
48
370
|
|
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
|
-
fe[2] = FT_Set_Pixel_Sizes(face, 0, 25);
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
//ピクセルストレージモードを設定する
|
78
|
-
|
79
|
-
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
//128文字のASCIIを読み込み
|
84
|
-
|
85
|
-
for (unsigned char c = 0; c < 128; c++)
|
86
|
-
|
87
|
-
{
|
88
|
-
|
89
|
-
// 文字のグリフをロードする
|
90
|
-
|
91
|
-
if (FT_Load_Char(face, c, FT_LOAD_RENDER))
|
92
|
-
|
93
|
-
{
|
94
|
-
|
95
|
-
std::cout << "ERROR::FREETYTPE: Failed to load Glyph" << std::endl;
|
96
|
-
|
97
|
-
continue;
|
98
|
-
|
99
|
-
}
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
//テクスチャを生成する
|
104
|
-
|
105
|
-
glGenTextures(1, &texture);/////////////////////////////////////////////////////
|
106
|
-
|
107
|
-
glBindTexture(GL_TEXTURE_2D, texture);
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
glTexImage2D(
|
112
|
-
|
113
|
-
GL_TEXTURE_2D,
|
114
|
-
|
115
|
-
0,
|
116
|
-
|
117
|
-
GL_RED,
|
118
|
-
|
119
|
-
face->glyph->bitmap.width,
|
120
|
-
|
121
|
-
face->glyph->bitmap.rows,
|
122
|
-
|
123
|
-
0,
|
124
|
-
|
125
|
-
GL_RED,
|
126
|
-
|
127
|
-
GL_UNSIGNED_BYTE,
|
128
|
-
|
129
|
-
face->glyph->bitmap.buffer
|
130
|
-
|
131
|
-
);
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
//テクスチャ設定
|
136
|
-
|
137
|
-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
138
|
-
|
139
|
-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
140
|
-
|
141
|
-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
142
|
-
|
143
|
-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
//現在の文字情報を格納
|
148
|
-
|
149
|
-
Character character = {
|
150
|
-
|
151
|
-
texture,
|
152
|
-
|
153
|
-
glm::ivec2(face->glyph->bitmap.width, face->glyph->bitmap.rows),
|
154
|
-
|
155
|
-
glm::ivec2(face->glyph->bitmap_left, face->glyph->bitmap_top),
|
156
|
-
|
157
|
-
static_cast<unsigned int>(face->glyph->advance.x)
|
158
|
-
|
159
|
-
};
|
160
|
-
|
161
|
-
Characters.insert(std::pair<char, Character>(c, character));
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
glBindTexture(GL_TEXTURE_2D, 0);
|
166
|
-
|
167
|
-
}
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
//FreeTypeの終了処理
|
172
|
-
|
173
|
-
FT_Done_Face(face);
|
174
|
-
|
175
|
-
FT_Done_FreeType(ft);
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
glGenVertexArrays(1, &VAO);
|
182
|
-
|
183
|
-
glBindVertexArray(VAO);
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
glGenBuffers(1, &VBO);
|
190
|
-
|
191
|
-
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
glEnableVertexAttribArray(0);
|
196
|
-
|
197
|
-
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 6 * 4, NULL, GL_DYNAMIC_DRAW);
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0);
|
371
|
+
|
372
|
+
|
373
|
+
}
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
Text::~Text()
|
380
|
+
|
381
|
+
{
|
382
|
+
|
383
|
+
glBindTexture(GL_TEXTURE_2D, 0);
|
384
|
+
|
385
|
+
glDeleteTextures(1, &texture);
|
386
|
+
|
387
|
+
// glDeleteTextures(1, &texture);
|
388
|
+
|
389
|
+
|
202
390
|
|
203
391
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
204
392
|
|
205
|
-
|
393
|
+
glDeleteBuffers(1, &VBO);
|
206
|
-
|
207
|
-
|
208
|
-
|
394
|
+
|
395
|
+
|
396
|
+
|
209
|
-
|
397
|
+
glBindVertexArray(0);
|
398
|
+
|
399
|
+
glDeleteVertexArrays(1, &VAO);
|
210
400
|
|
211
401
|
}
|
212
402
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
//文字を表示
|
218
|
-
|
219
|
-
void Text::RenderText(float x, float y, float scale, glm::vec3 color, const char* format, ...)
|
220
|
-
|
221
|
-
{
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
float xx = (-SCREEN_WIDTH / 2) + x;
|
226
|
-
|
227
|
-
float yy= (SCREEN_HEIGHT / 2) - y;
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
//文字を生成
|
232
|
-
|
233
|
-
std::string text; //生成した文字を格納
|
234
|
-
|
235
|
-
va_list ap;
|
236
|
-
|
237
|
-
char str[10000];
|
238
|
-
|
239
|
-
va_start(ap, format);
|
240
|
-
|
241
|
-
vsprintf_s(str, sizeof(str), format, ap);
|
242
|
-
|
243
|
-
va_end(ap);
|
244
|
-
|
245
|
-
text = std::string(str);
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
//シェーダー
|
252
|
-
|
253
|
-
ShaderProgram->Enable(); //アクティブにする
|
254
|
-
|
255
|
-
ShaderProgram->SetFloatUniform_3m("uViewMatrix", Transform_2D::getViewMatrix()); //ビュー行列
|
256
|
-
|
257
|
-
ShaderProgram->SetFloatUniform_3m("uWorldMatrix", Transform_2D::getWorldMatrix()); //ワール行列
|
258
|
-
|
259
|
-
ShaderProgram->SetFloatUniform_3f("uTextColor", color); //色を設定 RGB
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
Transform_2D::setTransform_Move(glm::vec2(x, y));
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
glActiveTexture(GL_TEXTURE0);
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
std::string::const_iterator itr;
|
272
|
-
|
273
|
-
for (itr = text.begin(); itr != text.end(); itr++)
|
274
|
-
|
275
|
-
{
|
276
|
-
|
277
|
-
Character ch = (Character)Characters[*itr];
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
float w = ch.Size.x * scale;
|
282
|
-
|
283
|
-
float h = ch.Size.y * scale;
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
float xpos = (x + (ch.Bearing.x * scale));
|
288
|
-
|
289
|
-
float ypos = (y - ((ch.Size.y - ch.Bearing.y) * scale));
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
//頂点情報を書き換え
|
294
|
-
|
295
|
-
float vertices[6][4] = {
|
296
|
-
|
297
|
-
{ xpos , ypos + h, 0.0f, 0.0f },
|
298
|
-
|
299
|
-
{ xpos, ypos, 0.0f, 1.0f },
|
300
|
-
|
301
|
-
{ xpos + w, ypos, 1.0f, 1.0f },
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
{ xpos, ypos + h, 0.0f, 0.0f },
|
306
|
-
|
307
|
-
{ xpos + w, ypos, 1.0f, 1.0f },
|
308
|
-
|
309
|
-
{ xpos + w, ypos + h, 1.0f, 0.0f }
|
310
|
-
|
311
|
-
};
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
//テクスチャを設定
|
316
|
-
|
317
|
-
glBindTexture(GL_TEXTURE_2D, ch.TextureID);
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
324
|
-
|
325
|
-
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices); //
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
// ポリゴンをレンダリング
|
332
|
-
|
333
|
-
glDrawArrays(GL_TRIANGLES, 0, 6);
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
x += (ch.Advance>> 6) * scale; // 次のグリフにカーソルを進める
|
340
|
-
|
341
|
-
}
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
}
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
Text::~Text()
|
356
|
-
|
357
|
-
{
|
358
|
-
|
359
|
-
glDeleteBuffers(1, &VAO);
|
360
|
-
|
361
|
-
glDeleteVertexArrays(1, &VAO);
|
362
|
-
|
363
|
-
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
364
|
-
|
365
|
-
glDeleteBuffers(1, &VAO);
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
370
|
-
|
371
|
-
glBindVertexArray(0);
|
372
|
-
|
373
|
-
glBindTexture(GL_TEXTURE_2D, 0);
|
374
|
-
|
375
|
-
glDeleteTextures(1, &texture);////////////////////////////
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
}
|
382
|
-
|
383
403
|
```
|
2
文章を修正しました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
gl
|
1
|
+
glDeleteTextures()してもメモリ解放できない。原因と対処方法が知りたい。
|
test
CHANGED
@@ -4,12 +4,6 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
-
※またこのクラスはインスタンスを生成しても文字は表示されません。
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
7
|
|
14
8
|
|
15
9
|
|
1
文章を修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
glDeleteTexture()
|
1
|
+
glGenTextures()したものをglDeleteTextures()してもメモリ解放できない。原因と対処方法が知りたい。
|
test
CHANGED
File without changes
|