FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[DELETE] How to sfml create_image

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
moechofe



Joined: 07 Oct 2006
Posts: 25
Location: Paris, France

PostPosted: Tue Apr 13, 2010 1:47 pm    Post subject: [DELETE] How to sfml create_image Reply with quote

Hi, I'm trying to load an image from memory.

I'm not sure if my mistake concerns tango or sfml.
Code:
auto data = new FileFolder("path"); // VfsFolder
auto file = data.file("file"); // VfsFile
if( file.exists )
{
  ubyte[] buffer;
  auto input = new DataInput(file.input);
  auto length = input.read(buffer);
  image = sfImage_CreateFromMemory(cast(ubyte*)buffer, length);
}


Last edited by moechofe on Fri Apr 16, 2010 11:59 am; edited 1 time in total
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Tue Apr 13, 2010 8:33 pm    Post subject: Reply with quote

I really don't want this forum to become a general support forum for all of the libraries to which Derelict binds. But, since you've already posted...

You need to give more info than just the code you've posted. What exactly is the problem? Are you getting a runtime error? Is the sfml function failing?
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
moechofe



Joined: 07 Oct 2006
Posts: 25
Location: Paris, France

PostPosted: Fri Apr 16, 2010 11:43 am    Post subject: Reply with quote

I understand, and now, I'm pretty sure my problem concerns Tango.
Back to top
View user's profile Send private message
Trass3r



Joined: 29 Feb 2008
Posts: 66
Location: Germany

PostPosted: Tue Apr 20, 2010 4:17 pm    Post subject: Reply with quote

I recommend using DSFML2 from svn so you don't have to deal with the C API.

http://sfml.svn.sourceforge.net/viewvc/sfml/branches/sfml2/DSFML/
resp.
https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2/DSFML
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group