Results 1 to 3 of 3

Thread: Using libktx

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    2

    Using libktx

    Hello. Today I decided to try the libktx library for my OpenGL ES 2.0 application. I downloaded the source and compiled it. But whenever I try to link the library to my application I get this error:
    libktx_d.lib(etcunpack.obj) : error LNK2001: unresolved external symbol _decompressBlockDiffFlip

    Am I missing something or is this a bug on the GLES2 version? By the way, I am using PowerVR emulator on Windows, could it be related to that?

  2. #2

    Re: Using libktx

    If you defined SUPPORT_SOFTWARE_ETC_UNPACK, then you need to add etcunpack.c to your project/lib.
    Also if you are using GLES 2.0, then don't forget to define KTX_OPENGL_ES2.

    To use ETC1 compression you need to set GLEW_OES_compressed_ETC1_RGB8_texture (only if device supports it), here is my code:
    Code :
    void zwGLObjects::CheckTexFormats(void)
    {
    	GLint num = 0;
     
    	GLEW_OES_compressed_ETC1_RGB8_texture = 0;
     
    	glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &num);
    	if (num > 0)
    	{
    		GLint* formats = (GLint*)calloc(num, sizeof(GLint));
     
    		glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats);
     
    		for (int index = 0; index < num; index++)
    		{
    			switch(formats[index])
    			{
    			case GL_ETC1_RGB8_OES:
    				GLEW_OES_compressed_ETC1_RGB8_texture = 1;
     
    				break;
    			}
    		}
     
    		free(formats);
    	}
    }

    For ETC1 texture compression I'm using http://www.malideveloper.com/texture-co ... n-tool.php (as feature list says "Improved ETC compression speed of up to 600x compared to ETCPack at same or better quality" )

  3. #3
    Junior Member
    Join Date
    Feb 2012
    Posts
    2

    Re: Using libktx

    Quote Originally Posted by Krystian Bigaj
    If you defined SUPPORT_SOFTWARE_ETC_UNPACK, then you need to add etcunpack.c to your project/lib.
    Also if you are using GLES 2.0, then don't forget to define KTX_OPENGL_ES2.

    To use ETC1 compression you need to set GLEW_OES_compressed_ETC1_RGB8_texture (only if device supports it), here is my code:
    Code :
    void zwGLObjects::CheckTexFormats(void)
    {
    	GLint num = 0;
     
    	GLEW_OES_compressed_ETC1_RGB8_texture = 0;
     
    	glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &num);
    	if (num > 0)
    	{
    		GLint* formats = (GLint*)calloc(num, sizeof(GLint));
     
    		glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats);
     
    		for (int index = 0; index < num; index++)
    		{
    			switch(formats[index])
    			{
    			case GL_ETC1_RGB8_OES:
    				GLEW_OES_compressed_ETC1_RGB8_texture = 1;
     
    				break;
    			}
    		}
     
    		free(formats);
    	}
    }

    For ETC1 texture compression I'm using http://www.malideveloper.com/texture-co ... n-tool.php (as feature list says "Improved ETC compression speed of up to 600x compared to ETCPack at same or better quality" )
    Undefining SUPPORT_SOFTWARE_ETC_UNPACK did the trick. Thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •