[Jahshaka-cvs] SF.net SVN: openlibraries: [1351] trunk/src
Status: Beta
Brought to you by:
jahshaka
From: <gl...@us...> - 2007-12-22 19:59:23
|
Revision: 1351 http://openlibraries.svn.sourceforge.net/openlibraries/?rev=1351&view=rev Author: glslang Date: 2007-12-22 11:59:21 -0800 (Sat, 22 Dec 2007) Log Message: ----------- + bug fix for when shaders are not present Modified Paths: -------------- trunk/src/openmedialib/plugins/avformat/avformat_vc8.vcproj trunk/src/openpluginlib/pl/shader_manager.cpp trunk/src/openpluginlib/pl/shader_manager.hpp Modified: trunk/src/openmedialib/plugins/avformat/avformat_vc8.vcproj =================================================================== --- trunk/src/openmedialib/plugins/avformat/avformat_vc8.vcproj 2007-12-09 15:42:04 UTC (rev 1350) +++ trunk/src/openmedialib/plugins/avformat/avformat_vc8.vcproj 2007-12-22 19:59:21 UTC (rev 1351) @@ -67,7 +67,7 @@ <Tool Name="VCLinkerTool" IgnoreImportLibrary="true" - AdditionalDependencies="avcodec-51.lib avformat-51.lib avutil-49.lib" + AdditionalDependencies="avcodec.lib avformat.lib avutil.lib" OutputFile="$(OutDir)\openmedialib_avformat-vc80-d-0_5_0.dll" LinkIncremental="2" AdditionalLibraryDirectories="C:\Boost\lib;"$(SolutionDir)\src\openpluginlib\pl\$(ConfigurationName)";"$(SolutionDir)\src\openimagelib\il\$(ConfigurationName)";"C:\Program Files\FFmpeg\lib"" @@ -151,7 +151,7 @@ <Tool Name="VCLinkerTool" IgnoreImportLibrary="true" - AdditionalDependencies="avcodec-51.lib avformat-51.lib avutil-49.lib" + AdditionalDependencies="avcodec.lib avformat.lib avutil.lib" OutputFile="$(OutDir)\openmedialib_avformat-vc80-r-0_5_0.dll" LinkIncremental="1" AdditionalLibraryDirectories="C:\Boost\lib;$(SolutionDir)\src\openpluginlib\pl\$(ConfigurationName);C:\Boost\lib;$(SolutionDir)\src\openimagelib\il\$(ConfigurationName);"C:\Program Files\FFmpeg\lib"" Modified: trunk/src/openpluginlib/pl/shader_manager.cpp =================================================================== --- trunk/src/openpluginlib/pl/shader_manager.cpp 2007-12-09 15:42:04 UTC (rev 1350) +++ trunk/src/openpluginlib/pl/shader_manager.cpp 2007-12-22 19:59:21 UTC (rev 1351) @@ -246,7 +246,12 @@ CGprogram frag = cgCreateProgram( cg_context_, CG_SOURCE, fragment.c_str( ), f_profile, "main", 0 ); cgGLLoadProgram( vert ); + if( cgGetError( ) != CG_NO_ERROR ) + return false; + cgGLLoadProgram( frag ); + if( cgGetError( ) != CG_NO_ERROR ) + return false; shader.v_profile( ) = v_profile; shader.f_profile( ) = f_profile; @@ -272,9 +277,9 @@ #endif -bool shader_manager::create_shader_object( const std::string& v_uri, const std::string& f_uri, shader_object& sobj ) +bool shader_manager::create_shader_object( const std::string& v_uri, const std::string& f_uri, shader_object& sobj, bool prefix ) { - return sobj.init( v_uri, f_uri ); + return sobj.init( v_uri, f_uri, prefix ); } bool shader_manager::bind_GL_uniform( GLhandleARB program, v_float& v, const wstring& name ) const @@ -466,7 +471,7 @@ } #endif -bool shader_object::init( const std::string& v_uri, const std::string& f_uri ) +bool shader_object::init( const std::string& v_uri, const std::string& f_uri, bool prefix ) { set_retry( false ); @@ -475,8 +480,8 @@ GLSL_shader_object* obj( new GLSL_shader_object ); shader_string vert, frag; - vert = shader_manager_instance( ).open_shader_file( v_uri.substr( 5 ) ); - frag = shader_manager_instance( ).open_shader_file( f_uri.substr( 5 ) ); + vert = shader_manager_instance( ).open_shader_file( v_uri.substr( 5 ), prefix ); + frag = shader_manager_instance( ).open_shader_file( f_uri.substr( 5 ), prefix ); if( shader_manager_instance( ).create_GLSL_shader( vert, frag, *obj ) ) { @@ -490,8 +495,8 @@ Cg_shader_object* obj( new Cg_shader_object( ) ); shader_string vert, frag; - vert = shader_manager_instance( ).open_shader_file( v_uri.substr( 3 ) ); - frag = shader_manager_instance( ).open_shader_file( f_uri.substr( 3 ) ); + vert = shader_manager_instance( ).open_shader_file( v_uri.substr( 3 ), prefix ); + frag = shader_manager_instance( ).open_shader_file( f_uri.substr( 3 ), prefix ); if( shader_manager_instance( ).create_Cg_shader( vert, frag, *obj ) ) { Modified: trunk/src/openpluginlib/pl/shader_manager.hpp =================================================================== --- trunk/src/openpluginlib/pl/shader_manager.hpp 2007-12-09 15:42:04 UTC (rev 1350) +++ trunk/src/openpluginlib/pl/shader_manager.hpp 2007-12-22 19:59:21 UTC (rev 1351) @@ -161,7 +161,7 @@ virtual ~shader_object( ) { } - bool init( const std::string& v_uri, const std::string& f_uri ); + bool init( const std::string& v_uri, const std::string& f_uri, bool prefix = true ); void fini( ); public: @@ -254,7 +254,7 @@ bool delete_Cg_shader( Cg_shader_object& shader ); #endif - bool create_shader_object( const std::string& v_uri, const std::string& f_uri, shader_object& sobj ); + bool create_shader_object( const std::string& v_uri, const std::string& f_uri, shader_object& sobj, bool prefix = true ); public: bool bind_GL_uniform( GLhandleARB program, v_float& v, const wstring& name ) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |