问题
I am trying to make a 2d-map editor. Now if my map is finish I want to save it.
I tried this:
IMG_SavePNG(SDL_GetWindowSurface(window), "C:/Users/<MY_NAME>/Desktop");
but nothing happens. No image get saved and also no error.
Here is the creation of my window:
SDL_Window* window = SDL_CreateWindow("Famonex", 100, 100, WINDOW_WIDTH, WINDOW_HEIGHT, SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
Here are my includes:
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
回答1:
Damn I just failed at the filepath. I forgot the last word: (filename.png).
But now my image is total black :S.
来源:https://stackoverflow.com/questions/23587461/sdl2-saving-image-as-png-error