i had a look at my code (heres the relative bits, hope u can understand, why they dont make this editbox a bit bigger escapes me, ie its not like we're all viewing the web in 640x480 anymore).
this does hardware occlusion as well i think mmm_is_visable is set if its visable (it might lag a delay of one frame which is not noticable)
if ( !options.skip_rendering )
{
g_SC->portal_man.update_PortalManager();
g_SC->gamewindow_fbo.bind_fbo();
g_SC->render_scene( percentWithinTick );
g_SC->gamewindow_fbo.unbind_fbo();
g_SC->render_gamewindow_fbo_texture();
}
for ( vector<int>::iterator it = mmmIDs_attached_to_portal.begin(); it<mmmIDs_attached_to_portal.end(); ++it )
{
MMM *mmm = g_SC->mmmLIB.return_MMM_ptr_from_ID( *it );
CHECK_NULL_PTR( mmm )
if ( mmm->mmm_is_visable )
{
g_rm.ogl.bindTexture_2D_to_unit( 13, portal_texID );
portal_fbo.bind_fbo();
g_SC->render_scene( *this, 0.0 );
portal_fbo.unbind_fbo();
}
}