OpenGL texture format

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
visinoz
Prole
Posts: 1
Joined: Sun Jun 06, 2010 12:14 am

OpenGL texture format

Post by visinoz »

Hello,

Would it be possible for us to specify the texture's format for loading pictures? That way, we could optimize memory depending on our pictures format (I'm using 8 bits picture, so I could save a lot of memory using another format than RGBA8).

Something like love.graphics.setTextureFormat(TextureFormat) would be nice (where TextureFormat could be a string representing the format).

Ex.:
love.graphics.setTextureFormat('RGBA8') -- would be the default format
love.graphics.setTextureFormat('RGBA2') -- what i would probably use for my 8 bits image i guess
etc

Thanks for your great engine!
User avatar
Elvashi
Prole
Posts: 45
Joined: Sat Jul 04, 2009 9:17 am
Location: Australia

Re: OpenGL texture format

Post by Elvashi »

The idea has potential, though I personally wouldn't endorse this particular implementation (not that I'm in a position to endorse anything...). Perhaps as an extra optional param to love.graphics.newImage(..)? or maybe Image:setPixelFormat(fmt)?
I'm also concerned about exposing too much of the underlying implementation here, though careful choice of the format identifiers should solve that.
"We could make a program for doing this for you, but that is for the LÖVE IDE, planned to be released in March 2142." ~mike
Networking with UDP uLove Proposal CCG: Gangrene
Post Reply

Who is online

Users browsing this forum: Bing [Bot], zingo and 7 guests