Jump to content
  • Advertisement
Sign in to follow this  
one mind

OpenGL Opengl and winforms

This topic is 5143 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!