KX1 IDIB problem | developer.brewmp.com KX1 IDIB problem | developer.brewmp.com

Developer

KX1 IDIB problem

Forums:

I am using the 2.0.1 SDK. I have 30+ phones working perfectly with my DIB code except for the KX1. It seems that when I get the display buffer and look at the IDIB information it is completely wacked. I see the following:

cx: 1405
cy: 59904
nDepth: 81
nColorScheme: 6

So it should be obvious this info is wrong. Could this be the particular device build I have or is this consistent with other KX1 devices?

It appears that the IBITMAP_BltIn function works between DIBS, but you can't write directly into the display buffer's bytes nor profile the display buffer.

Any advice would be appreciated.

How are you obtaining the IDIB pointer? I've heard that the KX1/KX2 do not support IDIB, but I don't have firsthand knowledge of these phones. If that is true, you must be doing something wrong if you are obtaining an IDIB pointer at all.
There is an alternative that might work on these devices, but nobody has yet reported back to me to tell me that it does. If you try this, will you please let me know what happens? Yes? :) Ok, search for AEEDIB, and you should find a couple posts where I describe it.
-Mark

How are you obtaining the IDIB pointer? I've heard that the KX1/KX2 do not support IDIB, but I don't have firsthand knowledge of these phones. If that is true, you must be doing something wrong if you are obtaining an IDIB pointer at all.
There is an alternative that might work on these devices, but nobody has yet reported back to me to tell me that it does. If you try this, will you please let me know what happens? Yes? :) Ok, search for AEEDIB, and you should find a couple posts where I describe it.
-Mark

markb wrote:How are you obtaining the IDIB pointer? I've heard that the KX1/KX2 do not support IDIB, but I don't have firsthand knowledge of these phones. If that is true, you must be doing something wrong if you are obtaining an IDIB pointer at all.
There is an alternative that might work on these devices, but nobody has yet reported back to me to tell me that it does. If you try this, will you please let me know what happens? Yes? :) Ok, search for AEEDIB, and you should find a couple posts where I describe it.
-Mark
I do the IDISPLAY_GetDeviceBitmap(.....), then I do a IBITMAP_QueryInterface to get the IDIB. It returns a pointer, but apparently it isn't really a valid IDIB interface. I'd been happier if they had just returned NULL. But, I am guessing that the interface that is being returned is probably some native format. Maybe I can figure out how to get into it.

markb wrote:How are you obtaining the IDIB pointer? I've heard that the KX1/KX2 do not support IDIB, but I don't have firsthand knowledge of these phones. If that is true, you must be doing something wrong if you are obtaining an IDIB pointer at all.
There is an alternative that might work on these devices, but nobody has yet reported back to me to tell me that it does. If you try this, will you please let me know what happens? Yes? :) Ok, search for AEEDIB, and you should find a couple posts where I describe it.
-Mark
I do the IDISPLAY_GetDeviceBitmap(.....), then I do a IBITMAP_QueryInterface to get the IDIB. It returns a pointer, but apparently it isn't really a valid IDIB interface. I'd been happier if they had just returned NULL. But, I am guessing that the interface that is being returned is probably some native format. Maybe I can figure out how to get into it.

Could you provide some code to show what you're doing? You should be checking the return value of QueryInterface(). The device shouldn't be returning SUCCESS if it doesn't support IDIB.

Could you provide some code to show what you're doing? You should be checking the return value of QueryInterface(). The device shouldn't be returning SUCCESS if it doesn't support IDIB.

Unfortunately, I made the assumption that a 2.1 phone would support having a DIB to the display's back buffer, so I wasn't checking my return value. It seems that IDIB is supported for every phone we support, except for the KX1, KX2, and the CDM 9900. My bad for such an assumption.

Unfortunately, I made the assumption that a 2.1 phone would support having a DIB to the display's back buffer, so I wasn't checking my return value. It seems that IDIB is supported for every phone we support, except for the KX1, KX2, and the CDM 9900. My bad for such an assumption.

