Author Topic: Using native gl commands  (Read 2532 times)

Offline gamerfan

  • int
  • **
  • Posts: 97
    • View Profile
Using native gl commands
« on: November 10, 2011, 05:31:12 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Using native gl commands
« Reply #1 on: November 10, 2011, 08:59:32 am »
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.

Offline gamerfan

  • int
  • **
  • Posts: 97
    • View Profile
Re: Using native gl commands
« Reply #2 on: November 10, 2011, 09:15:20 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Using native gl commands
« Reply #3 on: November 10, 2011, 09:41:17 am »
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.