I could be off base here but are you sure the texture is even getting stored in the map? By the looks of your loadTexture function you are storing a local variable that will be destroyed when the function returns so when you try to access the data it is actually invalid memory because nothing is there. I could be wrong as I am not sure how SDL_CreateTextureFromSurface operates it might actually malloc memory not sure. It is just a thought to look into because a segfault is actually caused by accessing invalid (bad) memory. So the first place I would look is to make sure the texture is actually being stored properly.
blewisjrMember Since 11 Apr 2006
Offline Last Active Jul 09 2014 04:15 PM
I am 25 years old and involved in hobby software development while attending school for Information Systems Security.
- Group Members
- Active Posts 479
- Profile Views 7,377
- Submitted Links 0
- Member Title GDNet+
- Age 28 years old
- Birthday May 29, 1986
Has had an item featured
blewisjr hasn't added any contacts yet.