Tuesday, April 19, 2011

Xcode Rule #1: Trust the Code Sense

Recently I used a lot of texture types in my thesis, such as 32 bit Integers, 32 bit RGB, etc. But I did my thesis on Windows-powered-currently-purchased PC. So all type of textures seems to work properly (with a few modification/declaration/asking here and there). But then I switch to my OSX-powered-5-years-old MacbookPro, and hey... it does not work. 

I check the code, no errors found. After a few days asking here and there, I noticed that my MBP does not support GL_R32F as its internal format. I already suspect this since the code sense can't detect the enum. Apparently, my MBP does not support this type of internal format. I have to use GL_ALPHA_FLOAT32_APPLE or GL_ALPHA_FLOAT32_ATI. It's a common error but one important lesson learnt from this 'incident' is: if the code sense cant 'sense' it, then it won't work. I love how Apple 'modify' the OpenGL to fit their machine. It's just a little bit weird they dont use a lot of features from OpenGL standard. But hey, at least I can 'sense' if something is not supported without asking around or declaring a parameter. 

No comments: