Using native gl commands

Started by gamerfan, November 10, 2011, 05:31:12 AM

Previous topic - Next topic

gamerfan

can I use native gl commands in side onDrawFrame(GL10 gl) method? Say for example, if I want to render some objects based on CSG(Constructive Solid Geometry), how can I do it in jpct-Ae?

EgonOlsen

You are not supposed to mix this. If you keep track of your state changes yourself and restore the ones that existed before executing your own commands, it will work. Everything else will screw things up. Keep in mind that OpenGL is state based. Anyway, there's no gl command for doing CSG, so i don't really get the question in this context.

gamerfan

You are right,there is no gl command for that. It is to be rendered. I have a java file that does it.so my query is that if at all I was able to render it, can I display it along with other objects of jpctAE?

EgonOlsen

As said: You can in theory if you setup your own stuff correctly and clean it up afterwards. But please don't expect me to support this. jPCT does a lot of things behind the scenes to keep state changes at a minimum and fiddling around with that by executing gl commands behind it's back is asking for serious trouble unless you REALLY know what you are doing. Plus, if you ever decide to switch to ES 2.0 (assuming that you are not using this already), everything will go BOOM.

It would be better to do the CSG in whatever data structure is appropriate and create regular jPCT Object3Ds from that.