[Interest] Question about reading glsl shader source from a QResource using compression

Giuseppe D'Angelo dangelog at gmail.com
Mon Jan 13 20:26:53 CET 2014


On 13 January 2014 13:25, Ola Røer Thorsen <ola at silentwings.no> wrote:
>
> In the documentation for QResource, it says that the data returned by r.data
> may be compressed. So is this way of reading the shader source code safe at
> all times? Shouldn't it check with r.isCompressed and if so, uncompress? Is
> there some assumption here that such small text files aren't compressed?

I think the example is just doing it wrong, it should instead load the
resource file contents using QFile into two QByteArrays into the ctor
and then return the QByteArrays' contents there.

-- 
Giuseppe D'Angelo



More information about the Interest mailing list