Bug 423 - DDSImage class should provide the correct OpenGL enums and values
Summary: DDSImage class should provide the correct OpenGL enums and values
Status: IN_PROGRESS
Alias: None
Product: Jogl
Classification: JogAmp
Component: opengl (show other bugs)
Version: 2
Hardware: All all
: P5 enhancement
Assignee: mmce
URL:
: 422 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-24 16:46 CEST by mmce
Modified: 2015-09-27 03:15 CEST (History)
1 user (show)

See Also:
Type: FEATURE
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mmce 2010-10-24 16:46:17 CEST
Hi,

It is a pain in the ass to check which format can be used in order to create an image from a DDSImage object. It would be really nice to have a several methods, which provide the user with all the information he needs, without a lot of value checking.

For example:

DDSImage image = .... ;

gl.glTexImage3D(image.getTarget(), mipMapLevel, image.getInternalFormat,
    image.getWidth(), image.getHeight(), image.getDepth(), border, image.getPixelFormat(), image.getPixelType(), image.getRawData());

or

gl.glCompressedTexImage3D(image.getTarget(), mipMapLevel, 
    image.getCompressionFormat(), image.getWidth(), image.getHeight(),
    image.getDepth(), border, image.getSize(), image.getRawData());

There is also a problem for users with out knowledge out size calculation of compressed images.
The size is calculated by

int size = Math.max(PBS, width) / PBS * Math.max(PBS, height) / PBS
				* bytes * depth;

where PBS is the pixel block size (uncompressed). So PBS contains the number of pixels, when they are uncompressed and bytes is the size of these pixel in the raw data buffer.
For "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT" PBS is 4 and bytes 16. The real problem occurs in small mipmap levels. where the width and / or height are below minimum block size;
Comment 1 mmce 2010-10-24 16:51:46 CEST
It would be nice, if all DDS specific data would be stored in a data object and all actual important data, like OpenGL would be stored at the DDSImage object. (vice versa is also fine)
Comment 2 Sven Gothel 2010-11-10 20:34:17 CET
Dear mmce, 

since you have obviously done some work on this feature,
it might be a good idea if you would try to solve this problem.

Have a look at the JOGL FAQ, source code, how to build etc..
Comment 3 Sven Gothel 2010-11-10 20:35:59 CET
*** Bug 422 has been marked as a duplicate of this bug. ***