Qbasicnews.com

Full Version: What happens when you Bload a BMP file On an OpenGL context
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
or screen using the standard LibGFXFB? Would that even work as the doc tell me that all the drawing funks are disabled in OpenGL mode. I can't test it tight now because of some reason I don't care to elaborate. The earliest possible time for me to test it is Sunday(Here) so I need confirmation on this so that I don't waste time doing something that is not possible.

Thanks!!!
What would happen would be... nothing. The BMP would be loaded to the current work page memory, but since you're in OpenGL mode, this does not get shown.

I may add another flag to the 4th SCREEN parameter, so that what you draw to the screen using the normal QB-like functions would be blitted on top of the OGL display (as a masked textured quad) at FLIP time. This way you could still draw to the screen using the usual functions, and also use OpenGL to draw most of the stuff (think on-screen-displays for games)

Another idea would be to have a generalized function that would upload a GET/PUT buffer as an RGB texture to the gfx card... this would be a nice addition to the gfxlib.txt docs, hints section (which already reports some helpful routines as of 0.13 in cvs)
Nah, forget it. Vonnie told me that you could BLOAD a bmp on a memory address. :*)

Another question though is. Whe I set screen to be 32BPP and I BLOAD a 24 bit BMP on a memory address like so:

Code:
dim image(w*h-1) as Integer

'bmp is 24bit
BLOAD "bmp24.bmp", @image(0)
Is the alpha channel padded at the end or beginning of each RGB triplet? Or do I have to change the format myself?

Thanks!
Yes you can BLOAD anything (including BMP images) to any memory address... Anyway when you load a BMP you have to allocate (w*h*bpp)+4 bytes for the image (4 bytes for the GET/PUT buffer header which is created by BLOAD).

The image will be converted to the current gfxlib pixel format before being stored into the buffer; that is, one of the 3 formats reported in gfxlib.txt, appendix C. The alpha channel is always at mask &hFF000000 if in 32bit mode (in 16 bit there's no alpha). Anyway when loading a BMP in 32bit, the alpha channel will be filled with zeroes.
Cool!!! I'll port the tutes tonight. :*)