SDL_Surface *surf = IMG_Load(filename);
if (surf == nullptr) {
fprintf(stderr, "IMG_Load(%s): %s\n", filename, IMG_GetError());
SDL_Surface *surf = IMG_Load(filename);
if (surf == nullptr) {
fprintf(stderr, "IMG_Load(%s): %s\n", filename, IMG_GetError());
SDL_Surface *rgb_surf = SDL_ConvertSurfaceFormat(surf, SDL_PIXELFORMAT_RGBA32, /*flags=*/0);
if (rgb_surf == nullptr) {
fprintf(stderr, "SDL_ConvertSurfaceFormat(%s): %s\n", filename, SDL_GetError());
SDL_Surface *rgb_surf = SDL_ConvertSurfaceFormat(surf, SDL_PIXELFORMAT_RGBA32, /*flags=*/0);
if (rgb_surf == nullptr) {
fprintf(stderr, "SDL_ConvertSurfaceFormat(%s): %s\n", filename, SDL_GetError());
if (width1 != width2 || height1 != height2) {
fprintf(stderr, "Image dimensions don't match (%dx%d versus %dx%d)\n",
width1, height1, width2, height2);
if (width1 != width2 || height1 != height2) {
fprintf(stderr, "Image dimensions don't match (%dx%d versus %dx%d)\n",
width1, height1, width2, height2);
if (width != width1 || height != height1) {
fprintf(stderr, "%s: Image dimensions don't match (%dx%d versus %dx%d)\n",
filename0, width, height, width1, height1);
if (width != width1 || height != height1) {
fprintf(stderr, "%s: Image dimensions don't match (%dx%d versus %dx%d)\n",
filename0, width, height, width1, height1);
}
glCopyImageSubData(tex0, GL_TEXTURE_2D, 0, 0, 0, 0, image_tex, GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, width1, height1, 1);
glDeleteTextures(1, &tex0);
}
glCopyImageSubData(tex0, GL_TEXTURE_2D, 0, 0, 0, 0, image_tex, GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, width1, height1, 1);
glDeleteTextures(1, &tex0);
if (width != width1 || height != height1) {
fprintf(stderr, "%s: Image dimensions don't match (%dx%d versus %dx%d)\n",
filename1, width, height, width1, height1);
if (width != width1 || height != height1) {
fprintf(stderr, "%s: Image dimensions don't match (%dx%d versus %dx%d)\n",
filename1, width, height, width1, height1);
}
glCopyImageSubData(tex1, GL_TEXTURE_2D, 0, 0, 0, 0, image_tex, GL_TEXTURE_2D_ARRAY, 0, 0, 0, 1, width1, height1, 1);
glDeleteTextures(1, &tex1);
}
glCopyImageSubData(tex1, GL_TEXTURE_2D, 0, 0, 0, 0, image_tex, GL_TEXTURE_2D_ARRAY, 0, 0, 0, 1, width1, height1, 1);
glDeleteTextures(1, &tex1);
if (width1 != width2 || height1 != height2) {
fprintf(stderr, "Image dimensions don't match (%dx%d versus %dx%d)\n",
width1, height1, width2, height2);
if (width1 != width2 || height1 != height2) {
fprintf(stderr, "Image dimensions don't match (%dx%d versus %dx%d)\n",
width1, height1, width2, height2);
};
}
if (SDL_Init(SDL_INIT_EVERYTHING) == -1) {
fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
};
}
if (SDL_Init(SDL_INIT_EVERYTHING) == -1) {
fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
}
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
}
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);