I'm trying to make a multi instance engine in C++ with a wrapper for C#.
In made the engine in such way that there is a function like CreateEngine that takes as a parameter the handle to the window or control on which I want the engine to be initialized.
In C# I made a custom control that initializes opengl for drawing and has a render event.
If I make just one instance of the control everything works fine but then when I create another one placed in another window, the second one flickers to black(alternates the clear screen color with black although there is no reference to black in my code). Neither of them doesn't draw anything. Instead they just clear the color of the screen. The first control clears the space to blue and the second to red (theoretically).
Since there is nothing to draw I don't think I have to share the wgl lists or something(I did it anyway but commenting that part of code won't solve anything).
Some more thinks to note: I'm not quite an OpenGL n00b but this really puzzles me. I also checked about everything I know I this area. The problem only appears when the are more instances of the control. In C# I overwrote the OnPaint event clearing the viewport and I invalidate it every 33 milliseconds. I also overwrote OnPaintBackground since this seems to generate flickering issues.