Hi!
I want to combine Allegro with CEF, I almost got it working but I seem to be unable to write to bitmaps in the way I expect it to work according to the docs.
I need the memory to be in CPU space since CEF and Allegro both need to access it; I also know that i can only use the drawing functions for it from the opengl thread that created the display, which won't gel well with CEFs drawing system.
So, that said, why does this not work:
Code above doesn't even have anything to do with CEF or smth, its just the main thread creating a display and trying to manipulate the data directly. as far as i can tell the locking is done correctly and the range is also correct. But i get a segfault on the memset... is there an init period for the buffer ? The memory pointer looks valid to me though.
Sidenote here: CEF uses a weird pixel format
https://magpcss.org/ceforum/apidocs/projects/(default)/CefRenderHandler.html#OnPaint
BGRA
Can i create a custom pixel format or do i need to handle this manually ? (this is not so important as the above crash)
EDIT:
I can't figure out how to post a reply;
My problem: I set the new flags after creating the bitmapo
ZweiEuro, welcome.
Locked bitmaps may have a negative pitch, which means subsequent rows come before not after the previous. You have to memset each line of the bitmap to be sure.