Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

openGL in c#

Hello,

I have some experience in openGL. I plan to deploy in C#. But is there any way to use it in C#? Specifically I want to have a nopenGL view control on my C# form without loosing the features of C# form. I found CsGL.BaseCode but it says I should have CsGL.BaseCode.dll. But I do not have it. I have CsGL bins CsGL.dll and CsGL.native.dll but not that. Is any one can send me an example related to my problem?

I will be so glad to hear for your feedbacks.

Comments

  • VanilleBertVanilleBert Posts: 29Member
    : Hello,
    :
    : I have some experience in openGL. I plan to deploy in C#. But is there any way to use it in C#? Specifically I want to have a nopenGL view control on my C# form without loosing the features of C# form. I found CsGL.BaseCode but it says I should have CsGL.BaseCode.dll. But I do not have it. I have CsGL bins CsGL.dll and CsGL.native.dll but not that. Is any one can send me an example related to my problem?
    :
    : I will be so glad to hear for your feedbacks.
    :

    You don't have to use CsGL.BaseCode. To create an OpenGL control, which can be placed into a form use the code below. OpenGLControl is the CsGL base class for a control providing an OpenGL viewport.

    [code]

    namespace OpenGL0
    {
    class OpenGLView : OpenGLControl
    {
    public OpenGLView()
    : base()
    {
    }

    public override void glDraw()
    {
    }

    protected override void InitGLContext()
    {
    }

    protected override void OnSizeChanged(EventArgs e)
    {
    base.OnSizeChanged(e);
    Size s = Size;

    GL.glMatrixMode(GL.GL_PROJECTION);
    GL.glLoadIdentity();
    GL.gluPerspective(45.0f, (double)s.Width / (double)s.Height, 0.1f, 100.0f);
    GL.glMatrixMode(GL.GL_MODELVIEW);
    GL.glLoadIdentity();
    }
    }

    public partial class MainForm : Form
    {
    OpenGLView MainView;

    public MainForm()
    {
    InitializeComponent();

    MainView = new OpenGLView();
    MainView.Parent = this;
    MainView.Dock = DockStyle.Fill;
    }
    }
    }
    [/code]
Sign In or Register to comment.