Have you tried the AEEDIB alternative I mentioned above? Does it work on this device?

Have you tried the AEEDIB alternative I mentioned above? Does it work on this device?

It turns out that doing IBITMAP_QueryInterface not only gives you a screwed up IDIB interface but it also prevents the following workaround from working properly:
Native format IBITMAPs on the Kyoceras have the same header as an IDIB. To get the IDIB for a native image or even the screen bitmap, just cast the (IBitmap *) pointer as an (IDIB *) and you'll have accurate info.

It turns out that doing IBITMAP_QueryInterface not only gives you a screwed up IDIB interface but it also prevents the following workaround from working properly:
Native format IBITMAPs on the Kyoceras have the same header as an IDIB. To get the IDIB for a native image or even the screen bitmap, just cast the (IBitmap *) pointer as an (IDIB *) and you'll have accurate info.

goldendevil wrote:It turns out that doing IBITMAP_QueryInterface not only gives you a screwed up IDIB interface but it also prevents the following workaround from working properly:
I'm not sure what you mean here. What exactly are you doing that is giving you a screwed up IDIB? And how does that prevent the workaround that you mention?

goldendevil wrote:It turns out that doing IBITMAP_QueryInterface not only gives you a screwed up IDIB interface but it also prevents the following workaround from working properly:
I'm not sure what you mean here. What exactly are you doing that is giving you a screwed up IDIB? And how does that prevent the workaround that you mention?

This is coming late, but I at least wanted to follow up on this.
I just ended up Double Buffering. If you get the IBitmap interface for the back buffer on those devices I mentioned, then try to query the IDIB interface, it will return an EUNSUPPORTED. The devices apparently support DIBS, but not an IDIB interface to the back buffer. At least, not through the traditional means.
So I just resorted to creating my own IDIB buffer, draw to it then do BltIn into the display buffer's IBitmap interface. Then Update. It's slower then writing directly to the buffer, but still good enough.
As a permanent solution, I have my own class which wraps the display and it's back buffer. What I ended up doing is when the query for the IDIB fails, I automatically create a virtual frame buffer in its place, so that all the code in my games can run. IF all you are doing is a straight COPY blit from the virtual frame buffer to the display buffer, you don't really lose that much in performance.

This is coming late, but I at least wanted to follow up on this.
I just ended up Double Buffering. If you get the IBitmap interface for the back buffer on those devices I mentioned, then try to query the IDIB interface, it will return an EUNSUPPORTED. The devices apparently support DIBS, but not an IDIB interface to the back buffer. At least, not through the traditional means.
So I just resorted to creating my own IDIB buffer, draw to it then do BltIn into the display buffer's IBitmap interface. Then Update. It's slower then writing directly to the buffer, but still good enough.
As a permanent solution, I have my own class which wraps the display and it's back buffer. What I ended up doing is when the query for the IDIB fails, I automatically create a virtual frame buffer in its place, so that all the code in my games can run. IF all you are doing is a straight COPY blit from the virtual frame buffer to the display buffer, you don't really lose that much in performance.

Did you happen to try querying for AEEDIB instead of IDIB, as I suggested? Not sure if this will work, but I'd really appreciate it if someone would try it and get back to me.

Did you happen to try querying for AEEDIB instead of IDIB, as I suggested? Not sure if this will work, but I'd really appreciate it if someone would try it and get back to me.

markb wrote:Did you happen to try querying for AEEDIB instead of IDIB, as I suggested? Not sure if this will work, but I'd really appreciate it if someone would try it and get back to me.
Nope, I never got around to trying it. Sorry. If I get some free time, I might give it a try.

markb wrote:Did you happen to try querying for AEEDIB instead of IDIB, as I suggested? Not sure if this will work, but I'd really appreciate it if someone would try it and get back to me.
Nope, I never got around to trying it. Sorry. If I get some free time, I might give it a try.