Jump to content
  • Advertisement
Sign in to follow this  

[.net] Drawing on to c# form by different sources

This topic is 3619 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 trying to create a c++ dll which draws some stuff to a c# form (hWd passed as a parameter to the dll). It works fine up to that point. I put a timer to the c# application and it calls the dll's draw method on each tick. What I am trying to add now is an overlay on top of what is drawn by the c++ part. That overlay can be drawn by the c# application itself or maybe by some other dll. Is that possible? And if so how do i go about it? Something like void tick() { openGL_Part.draw(); draw_Some_Stuff_On_Top_Of_That(); }

Share this post


Link to post
Share on other sites
Advertisement
What do you want to use? GDI+? The System.Drawing namespace contains tons of useful drawing stuff, and would make a great overlay API. It may be a tad slow, so make sure you do all of your intensive stuff in a hardware accelerated API.

Share this post


Link to post
Share on other sites
Quote:
Original post by fear4ever
That overlay can be drawn by the c# application itself or maybe by some other dll.


It doesn't really matter whether it gdi+ or anything else that does the drawing. What i am trying to find is the method of double buffered drawing onto a c# form (flicker free). As i understand OpenGL and gdi+ use different buffers for drawing so something like is not possible?

in each timer tick

clear_area()
oglDLL.draw() //dont swap buffers yet
some_other_dll.draw() //dont swap buffers yet
gdi+.draw() //dont swap buffers yet
swap_buffers()

Any explanation or pointers to that kind of drawing tecnique would be appriciated.



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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!