Homebrew [Release] {beta} sf2dlib - Simple and Fast 2D library (using the GPU)

MRJPGames

Pretty great guy
Member
Joined
Aug 17, 2013
Messages
1,198
Trophies
0
Location
The Netherlands
Website
fizazy.com
XP
1,641
Country
Netherlands
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):
Code:
sf2d_draw_texture_scale(gol.getMapTexture(), -mapX, -mapY, scale, scale);
In GoL.h this is how the texture is initialised (as a local variable/pointer):
Code:
sf2d_texture *tex_map = sfil_load_PNG_file("romfs:/template.png", SF2D_PLACE_RAM);
And last but not least here is the function getMapTexture():
Code:
sf2d_texture *GoL::getMapTexture(){
    return tex_map;
}
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?
 

Manurocker95

Game Developer & Pokémon Master
Member
Joined
May 29, 2016
Messages
1,515
Trophies
0
Age
28
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,602
Country
Spain
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):
Code:
sf2d_draw_texture_scale(gol.getMapTexture(), -mapX, -mapY, scale, scale);
In GoL.h this is how the texture is initialised (as a local variable/pointer):
Code:
sf2d_texture *tex_map = sfil_load_PNG_file("romfs:/template.png", SF2D_PLACE_RAM);
And last but not least here is the function getMapTexture():
Code:
sf2d_texture *GoL::getMapTexture(){
    return tex_map;
}
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?

Tex_map pointer is not saved in gol object. U should have a variable where u save the pointer u r trying to access on getmaptexture
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • SylverReZ @ SylverReZ:
    Hope they made lots of spaget
  • K3N1 @ K3N1:
    Chill dog
  • SylverReZ @ SylverReZ:
    Chilli dog
  • Skelletonike @ Skelletonike:
    Damn, I'm loving the new zelda.
  • xtremegamer @ xtremegamer:
    loving the new zelda, i started a game, it was so fucking good, so i
    am waiting on my friend to get home so we can start a new one together
  • Skelletonike @ Skelletonike:
    I just dislike that they don't let me choose the voices before the game starts. Happened with botw as well, had to change to japanese and restart.
  • K3N1 @ K3N1:
    But the important question is can you choose gender
  • Skelletonike @ Skelletonike:
    Same way you can choose Gerald's gender.
  • Skelletonike @ Skelletonike:
    *Geralt, damn autocorrect.
  • Psionic Roshambo @ Psionic Roshambo:
    But can he be trans? Lol
  • K3N1 @ K3N1:
    Zelda transforms into link
  • Psionic Roshambo @ Psionic Roshambo:
    Link I'm not the princess your looking for.... *Pulls a crying game*
  • K3N1 @ K3N1:
    *skirt up* it's exactly what I always wanted
  • Skelletonike @ Skelletonike:
    Just scanned all my zelda amiibos, took a while but didn't get anything that cool, did get the lon lon ranch hylian fabrics though.
  • Skelletonike @ Skelletonike:
    It was pretty funny when I scanned wolf link and got a shit load of meat.
  • K3N1 @ K3N1:
    @Skelletonike, btw I ran that custom for mgs4 on the deck I'm amazed it got that far in game
  • K3N1 @ K3N1:
    Plug in*
  • K3N1 @ K3N1:
    Your favorite activity
  • BentlyMods @ BentlyMods:
    My fav actvity is:

    mario-dancing.gif
  • Psionic Roshambo @ Psionic Roshambo:
    Do the Mario lol
  • K3N1 @ K3N1:
    🍑
  • K3N1 @ K3N1:
    Whoever developed Bramble was smoking that good shit fucking gnomes
    K3N1 @ K3N1: Whoever developed Bramble was smoking that good shit fucking gnomes