I am trying to make a game engine from SDL but i am having trouble when i run a test program with my engine it freezes but only if i run it on release when i run it on debug it works good.
I get a warning that says text is uninitalized.
i think the problem is in the Load function in texture class.
Here is the header and cpp files.
By the way its only like %.5 done.
Thanks for your help
Texture::Load() valorizes Texture::tex, not text declared on line 66. To put it simply, you're trying to call a function of an object that doesn't exist (which also means that there isn't any tex to hold the texture).
You can either create a Texture object directly, or assign that pointer to a new Texture.
You should also write a ctor that at least initializes tex to nullptr, and a dtor that deletes it. Calling Texture::Destroy() when tex is null is ok, but if it's uninit'd you'll get a segfault. And Texture::Load() should probably check if tex already holds a valid value. If you happen to call it more than once for the same object you'll have a memory leak.