Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
drawing a pointer to a sprite
Print
Pages: [
1
]
Author
Topic: drawing a pointer to a sprite (Read 1449 times)
0 Members and 1 Guest are viewing this topic.
KarmaKilledtheCat
Newbie
Posts: 23
drawing a pointer to a sprite
«
on:
August 27, 2013, 02:17:58 am »
I need to store sprites in a vector but with what I'm trying to do I need to use a vector of pointers to sprites. When I try to draw the pointer to the sprite I get a compile error saying that the Window.Draw() function cannot take a pointer to a sprite. Does anyone know a way to draw a pointer to a sprite?
Logged
Ixrec
Hero Member
Posts: 1241
Re: drawing a pointer to a sprite
«
Reply #1 on:
August 27, 2013, 03:02:48 am »
Can't you just dereference the pointer?
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11030
Re: drawing a pointer to a sprite
«
Reply #2 on:
August 27, 2013, 03:37:42 am »
Are you sure that you
need to
use a vector of pointers? If so, I hope the pointers do not own the object, otherwise you should really use smart pointers.
And yes if you get a pointer of a sprite from a vector, you'll simply have to dereference it.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
drawing a pointer to a sprite