diff --git a/SimpleImageViewer.c b/SimpleImageViewer.c index d06003c..291606a 100644 --- a/SimpleImageViewer.c +++ b/SimpleImageViewer.c @@ -74,7 +74,7 @@ SDL_Window* create_window(const char* title, int w, int h){ SDL_Window* window = SDL_CreateWindow(title, w, h, window_flags); if(!window) error_exit("Failed to create window!"); - if(SDL_SetWindowAspectRatio(window, (float)w / (float)h, (float)w / (float)h)) error_continue("Failed to set window aspect ratio! Continueing..."); + if(SDL_SetWindowAspectRatio(window, (float)w / (float)h, (float)w / (float)h)) error_continue("Failed to set window aspect ratio! Continuing..."); return window; } @@ -298,14 +298,6 @@ int main(int argc, char** argv){ exit(4); } - SDL_Surface* surface = SDL_GetWindowSurface(window); - if(!surface){ - printf("Failed to get surface!"); - SDL_DestroyWindow(window); - free_image_pixels_buffer(&image); - exit(5); - } - if(!populate_image(window, &image)){ printf("Failed to populate image!"); free_image_pixels_buffer(&image);