Results 1 to 3 of 3

Thread: white texture on iOS

  1. #1
    Lesser Knight
    Join Date
    Feb 2012

    Default white texture on iOS


    I'm new to the forum.
    I'm learning ProtonSDK since one month ago.
    I have been using Irrlicht on Windows platform and QT for years.

    I'm having a problem.
    When I load a texture form the local file system it's fine on windows and on iOS.
    But when i load the same texture from a mounted zip file, on windows is fine but on iOS i have a nice white texture.
    I'm seaching for days, but I have no luck.
    The Only thing diferent from loading the texture from local file system or the zip file system, is that I use createMemoryReadFile from Irrlicht to create the Texture.

    Have some one else see this thing.

    I apologize for my poor English.


  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002


    Hmm... I don't think I've ever mounted a zip under iOS.. but it should work.

    Make sure you use Proton's zip mounting stuff, and not Irrlicht's. (It will interface with Irrlicht via CProtonReader automatically)

    So you should be doing something like this in App.cpp:

    FileSystemZip *pFileSystem = new FileSystemZip();
    		if (!pFileSystem->Init(GetBaseAppPath()+ ""))
    			LogMsg("Error finding zip file to load resources");
    		//	vector<string> contents = pFileSystem->GetContents();
    		//	LogMsg("Listing all %d files.", contents.size());
    		//	for (int i=0; i < contents.size(); i++)
    		//	{
    		//		LogMsg("%s", contents[i].c_str());
    		//	}
    Also, carefully check the log (while running in debug). If it still won't work, we'd probably need sample code to see demonstrate the problem.
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Lesser Knight
    Join Date
    Feb 2012


    Thank you for your quick reply.

    Yes, that was my secong try.
    I found, searching this forums, someone saying that irrlicht part for zips does not work fine on android, but Proton works ok. So I give a try exactly the same code you put and modify your CProtonReader.cpp file for testing porpouses only.
    	if (pBytes)
    		if (IsAPackedFile(pBytes)) //applicable to rttex files
    			//let's decompress it to memory before passing it back
    			unsigned int decompressedSize;
    			byte *pDecompressedData = DecompressRTPackToMemory(pBytes, &decompressedSize);
    			size = decompressedSize;
    			delete pBytes; //done with the original
    			pBytes = pDecompressedData;
    			byte count = *pBytes;
    			byte* pTmp = pBytes;
    			size -= count;
    			while(count > 0){
    			byte *pData = new byte[size +1];
    			delete pBytes; //done with the original
    			pBytes = pData;
    		return io::createMemoryReadFile(pBytes, size, filename, true);
    I only do a simple displacement of a .jpg file.
    In the log window it's said "Loaded texture: Lib/arch/Material/High/cream1.pgj" for example, so all went ok.
    The log show the same on iOS too.
    But on windows works fine and on iOS do same thing that using irrlicht file system, a white texture.
    I will try using your rttex files on a zipped one.

    --- Edit ----
    I have just try with your .rttex files on a zipped file and works fine on windows and iOS.
    So I suppose that is my part of toying with memory what is wrong on iOS, or at least iOS does not like it.

    --- Edit 2 ----
    I'm sorry.
    It's my fault.
    The textures where not pow of 2 x pow of 2 pixels.
    They are 100x100 pixels.
    I does not recall that I was on OGL ES.
    I rescaled then to 128x128 and now works fine on windows and iOS.
    Sorry to make you loose your time.

    Last edited by osgoz; 02-17-2012 at 11:05 AM.

Similar Threads

  1. white in VIP!
    By soccerfu in forum Tanked
    Replies: 6
    Last Post: 11-29-2011, 01:02 AM
  2. Replies: 9
    Last Post: 09-18-2011, 11:38 PM
  3. Texture Coordinates
    By hmroz in forum Proton SDK
    Replies: 5
    Last Post: 04-11-2011, 12:58 PM
  4. New Texture 3D example
    By rombust in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 11-24-2009, 02:12 PM
  5. relationship between GC and Texture?
    By logixoul in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 07-07-2008, 07:17 AM



Posting Permissions

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