Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Two managed c++ OpenGL viewers on the same windows form c#, it is possible ?

Based on the test application provided on the article:"Creating an OpenGL view on a Windows Form" , I get two black frames when I duplicate the two opengl objects. It looks like resources are shared between the two frames.

I have modified the constructor to be able to specify x and y positions.
I have also used these x, y values to ReSizeGLScene.

Do you think it is possible? How is wglMakeCurrent behaving in this case ?
My wish would be to have two animation viewers on the same form to render different objects.

Thank you very much in advance.
MiQi

What I have tried:

I have modified the constructor to be able to specify x and y positions.
I have also used these x, y values to ReSizeGLScene.

The effect is like that:
issue-8172-19062019-A.gif
Posted
Updated 20-Jun-19 5:15am

Ask your question in the forum at the bottom of the article you're talking about. Articles are supported by the people that wrote them.
 
Share this answer
 
you must carefully look and debug the code. When you have copied the source code both may load the same resources or use global data.

Copying code without understanding it, is very dangerous. And may be a bit shady or illegal. :-O
 
Share this answer
 
Comments
SuperMiQi 20-Jun-19 11:50am    
Hello,

This code sample seems a good starting point for study base as it draws basic shape. Currently I cannot do too much as I have no idea how it behaves and I would like to collect more information to understand opengl better and then feel more confident on this topic. Do you have good udemy or other online rooms, I could apply to learn this graphical library. I hope they will cover opengl memory management as well.

CurrentLy I have two activex com object using opengl and they use the same init steps but they cannot be placed on the same form. This is why this sample is really good candidate for discussions. I can see the gllist shared between the two viewers seems to be the reason. Once I have more inputs I will share with you.

Thank very much in advance.
Best regards.

MiQi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900