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

Author Topic: [sf::Texture] Load from buffer  (Read 1874 times)

0 Members and 1 Guest are viewing this topic.

player931402

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
[sf::Texture] Load from buffer
« on: May 02, 2012, 05:43:46 pm »
Hi guys!
I need your help, i hope i can find the solution!  ;)
I load from mysecretfile.dat my images in binary ( ios::in | ios::binary  | ios::ate ).
Im going to load first image and i have it in a  char *buffer.


How can  I export the "buffer" in a sf::Texture?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11028
    • View Profile
    • development blog
    • Email
Re: [sf::Texture] Load from buffer
« Reply #1 on: May 02, 2012, 08:35:00 pm »
There are two possiblities:

Since I've never done that, I've no idea how you'll have to format the data to be read with on of the functions above but I guess the documentation and google should help you enough.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

player931402

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [sf::Texture] Load from buffer
« Reply #2 on: May 03, 2012, 12:42:40 am »
ok, i dont understand how can I do this very well but ty! tomorrow i'll try!



Bye !

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: [sf::Texture] Load from buffer
« Reply #3 on: May 03, 2012, 07:17:44 pm »
Just read the documentation, it's not a big step from char* to loadFromMemory() ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: