Jump to content
  • Advertisement
Sign in to follow this  

bar file problems and image resources

This topic is 5362 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For those having trouble with bar files and loading image resources, here a few things to try: 1. When you're updating your resources in the BREW resource editor be sure to click "apply" in the bottom right corner for the changes to take effect. 2. After you've made changes to your .bar file and re-compiled it, try exiting the emulator and restarting it before trying to use your new resources in your application. The emulator may sill be using the old .bar data from before the updates, and so the IDs for your new resources are invalid. 3. Make sure you're NOT using the resource type "binary" for your images. It's currently not supported. Instead use the type "object". You'll have to change your .bar file and recompile it if you're using "binary". You may also want to try this alternative method of loading your .bmp files for textures: -In the resource editor, create a new resource of type "object". Make the data for the object point to your .bmp file. Compile the .bar and restart the emulator. -In your application: IDIB* pDib; IBitmap* pBmp = ISHELL_LoadResBitmap(shell, "res file name", "your res ID"); IBITMAP_QueryInterface(pBmp, AEECLSID_DIB, (void**) &pDib); if(dib != NULL) { //now use the data members of pDib to access your image. //Note: you may have to swap the red and blue channels in your image data due to byte-ordering. } The image data is accessed using the pBmp member of pDib. The nPitch member tells you whether your image is top-down (nPitch is positive) or bottom up (nPitch is negative). So, an example of how to create a GLES texture from a bottom-up bitmap: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, pDib->cx, pDib->cy, 0, GL_RGB, GL_UNSIGNED_BYTE, pDib->pBmp+((pDib->nPitch)*(pDib->cy-1))); See the BREW documentation for more detailed information about IDIB. Hope that helps.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!