FreeImage plugin (GLSL Hacker 0.6.4.3+)

Started by JeGX, June 23, 2014, 02:59:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JeGX

From the version 0.6.4.3, GLSL Hacker is shipped with a new image loader plugin based on the popular FreeImage library. FreeImage is a powerful library to manage images and supports a lot of formats as well as 128-bit formats (each channel is coded on a float). But GLSL Hacker comes already with a built-in image loader (based on STB). So the question: how to choose the image loader?

This simple question has a simple answer: the set_current_image_codec() function of gh_texture lib:


gh_texture.set_current_image_codec(plugin_name)


To use the FreeImage loader, just do:

gh_texture.set_current_image_codec("FreeImage")


Now all texture functions that load an image file will use the FreeImage plugin.

To use the default image loader:

gh_texture.set_current_image_codec("stb")