Jump to content
  • Advertisement
Sign in to follow this  
CyberNGA

OpenGL OpenGL Component

This topic is 5170 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am just trying to adapt to MS VS .NET, and trying to write a program that uses OpenGL as a component which takes up part of the form ( leaving space for other standard controls like buttons ) Is there a component for C++ .NET that does this ? I know there were a few for BCB which I used.... Anyone ? Thanx in advance!

Share this post


Link to post
Share on other sites
Advertisement
Thank you for you time onebeer, but I've already read this article and it does not apply - I know how to make a form to which OpenGL uses the whole canvas, I need an object ( or way ) to make OpenGL co-exist with other controls on the same form.

For example, I'd like the OpenGL part of the form to be 75% of the width and 80% of the height of the form, but not all of the client area of the form. If there is something in this article that explains how to do so, I am afraid I missed it.

If you find something else, please let me know, and again, thank you for your reply and time.

Share this post


Link to post
Share on other sites
the general way, as i understand it, is to make a picture box (or indeed another control) take up the space you want OpenGL to render into then when you start up do so like normal but using the hDC of the control not the containing window (there are probably other issues like owner-drawn-ness and other states which need dealing with but thats the basic idea as far as i can gather)

Share this post


Link to post
Share on other sites
I believe the phantom is right. Looking at the code from the web page I refer to, you will see the OpenGL component is connected to the form with this code:

public Form1()
{
InitializeComponent();
view = new GLView();
view.Parent = this;
view.CreateControl();
view.Dock = Dockstyle.Fill;
view.-Onpaint = new Painter();

// add an event handler to the MouseDown event:
view.MouseDown += new MouseEventHandler(Form1_MouseDown);
// or view_MouseDown
}

You could create a panel and parent the GLView object to it instead of the main form like the example.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!