View previous topic :: View next topic |
Author |
Message |
moechofe
Joined: 07 Oct 2006 Posts: 25 Location: Paris, France
|
Posted: Tue Apr 13, 2010 1:47 pm Post subject: [DELETE] How to sfml create_image |
|
|
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 |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Tue Apr 13, 2010 8:33 pm Post subject: |
|
|
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 |
|
|
moechofe
Joined: 07 Oct 2006 Posts: 25 Location: Paris, France
|
Posted: Fri Apr 16, 2010 11:43 am Post subject: |
|
|
I understand, and now, I'm pretty sure my problem concerns Tango. |
|
Back to top |
|
|
Trass3r
Joined: 29 Feb 2008 Posts: 66 Location: Germany
|
|
Back to top |
|
|
|