luca-piccioni / OpenGL.Net

Modern OpenGL bindings for C#.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use it with Controls?

AlexeyGapon opened this issue · comments

Hello. Can you create a tutorial how to create a control like OpenTK.GLControl.

Yes, I can do that in next weeks. I already have a control based on
WinForms running on Windows and Linux.

Il giorno ven 5 giu 2015 00:22 AlexeyGapon notifications@github.com ha
scritto:

Hello. Can you create a tutorial how to create a control like
OpenTK.GLControl.


Reply to this email directly or view it on GitHub
#1.

Hello so how it`s going?

Could you commit WinForm Control for OpenGL?
I don`t want to use OpenTK they are using almost own naming, and it makes my work much slower.
Thank you.

You can take the Tao.Framework User control implementation, and replace the
OpenGL calls with the ones of OpenGL.Net.

My control will be implemented in this way.

Il giorno Mar 30 Giu 2015 17:21 AlexeyGapon notifications@github.com ha
scritto:

Could you commit WinForm Control for OpenGL?
I don`t want to use OpenTK they are using there almost own naming, and it
makes my work much slower.
Thank you.


Reply to this email directly or view it on GitHub
#1 (comment)
.

Oh thnak you

I did as you wrote, but it throws an error
///

    /// OpenGL error checking.
    /// </summary>


    [Conditional("DEBUG")]
    private static void DebugCheckErrors()
    {
        ErrorCode error = GetError();
        if (error != ErrorCode.NoError)
            throw new InvalidOperationException(error.ToString());
    }

Invalid Operation when call Gl.End()

Output
has exited with code -1073741819 (0xc0000005) 'Access violation'.

In OpenGL.Net, in Debug build, every call to OpenGL API is checked for
errors (except a few, like GetError and TexImage).

Check the manual for glEnd, and you'll find the reason of the error.

Il giorno Mer 1 Lug 2015 12:46 AlexeyGapon notifications@github.com ha
scritto:

I did as you wrote, but it throws an error
///

/// OpenGL error checking.
///
[Conditional("DEBUG")]
private static void DebugCheckErrors()
{
ErrorCode error = GetError();

    if (error != ErrorCode.NoError)
        throw new InvalidOperationException(error.ToString());
}

Invalid Operation when call Gl.End()


Reply to this email directly or view it on GitHub
#1 (comment)
.

This code worked fine in in OpenTk and Tao. But here is an error.
I was sucessfuly implemented your api references for tao framework user control and it works but i cant call OpenGL drawings. It is crashing for some reason. I can give you all the code.

So did you test this src on some real projects? Is it save? Can i use it for the engine on OpenGL or it has many bugs?
Could you help me with calling OpenGl commands.And explain why there is an exception appears

StackOverflow says that i should not use glGetError in glBegin - glEnd. So i will disable this glGetError
it should work fine?

How to disable DEBUG mode?

Did you call glGetError after each routine in you original code?

The library is merely a wrapper, automatically generated using the XML
specification. So, if the glGetError returns an error, you can blame the
GPU driver or your code.

Possibly there are bugs, nobody can assure bug free implementations. I've
started some unit test, and successfully run on my machines. I'm using this
code base on a 170K SLOC project also.

A quick and dirty solution is to run with the release version, that exclude
glGetError calls. However, the exception indicates that the OpenGL call
sequence is wrong in some way.

Il giorno Mer 1 Lug 2015 17:18 AlexeyGapon notifications@github.com ha
scritto:

So did you test this src on some real projects? Is it save? Can i use it
for the engine on OpenGL or it has many bugs?
Could you help me with calling OpenGl commands.And explain why there is an
exception appears


Reply to this email directly or view it on GitHub
#1 (comment)
.

I removed glGetError from the calls and everything works fine right now. I did`t test it for something real complex.I will continue writing my library using OpenGL.NET, and will report if something happend.

Keep in mind that you have a bug in your OpenGL code, located where the
exception is thrown.

You are just ignoring it.

Il giorno Gio 2 Lug 2015 10:27 AlexeyGapon notifications@github.com ha
scritto:

I removed glGetError from the calls and everything works fine right now. I
did`t test it for something real complex.I will continue writing my library
using OpenGL.NET, and will report if something happend.


Reply to this email directly or view it on GitHub
#1 (comment)
.

I read in documentation that you cant call glGetError between glBegin() .. glEnd() that is why an error accure. My code drawing simple recangle. So there are cant be bug in a code.

You are right. I'll fix it ASAP.

Il giorno Gio 2 Lug 2015 15:07 AlexeyGapon notifications@github.com ha
scritto:

I read in documentation that you can`t call glGetError between glBegin()
.. glEnd() that is why an error accure.


Reply to this email directly or view it on GitHub
#1 (comment)
.