Bonzai Engine Forum

Bonzai Engine & Tools => Bonzai Engine => Topic started by: refuzee on July 09, 2013, 09:25:33 AM

Title: Combine Bonzai Engine Model Loader with existing Render Class
Post by: refuzee on July 09, 2013, 09:25:33 AM
Hi there,

thank you very much for your help so far (I'm teamed with Jan)! Here is another problem we would like to find an easy way for:
We have an existing stereoscopic render class and would like to include the model loader of the Bonzai engine.
What would be the fastest and best practice way to do that ? Here's a a snippet (I know its very dirty and probably full of stuff to do other ways..)
One Image gets rendered in one viewport, after the right image the left image gets rendered as well so this code basically repeats with some changed values.


We would appreciate some help with this as we all are not very experienced with Bonzai or OpenGL. Thanks in advance! And thank you for your help so far Jerome.
Title: Re: Combine Bonzai Engine Model Loader with existing Render Class
Post by: jerome_j on July 09, 2013, 10:14:38 AM
The best thing would be to start cleaning up your code by avoiding clearing the framebuffer twice, moving the OpenGL init states outside the render loop, ...

Also, I'll highly recommend to stop using GL11 fixed pipeline / deprecated stuff (matrix stack, light/material properties). We provide everything in Bonzai engine to replace all your deprecated GL11 calls, just look at the tutorials (MatrickStack, Lights).

Pseudo code:

If you don't use Bonzai engine framework to create init your app, look at ModelLoadingNoFramework tutorial to create and initialize a valide glApi object.
Title: Re: Combine Bonzai Engine Model Loader with existing Render Class
Post by: refuzee on July 17, 2013, 10:37:14 AM
hi jerome,

thanks for your help. i'll try your advice and see what we can do..