PDA

View Full Version : Can i Add a component into object?



azrael11
07-09-2013, 09:01 AM
Is this possible to add a TPanel component in a glplane object?

So when rotatiing or scaling the glplane, rotating or scaling the TPanel inside?

Thank you

Ñuño Martínez
07-09-2013, 11:21 AM
No. TPanel uses GDI (or whatever they call it now) while glplane uses OpenGL. GDI and OpenGL aren't compatible.

azrael11
07-09-2013, 01:26 PM
No. TPanel uses GDI (or whatever they call it now) while glplane uses OpenGL. GDI and OpenGL aren't compatible.

If you are right then how the firemonkey do that...
There is an example in the DelphiXE2 that can do that ... but i don't have DelphiXE2 so i can see that..
And firemonkey uses part of glscene so i think there is a way... but i don't know it...

Thank you nuno martinez...

Sascha Willems
07-09-2013, 02:27 PM
Firemonkey is a separate framework. All the components in FireMonkey have been rewritten from scratch and don't use VCL at all (on windows it uses DirectX, on other platforms OpenGL (ES)), so that's why it may work there. And it's based on VGScene afaik, and not on glscene (though I've heard they "stole" some code from glScene).

azrael11
07-09-2013, 06:23 PM
Firemonkey is a separate framework. All the components in FireMonkey have been rewritten from scratch and don't use VCL at all (on windows it uses DirectX, on other platforms OpenGL (ES)), so that's why it may work there. And it's based on VGScene afaik, and not on glscene (though I've heard they "stole" some code from glScene).

So there is no way so i can put a twincontrol component in opengl behave like a glscene object?
No?

Thank you Sascha Willems...

Sascha Willems
08-09-2013, 08:25 AM
Well, you could draw the canvas of the TPanel (or all other TWinControls) to a Bitmap with e.g. BitBlt, and then feed that bitmap to OpenGL as a texture. This would allow you to display your TWinControl inside OpenGL. Though that won't be very fast.

azrael11
09-09-2013, 11:38 AM
Well, you could draw the canvas of the TPanel (or all other TWinControls) to a Bitmap with e.g. BitBlt, and then feed that bitmap to OpenGL as a texture. This would allow you to display your TWinControl inside OpenGL. Though that won't be very fast.

Yes i know about this... and already try it... it slow and became slower where more objects put in the panel... not so good option....

So i must think another way to decode the video and audio in the texture to use in glplane...

Thank you Sascha Willems...