Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - help me

Pages: [1]
1
Graphics / exception thrown issues
« on: June 26, 2020, 09:40:21 pm »
I was creating this game that requires to control multiple sprite movement, so I created an array player class(Player* player[10];). I write all of the renders and updates and I got thrown an exception in the line:

target.draw(this->sprite);

in my render function inside the Player class

void Player::render(RenderTarget& target)
{
   target.draw(this->sprite);
}
in the game.cpp:
for (int i = 0; i <= c; i++ )//c is the amount of players
   {
      this->player->render(*this->window);
   }

this is the exception:

Unhandled exception at 0x7B81CF29 (sfml-graphics-d-2.dll) in sim.exe: 0xC0000005: Access violation reading location 0x00000008.

and it can't run.
if i comment that line only(target.draw(this->sprite);) it runs as normal but when closed it throws another exception:

sim.exe has triggered a breakpoint

before this happened I didn't make the player class an array and it ran smoothly but tbh I don't know if it will run correctly or not. it has no errors detected and it confuses me how to stop it from running after the exception is thrown(both exceptions).

ps. sorry I didn't post any image I still don't know how

2
General / thrown exception to draw?
« on: June 25, 2020, 09:32:10 pm »
I was planning to make a control multiple sprites game and I know it is risky but I'm risking anyways. So I made the player class in the game.cpp an array and all goes well until an exception is thrown:

Exception thrown at 0x7922CF29 (sfml-graphics-d-2.dll) in sim.exe: 0xC0000005: Access violation reading location 0x00000008.

to

target.draw(this->sprite);

in

void Plane::render(RenderTarget& target)
{
   //target.draw(this->sprite);
}

and if I put the array out of the equation it works as normal. What to do??
and btw if I comment the one that got thrown exception it sort of worked, it ran but it was thrown exception sim.exe has triggered a break point

ps. idk how to insert image I'm 100% new I'm so sorry

Pages: [1]