Entries from 2011-01-01 to 1 year
You have to adjust both project property and AndroidManifest.xml.
(1) put in AndroidManifest.xml(2)put android:settingsActivity="com.foo.FooSettings" in tab in foo.xml under @xml(3)write foo_settings.xml and string.xml then put them into @xml and @value respectively.(4)write Java codes using addPreferenc…
EGL is only supported after android-9, that is, OS 2.3.1 Gingerbread.
glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); consumes 64Kbytes more than glDisable(GL_LIGHTING); glDisable(GL_LIGHT0); in top RSS. The difference looks very small. :)
The order of gl-functions in loadTex is critical. typedef struct TextureInfo_ { int width; int height; int pixelSize; int colorType; // int algnType; // 0=unsigned char, 1=uint32_t void* pPix; int id; const char* fileName; } TextureInfo; v…
You can find only 3 formats in android/native_window.h. enum { WINDOW_FORMAT_RGBA_8888 = 1, WINDOW_FORMAT_RGBX_8888 = 2, WINDOW_FORMAT_RGB_565 = 4, }; But actually, it has others. When you set up the attributes like this const EGLint attri…
Some parts of the code are borrowed from Independent JPEG Group and Android NDKでlibjpegをビルドして利用する(UsefullCode.net)Resulted texture will have dummy alpha components (0xff) for compatibility with PNG. static uint32_t make8888(int …
1)make sure no project is selected2)file->import->Existing Projects into Work Space3)select root directry4)check "Copy projects into workspace" (*IMPORTANT this may overwrite existing project)5)refresh 6)finish
void myLoadAsset(AAssetManager* mngr){ const char imageFilename[] = "myImage.png"; AAsset* asset = AAssetManager_open(mngr, imageFilename, AASSET_MODE_UNKNOWN); FILE* fp = (FILE*)AAsset_getBuffer(asset); // AAsset_seek(asset, 1000, SEEK_SE…
const void* AAsset_getBuffer(AAsset* asset);Dianne Hackborn says: I suggest not using getBuffer() for a compressed file. It really only make sense for a file that isn't compressed, where this can give you a direct pointer to the mmapped da…
getBuffer returns the pointer to the mmapped image of the asset. openFileDescriptor returns the file descriptor to the mmapped image of the asset. fdopen(file descriptor) returns the pointer to the WHOLE package(.apk).