File indexing completed on 2026-04-09 07:49:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #include "ssys.h"
0028 #include "SGLM.h"
0029 #include "SScene.h"
0030
0031 #include "SGLFW.h"
0032 #include "SGLFW_Scene.h"
0033 #include "SGLFW_Evt.h"
0034 #include "SGLFW_SOPTIX.h"
0035
0036
0037 int main(int argc, char** argv)
0038 {
0039 bool DUMP = ssys::getenvbool("SGLFW_SOPTIX_Scene_test_DUMP");
0040
0041 stree* tree = stree::Load();
0042 SScene* scene = SScene::Load() ;
0043
0044
0045
0046 if( tree == nullptr || scene == nullptr ) std::cerr
0047 << "SGLFW_SOPTIX_Scene_test.main"
0048 << " LOAD FAIL "
0049 << " tree " << ( tree ? "YES" : "NO " )
0050 << " scene " << ( scene ? "YES" : "NO " )
0051 << "\n"
0052 ;
0053
0054 if( tree == nullptr || scene == nullptr ) return 0;
0055
0056 if(DUMP) std::cout << scene->desc() ;
0057
0058 SRecord* ar = SRecord::Load("$AFOLD", "$AFOLD_RECORD_SLICE" ) ;
0059 SRecord* br = SRecord::Load("$BFOLD", "$BFOLD_RECORD_SLICE" ) ;
0060 SGen* gs = SGen::Load("$AFOLD", "$AFOLD_GENSTEP_SLICE" );
0061
0062 SGLM gm ;
0063 gm.setTreeScene(tree, scene);
0064 gm.setRecord( ar, br );
0065 gm.setGenstep( gs );
0066
0067
0068 if(ssys::is_under_ctest())
0069 {
0070 std::cout << argv[0] << " detected ssys::is_under_ctest so skip interactive renderloop popping up a window\n" ;
0071 return 0;
0072 }
0073
0074
0075 SGLFW gl(gm);
0076
0077 SGLFW_Scene sc(gl);
0078 SGLFW_Evt ev(gl);
0079
0080 std::cout << "[SGLFW_SOPTIX \n" ;
0081 SGLFW_SOPTIX ox(gl);
0082 std::cout << "]SGLFW_SOPTIX \n" ;
0083
0084 while(gl.renderloop_proceed())
0085 {
0086 gl.renderloop_head();
0087 gl.handle_frame_hop();
0088
0089 if(gm.option.M)
0090 {
0091 if( gm.toggle.cuda ) ox.render();
0092 else sc.render();
0093 }
0094 ev.render();
0095
0096 gl.handle_snap();
0097 gl.renderloop_tail();
0098 }
0099 return 0 ;
0100 }
0101