Merge branch 'master' into 'master'

Fix memory leaks in samples

See merge request simulant/GLdc!69
This commit is contained in:
Luke Benstead 2021-05-14 14:11:03 +00:00
commit 840ac7f0cd
7 changed files with 14 additions and 0 deletions

View File

@ -134,6 +134,8 @@ void LoadGLTextures() {
// 2d texture, level of detail 0 (normal), 3 components (red, green, blue), x size from image, y size from image,
// border 0 (normal), rgb color data, unsigned byte data, and finally the data itself.
glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->sizeX, image1->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->data);
free(image1);
};
/* A general OpenGL initialization function. Sets all of the initial parameters. */

View File

@ -141,6 +141,8 @@ void LoadGLTextures() {
glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->sizeX, image1->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->data);
glGenerateMipmapEXT(GL_TEXTURE_2D);
free(image1);
};

View File

@ -137,6 +137,8 @@ void LoadGLTextures() {
glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->sizeX, image1->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->data);
glGenerateMipmapEXT(GL_TEXTURE_2D);
free(image1);
};
/* A general OpenGL initialization function. Sets all of the initial parameters. */

View File

@ -140,6 +140,8 @@ void LoadGLTextures() {
glTexImage2D(GL_TEXTURE_2D, 0, 3, image1->sizeX, image1->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, image1->data);
glGenerateMipmapEXT(GL_TEXTURE_2D);
free(image1);
};
/* A general OpenGL initialization function. Sets all of the initial parameters. */

View File

@ -156,6 +156,8 @@ void LoadGLTextures() {
GL_TEXTURE_2D, 0, image1->internal_format, image1->sizeX, image1->sizeY, 0,
image1->format, image1->type, image1->data
);
free(image1);
};
/* A general OpenGL initialization function. Sets all of the initial parameters. */

View File

@ -162,6 +162,8 @@ void LoadGLTextures() {
GL_TEXTURE_2D, 0, image1->internalFormat, image1->sizeX, image1->sizeY, 0,
image1->dataSize, image1->data
);
free(image1);
};
/* A general OpenGL initialization function. Sets all of the initial parameters. */

View File

@ -125,6 +125,8 @@ void LoadGLTextures() {
// border 0 (normal), rgb color data, unsigned byte data, and finally the data itself.
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, image1->width, image1->height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE_TWID_KOS, image1->data);
glGenerateMipmapEXT(GL_TEXTURE_2D);
free(image1);
}
/* A general OpenGL initialization function. Sets all of the initial parameters. */