diff -rupN ./opensg_org/Examples/Simple/CMakeLists.fromosg.txt ./opensg_examples/Examples/Simple/CMakeLists.fromosg.txt --- ./opensg_org/Examples/Simple/CMakeLists.fromosg.txt 2017-01-16 11:34:53.072135000 +0100 +++ ./opensg_examples/Examples/Simple/CMakeLists.fromosg.txt 2017-01-18 09:51:15.083388200 +0100 @@ -15,8 +15,6 @@ FILE(GLOB SRCFILES "*.cpp") # stuff that is broken -- these examples need to be fixed LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/clusterclientshader.cpp") LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/geometryshader.cpp") -LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/phongshaderwithglmaterials.cpp") -LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/shader.cpp") ############################################################################# # get dependencies diff -rupN ./opensg_org/Examples/Simple/CMakeLists.standalone.txt ./opensg_examples/Examples/Simple/CMakeLists.standalone.txt --- ./opensg_org/Examples/Simple/CMakeLists.standalone.txt 2017-01-16 11:34:53.072135000 +0100 +++ ./opensg_examples/Examples/Simple/CMakeLists.standalone.txt 2017-01-16 13:15:44.820162000 +0100 @@ -34,8 +34,6 @@ FILE(GLOB SRCFILES "*.cpp") # stuff that is broken -- these examples need to be fixed LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/clusterclientshader.cpp") LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/geometryshader.cpp") -LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/phongshaderwithglmaterials.cpp") -LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/shader.cpp") ############################################################################# # get dependencies diff -rupN ./opensg_org/Examples/Simple/phongshaderwithglmaterials.cpp ./opensg_examples/Examples/Simple/phongshaderwithglmaterials.cpp --- ./opensg_org/Examples/Simple/phongshaderwithglmaterials.cpp 2017-01-16 11:34:53.087735000 +0100 +++ ./opensg_examples/Examples/Simple/phongshaderwithglmaterials.cpp 2016-10-20 14:29:16.440561900 +0200 @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #else @@ -24,17 +24,19 @@ #include #include #include -#include +#include #include #include #endif +using namespace OSG; + // The SimpleSceneManager to manage simple applications SimpleSceneManagerRefPtr _mgr = NULL; bool phong_active = false; std::vector materials; -SHLChunkRefPtr phong_chunk; +SimpleSHLChunkRefPtr phong_chunk; NodeRefPtr scene; @@ -116,14 +118,14 @@ void update(void) // --------------------------------------------------------------------------------- -SHLChunkTransitPtr createPhongShaderMaterial(void) +SimpleSHLChunkTransitPtr createPhongShaderMaterial(void) { - SHLChunkRefPtr _shl = SHLChunk::create(); + SimpleSHLChunkRefPtr _shl = SimpleSHLChunk::create(); _shl->setVertexProgram(_vp_program); _shl->setFragmentProgram(_fp_program); - return SHLChunkTransitPtr(_shl); + return SimpleSHLChunkTransitPtr(_shl); } // --------------------------------------------------------------------------------- @@ -160,7 +162,7 @@ void getAllMaterials(Node *node, std::ve mats.push_back(cm); } - for(int i = 0; i < node->getNChildren(); ++i) + for(UInt32 i = 0; i < node->getNChildren(); ++i) getAllMaterials(node->getChild(i), mats); } @@ -181,7 +183,7 @@ int main(int argc, char **argv) scene = SceneFileHandler::the()->read("Data/tie.wrl"); if(scene == NULL) - scene = makeTorus(0.3, 4, 16, 64); + scene = makeTorus(0.3f, 4.0f, 16, 64); // init material phong_chunk = createPhongShaderMaterial(); @@ -221,8 +223,8 @@ int main(int argc, char **argv) // create a gradient background. GradientBackgroundRefPtr gbg = GradientBackground::create(); gbg->clearLines(); - gbg->addLine(Color3f(0.7, 0.7, 0.8), 0); - gbg->addLine(Color3f(0.0, 0.1, 0.3), 1); + gbg->addLine(Color3f(0.7f, 0.7f, 0.8f), 0.f); + gbg->addLine(Color3f(0.0f, 0.1f, 0.3f), 1.f); //set gradient background ViewportRefPtr vp = gwin->getPort(0); diff -rupN ./opensg_org/Examples/Simple/shader.cpp ./opensg_examples/Examples/Simple/shader.cpp --- ./opensg_org/Examples/Simple/shader.cpp 2017-01-16 11:34:53.087735000 +0100 +++ ./opensg_examples/Examples/Simple/shader.cpp 2016-10-20 14:25:09.761416200 +0200 @@ -24,8 +24,7 @@ #include #include #include -#include -//#include +#include #else // Headers #include @@ -45,14 +44,15 @@ #include #include #include -#include -//#include +#include #endif +using namespace OSG; + // The SimpleSceneManager to manage simple applications SimpleSceneManagerRefPtr _mgr = NULL; NodeRefPtr _scene; -SHLChunkRefPtr _shl; +SimpleSHLChunkRefPtr _shl; // vertex shader program. static std::string _vp_program = @@ -162,9 +162,9 @@ int main(int argc, char **argv) NodeRefPtr point1_beacon = makeCoredNode(&point1_trans); point1_trans->editMatrix().setTranslate(0.0, 100.0, 0.0); - point1_core->setAmbient(0.15,0.15,0.15,1); - point1_core->setDiffuse(0.8,0.8,0.8,1); - point1_core->setSpecular(0.0,0.0,0.0,1); + point1_core->setAmbient (0.15f,0.15f,0.15f,1.f); + point1_core->setDiffuse (0.8f, 0.8f, 0.8f, 1.f); + point1_core->setSpecular(0.0f, 0.0f, 0.0f, 1.f); point1_core->setBeacon(point1_beacon); point1_core->setOn(true); @@ -187,8 +187,8 @@ int main(int argc, char **argv) bottom_tex_env->setEnvMode(GL_MODULATE); SimpleMaterialRefPtr bottom_mat = SimpleMaterial::create(); - bottom_mat->setAmbient(Color3f(0.3,0.3,0.3)); - bottom_mat->setDiffuse(Color3f(1.0,1.0,1.0)); + bottom_mat->setAmbient(Color3f(0.3f,0.3f,0.3f)); + bottom_mat->setDiffuse(Color3f(1.0f,1.0f,1.0f)); bottom_mat->addChunk(bottom_tex); bottom_mat->addChunk(bottom_tex_env); @@ -208,7 +208,7 @@ int main(int argc, char **argv) // create the shader material ChunkMaterialRefPtr cmat = ChunkMaterial::create(); - _shl = SHLChunk::create(); + _shl = SimpleSHLChunk::create(); _shl->setVertexProgram (_vp_program); _shl->setFragmentProgram(_fp_program); _shl->addUniformVariable("groundHeight", 1.0f);