I write a program to learn english with sdl2 and I want to return a vlue from a function in another function every function have separate window and I want to close window after return this value how ?
I can't do it it's very dificult please help.
this is the code of my function:
int Lrecord::select_mic(SDL_Event* le)
{
int index = 100;
mWindow = SDL_CreateWindow("select mic", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 600, 400, SDL_WINDOW_SHOWN);
if (mWindow == NULL)
printf("window error... %s", SDL_GetError());
SDL_Renderer *srender = SDL_CreateRenderer(mWindow, -1, SDL_RENDERER_ACCELERATED);
if (srender == NULL)
printf("renderer error %s", SDL_GetError());
mWindowID = SDL_GetWindowID(mWindow);
tex1 …