LWJGL
May 21, 2012, 01:24:34 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Problem creating a blank image  (Read 4764 times)
mot
Regular nerd
**
Posts: 57


WWW
« on: September 20, 2007, 06: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...
Logged

Tom Andrle - Catnap Games - http://www.catnapgames.com
Evil-Devil
Prolific Timewaster
****
Posts: 268



WWW
« Reply #1 on: October 08, 2007, 04:09:07 »

Just create a ByteBuffer of the appropriate texture size and use it as your blank texture. That works fine for me.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!