Opengl and winforms

Started by
3 comments, last by nife 19 years, 8 months ago
Hi, I am using c# and glut for windows in my opengl programming. Is it possible to render on winforms like managed diectx does? Or do i need to use a win32 wrapper? Any info would be great Thanks :)
Advertisement
It's me again :P

With Tao you can put SimpleOpenGLControl (in Tao.Platform.Windows) control on the form.
You'll also have to call InitializeContexts() with control you've just added and set up the basic stuff like viewports and projections, and then you're pretty much ready to start rendering...
You can see the code doing this right here. Comments are slovene coz the tutorial was written for slovenian version of gamedev.net ;) but I think the code I wrote is readable enaugh to understand.

enjoy

PS. #d folder in the zip I provided is for #develop users.
...
Hi Snake :)
Is there any other way to do it?
Its just that, this control uses 100% cpu :(
Is there a reason for this?
Also, is there any info anywhere about this contol? In english :) my slovene is a bit rusty :P
Thanks for all your help
This control is IMHO pretty good, but not perfect. but that's not the point here.
I think it uses 100% CPU becouse it is rendering within the loop and when we finish rendering one frame, we go right ahead with rendering another one. I think it was a disscussion about 100% CPU time a while ago.

I don't think I could recall any tutorials or such except few from ridge's website.
web archive has one of the tutorials cached. Pictures are off, but I think you could get the stuff working.

Cheers!

PS: Could you not open so many new threads? It's getting kinda flooded :P
...
Quote:Original post by one mind
Hi Snake :)
Is there any other way to do it?
Its just that, this control uses 100% cpu :(
Is there a reason for this?
Also, is there any info anywhere about this contol? In english :) my slovene is a bit rusty :P
Thanks for all your help


The reson that it is using 100%, is that the main loop runs all the time (creating as high fps as possible), however since the OS slice the CPU-usage equally to all the programs who need it, you don't have to worry.
For instance, if you run 2 copies of your program at the same time, they would each get 50% (if other threads doesn't need any). So you see, in a multithreaded enviroment (like Windows or Linux), you don't have to worry, your program will always be treated like any other program (except if they got higher priority).
Killers don't end up in jailThey end up on a high-score!

This topic is closed to new replies.

Advertisement