- Joined
- Aug 17, 2013
- Messages
- 1,199
- Trophies
- 1
- Location
- The Netherlands
- Website
- fizazy.com
- XP
- 1,686
- Country
Hi, I want to render a texture that is manipulated by another class ("object"). For this is the main rendering code this is done for the specific thing that causes the program to crash (when I used a local texture it worked fine):
In GoL.h this is how the texture is initialised (as a local variable/pointer):
And last but not least here is the function getMapTexture():
It also crashes when I do the sf2d_set_pixel operation from the object itself. Also trying to render it from the object itself also crashes, essentially doing anything with it seems to crash the program for some reason.
Anyone know what is causing this, and if I can fix this and if yes, how?
Code:
sf2d_draw_texture_scale(gol.getMapTexture(), -mapX, -mapY, scale, scale);
Code:
sf2d_texture *tex_map = sfil_load_PNG_file("romfs:/template.png", SF2D_PLACE_RAM);
Code:
sf2d_texture *GoL::getMapTexture(){
return tex_map;
}
Anyone know what is causing this, and if I can fix this and if yes, how?