C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2722
Number of posts: 5749

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
openGL in c# Posted by gulmisal on 30 Jan 2006 at 10:55 PM
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.
Report
Re: openGL in c# Posted by VanilleBert on 4 Feb 2006 at 11:32 AM
: 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.


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;
        }
    }
}




 

Recent Jobs