sfml sprite being obscured through pointer

Ok so I have a class called Render, a class called RenderMap, and another one called Collider.

This is my issue:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

void Render::drawMap() {

mapRender.DrawMap (map.getWindow()); //mapRender is an object of type RenderMap

}

//passes the window into the function

void RenderMap::DrawMap (sf::RenderWindow *map) {


test.draw (map); // test is an object of type Collider
//test.draw(map);

}

//takes the window and passes it into another function

void Collider::draw (sf::RenderWindow* map) {

map -> draw (tile); //tile is an sf::Sprite
}

//finally the last function draws a grass tile to the window


Obviously this isnt nearly all of the code in my program, but this is where the issue is coming from.

The sprite draws to the screen , but it draws as a rectangle that looks like a squashed version of my sprite.

Can anyone help me?

I have a feeling this is some issue with sfml 2.3...

EDIT: i also tried showing a sprite in int main() and it worked perfectly
Last edited on
Topic archived. No new replies allowed.