digitalmars.D.learn - CFTE+DevIL=?
- Zhenya (5/5) Oct 08 2012 Hi!
- Piotr Szturmaj (4/9) Oct 08 2012 CTFE can only evaluate D functions that have their bodies available. It
- Jacob Carlborg (6/11) Oct 08 2012 What you can do is importing the textures into the executable, at
- Mike Parker (7/18) Oct 08 2012 That can bring the image into the app as an array of bytes. Then
Hi! I need to load some textures for my game,but I woud like to do it in compile time. I know that CTFE imposes restrictions on functions.So can I execute some DevIL(Derelict3) functions?
Oct 08 2012
Zhenya wrote:Hi! I need to load some textures for my game,but I woud like to do it in compile time. I know that CTFE imposes restrictions on functions.So can I execute some DevIL(Derelict3) functions?CTFE can only evaluate D functions that have their bodies available. It means that external code coming from C or D external library can't be evaluated.
Oct 08 2012
On 2012-10-08 15:24, Zhenya wrote:Hi! I need to load some textures for my game,but I woud like to do it in compile time. I know that CTFE imposes restrictions on functions.So can I execute some DevIL(Derelict3) functions?What you can do is importing the textures into the executable, at compile time, if that helps: http://dlang.org/expression.html#ImportExpression -- /Jacob Carlborg
Oct 08 2012
On Monday, 8 October 2012 at 18:07:49 UTC, Jacob Carlborg wrote:On 2012-10-08 15:24, Zhenya wrote:That can bring the image into the app as an array of bytes. Then at runtime, you can use DevIL to load the image data from the byte array. I've got a blog post[1] about doing this very thing (with SDL rather than DevIL, but it's all the same). [1] http://www.gamedev.net/blog/1140/entry-2254294-compiling-data-into-a-d-executable/Hi! I need to load some textures for my game,but I woud like to do it in compile time. I know that CTFE imposes restrictions on functions.So can I execute some DevIL(Derelict3) functions?What you can do is importing the textures into the executable, at compile time, if that helps: http://dlang.org/expression.html#ImportExpression
Oct 08 2012