Converting from OpenTK - Question on events

Feb 20, 2013 at 5:19 PM
I am converting a working application from OpenTK to SharpGL. I've run into two problems though.
  1. In OpenTK I have OnUpdateFrame and OnRenderFrame event handlers on the GameWindow (that's what my class inherits from), but I can't seem to find anything like that in SharpGL's OpenGLControl. Am I going about this wrong?
  2. I also use the SwapBuffers call on the GameWindow. The only thing I see for that is in the Win32 static class, but I'm not sure what I would pass it.
Coordinator
Feb 21, 2013 at 7:40 AM
Hi,

You can use OpenGLDraw instead of OnUpdateFrame/OnRenderFrame - with OpenGL this is where you do your drawing code.

You don't need to use SwapBuffers - OpenGL handles the double buffering for you :)
Feb 21, 2013 at 12:11 PM
Good to know, that did the trick!

One last question: It would appear as though the control never gets focus, and as a result I can't seem to capture keyboard input. Do I need to handle that in my WPF window and then send those events to the OpenGL control?
Coordinator
Feb 21, 2013 at 9:04 PM
I'd have to get into the code to double check this, but my guess would be yes indeed- from memory the OpenGL control is wrapped in a user control, when I get a moment I can check this for you :)


On 21 February 2013 14:11, gizmodomn <notifications@codeplex.com> wrote:

From: gizmodomn

Good to know, that did the trick!

One last question: It would appear as though the control never gets focus, and as a result I can't seem to capture keyboard input. Do I need to handle that in my WPF window and then send those events to the OpenGL control?

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpgl@discussions.codeplex.com)

To start a new discussion for this project, email sharpgl@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com