Ability to draw to back buffer with native graphics calls

I can draw to the back buffer in DirectX but have not found away to do this with OpenGL (on Windows or X11).

The principle reason for wanting to do this is to integrate legacy code with OpenGL without any fickering occuring when you draw to the front buffer.

One way around this is to draw to an offscreen buffer and blit this to the screen. However this is not as elegant as being able to draw to the back buffer. An acceptable limitation would be to group the GL/GDI/X11 calls and have to flush the calls before calling a different API.

Yes I could use a texture but the information being drawn is very dynamic. And one some graphics cards there is a couple of ms delay while the texture is uploaded.

Why not just set the draw buffer to the back buffer so that you can, ya know, draw to the back buffer? Like everybody else?

This question belongs in the beginner forum, not suggestions.

I am sorry but you missed the point…

Try using GDI/X11 calls to draw to the back buffer and you will discover that it is not possible.

Yes I could just use OpenGL and that is what I prefer. However there are a number of short comings with OpenGL/DirectX that preclude that along with having to support legacy code which on X11 uses xlib and on Windows uses GDI.

Having used OpenGL from the start and before that IRIS GL I think I am a little bit beyond being a beginner (~17 years).

Becareful what you write and if you don’t have anything constructive to write don’t write anything. You just might offend someone!

I am sorry but you missed the point…

Try using GDI/X11 calls to draw to the back buffer and you will discover that it is not possible.
Your post was unclear; it sounded very much like asking how to draw to the OpenGL backbuffer, whereas you were asking about drawing to OpenGL buffers with non-OpenGL commands.

Wouldn’t it be simpler to just make an API wrapper for those commands? Something that implements the GDI API, for example, but turns GDI drawing commands into OpenGL drawing commands?

This functionality doesn’t sound like something that needs to be incorporated into drivers; particularly when the functionality is not terribly useful in the general case.

Some OpenGL implementations have limitations which GDI does not have, which means writing a simple wrapper will not work.

Take for instance line widths. I have found on Windows with the NV driver that all I can get is about 10 pixels.

In addition I need the different line join types (yes I could do lines as wide polygons but its a lot of work).

I’m not sure as to what I will have to do at present. However there is a large contingent here that says if DirectX can do it then why can’t OpenGL and they are likly to push the DirectX route ignoring the portability issues.

I am currently following the progress of Cario which looks promising, however performance is a big issue.

It is not possible to mix GDI/X11 drawing calls with OpenGL and it won’t be really possible in the future - for obvious reasons(driver). The best what you could do is draw your GDI/X11 image to a buffer and blit it on the top of the opengl-rendered image(I hope it works). I am not aware of a large contingent that needs to mix the two things, nor do I believe taht it is a good idea.

It’s very unlikely that any change will be made to make GDI play nice with GL. One trick I had tried long ago was to render GDI stuff after SwapBuffers, but on some systems, it flickers. Now I’m thinking that maybe if I had put a sleep timer just after SwapBuffers and then doing GDI rendering, it may have given better results.

however performance is a big issue.
I doubt that performance will be that great with either API. It’s best to forget GDI today and do a good job.