PDA

View Full Version : rendering into a bitmap



satloc
03-30-2009, 03:58 PM
I need to define a generic OpenGL interface for a project that will be ported to multiple architectures. I.E. Win32, Linux, X86, ARM11, etc.

The issue is how to interface to external wrapper programs, and I believe that building a generic bitmap might be the method, wherein I render to the bitmap, and the application can overwrite it with fonts, other bitmaps, etc.

I'm fairly sure this can be done somehow in most architectures, but can it be done using hardware speedup?

Thanks much for the help!

dletozeun
03-30-2009, 04:09 PM
but can it be done using hardware speedup?


Why not? Use MVC architecture (Model View Controller). With this architecture, the way data is represented and how it is displayed is completely decoupled. Following this idea, you can define various kind of viewer, hw accelerated or not.

satloc
03-30-2009, 04:42 PM
but can it be done using hardware speedup?


Why not? Use MVC architecture (Model View Controller). With this architecture, the way data is represented and how it is displayed is completely decoupled. Following this idea, you can define various kind of viewer, hw accelerated or not.

Logically, I have no doubt it can be done somehow. But how well will it work, and the HW angle I don't know.

My biggest lack of knowledge is the capabilities of the various drivers, which I'm not likely to discover by any quick method except by asking here.

There can be OpenGL rendering into a buffer and then the buffer swapped onto the display. But I'm a bit more fuzzy about rendering onto the buffer with HW speedup, and then moving that buffer (a bitmap of some sort) into foreground space for the application to do it's will.

Can I count on this being available on pretty much any platform?

satloc
03-30-2009, 04:53 PM
Let me add something here.

Implied is that we need to render into a back buffer, and never swap it to the front buffer using OpenGL. Rather instead we need to hand it off to a wrapper application, that will modify the bitmap and display it at its leisure.

dletozeun
03-31-2009, 04:19 AM
I am not sure to fully understand your problem, but OpenGL offers the ability to render to a buffer or even a texture through the framebuffer_object extension. With this one you can perform hw accelerated offline rendering and display it in your viewer.
I think you have to read a bit on OpenGL, just to have first a global idea of how it works. Then read about the fbo extension, for example here:
http://www.gamedev.net/reference/articles/article2331.asp
http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt