Hello Guest

Problem creating a blank image

  • 1 Replies
  • 15480 Views
*

Offline mot

  • **
  • 57
    • http://www.catnapgames.com
Problem creating a blank image
« on: September 20, 2007, 13:20:32 »
I had trouble creating a blank image using DevIL. It was hard to find a way to do it at all and finally I found out in the original DevIL documentation that this should be done using ilTexImage with the Data parameter set to NULL.

However the LWJGL version of ilTexImage doesn't allow Data to be null so I allocated a direct ByteBuffer, left it empty and passed it to ilTexImage. When trying to blit another (loaded) image into this new image I got a memory access violation.

Since then my need to create blank images has diminished (I do the blitting using OpenGL now). Still wondering though if there's a way to create blank images that I missed. As a simple and ugly workaround I load a small blank PNG file, scale it to the desired size and clear it...
Tom Andrle - Catnap Games - http://www.catnapgames.com

Re: Problem creating a blank image
« Reply #1 on: October 08, 2007, 11:09:07 »
Just create a ByteBuffer of the appropriate texture size and use it as your blank texture. That works fine for me.