Sign in to follow this  
fathom88

OpenGL OpenGL Multi-View Question

Recommended Posts

I have question regarding OpenGL. I'm not sure how to ask the question. Please excuse me ignorance. In MS GDI, you can draw to a single bitmap but have multiple windows show the same bitmap. You draw into the bitmap once, but different windows can bit blt the same image. For example, I want to draw an animation of a plane flying in one window and I see the plane from afar. In another window, I see the same image of the plane flying only its zoomed in. To accomplish this with GDI, I would simply draw into a bitmap, do a straight btblt in one window and do a stretch blt in the other window. I save processor time because I actually only do the raw math and drawing once into the bitmap. Can I do something something similar in OpenGL? Obviously, I can draw the image twice in to different view ports. But I want something more efficient. What term should I be searching for?

Share this post


Link to post
Share on other sites
You're probably looking for the term 'texture' which is the OpenGL container for image data. You can attach this texture to a quad, and draw it using an orthogonal projection in as many different viewports as you wish. If implemented properly, the texture will remain in memory of your graphics card (i.e. assuming you have hardware acceleration on your PC). You can also scale, rotate or move the image anyway you please.

Note that OpenGL is primarily a 3D graphics interface (and also not quite related to MS), so terms as BitBlt do not apply at all.

Tom

Share this post


Link to post
Share on other sites
Note that not only can you draw it in different viewports, but also in different windows. Although this does require the use of the WGL_SHARE_LISTS extension.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this