Problem with SDL_RenderCopy |
Re: Problem with SDL_RenderCopy |
AlexRou
|
bool LoadMedia::CreateTexture()
{ GetRenderer(); MainTexture = SDL_CreateTextureFromSurface(LocalRender, MainSurface); if (MainTexture == NULL) { std::cerr << "Could not create texture from surface! " << SDL_GetError << std::endl; success = false; } else { PushTextureToContainer(); Free(); } return success; } void LoadMedia::Free() { SDL_DestroyTexture(MainTexture); SDL_DestroyTexture(Temp_Texture); SDL_FreeSurface(MainSurface); MainTexture = nullptr; Temp_Texture = nullptr; MainSurface = nullptr; } You are basically creating the texture and then destroying it and passing a invalid pointer to the vector.
|
|||||||||||||||||||||
|
Re: Problem with SDL_RenderCopy |
Progers
|
Thanks a lot AlexRou, i was solving this problem about 2 days, but did not know, that the problem is that simple Thanks again AlexRou |
|||||||||||||||||||||||
|