Usage : my $context = cgCreateContext() or die "Cannot create context"; Purpose : Obtain a Cg context that programs can be stored in. Returns : An identifier for the context, or false for failure. Throws : None Comments :</pre> <pre> See Also : DestroyContext</pre> <p> </p> <h2><a name="cgcreateprogram">cgCreateProgram</a></h2> <pre> Usage : my $program = cgCreateProgram ($context, $type, $program_code, $profile, $entry, $args); $program or die("Cannot create program"); Purpose : Creates a cgShader program from a string containing source. Returns : The program itself, or undef if an error has occured. Throws : None Comments : Context is a CGcontext returned from CreateContext, Type is either SDL::OpenGL::Cg::SOURCE or SDL::OpenGL::Cg::Object dependant upon whether the shader is compiled or not. Program_code is the entire source code for the shader, as a single string. Entry is the name of the entry point of the shader. Args is an array reference containing strings which are passed directly to the compiler (Currently unimplemented).</pre> <pre> See Also : cgBindProgram, cgCopyProgram, cgCreateProgramFromFile, cgLoadProgram</pre> <p> </p> <h2><a name="cgcreateprogramfromfile">cgCreateProgramFromFile</a></h2> <pre> Usage : my $program = cgCreateProgramFromFile ($context, $type, $file, $profile, $entry, $args); $program or die("Cannot create program"); Purpose : Creates a cgShader program from a file. Returns : The program itself, or undef if an error has occured. Throws : None Comments : Context is a CGcontext returned from CreateContext, Type is either SDL::OpenGL::Cg::SOURCE or SDL::OpenGL::Cg::Object dependant upon whether the shader is compiled or not. File is the name of the file containing the shader. Entry is the name of the entry point of the shader. Args is an array reference containing strings which are passed directly to the compiler (Currently unimplemented).</pre> <pre> See Also : cgBindProgram, cgCopyProgram, cgCreateProgram, cgLoadProgram</pre> <p> </p> <h2><a name="cgdestroycontext">cgDestroyContext</a></h2> <pre> Usage : cgDestroyContext($context) or die "Cannot destroy context"; Purpose : Deletes a context and all of the programs it contains. Returns : True if the context has been successfully deleted, false if it hasn't. Throws : None Comments :</pre> <pre> See Also : cgCreateContext</pre> <p> </p> <h2><a name="cgdisableprofile">cgDisableProfile</a></h2> <pre> Usage : cgDisableProfile(PROFILE_FP20()) or die "Cannot disable FP20"; Purpose : Deactivate a profile Returns : True if the profile is successfully disabled, false if it failed for some reason Throws : None Comments :</pre> <pre> See Also : cgEnableProfile, cgIsProfileSupported, PROFILE CONSTANTS</pre> <p> </p> <h2><a name="cgenableprofile">cgEnableProfile</a></h2> <pre> Usage : cgEnableProfile(PROFILE_FP20()) or die "Cannot enable FP20"; Purpose : Activate a profile Returns : True if the profile is successfully enabled, false if it failed for some reason. Throws : None Comments :</pre> <pre> See Also : cgDisableProfile, cgIsProfileSupported, cgGetLatestProfile PROFILE CONSTANTS</pre> <p> </p> <h2><a name="cggeterror">cgGetError</a></h2> <pre> Usage : my $err = cgGetError(); Purpose : Obtaining the error code of the last error which occured. Returns : The error code. Throws : None Comments :</pre> <pre> See Also :</pre> <p> </p> <h2><a name="cggetlastlisting">cgGetLastListing</a></h2> <pre> Usage : my $listing = cgGetLastListing($context); Purpose : Obtain the results of the last listing compiled in a given context, often used for working out why a shader compilation failed. Returns : The output string, or undef if no program has been compiled in that context. Throws : None Comments :</pre> <pre> See Also :</pre> <p> </p> <h2><a name="cggetlatestprofile">cgGetLatestProfile</a></h2> <pre> Usage : my $profile = cgGetLatestProfile(CG_VERTEX()); Purpose : Obtaining the profile code of the last profile of a class to have been enabled. Returns : The profile code. Throws : None Comments :</pre> <pre> See Also : cgEnableProfile, cgDisableProfile</pre> <pre>
See Also : cgSetMatrixParameterc, cgSetMatrixParameterr, cgSetParameter, cgSetStateMatrixParameter</pre> <p> </p> <h2><a name="cggetprofilestring">cgGetProfileString</a></h2> <pre> Usage : print "FP20 is called ",cgGetProfileString(PROFILE_FP20()); Purpose : Obtains the profile name associated with a particular ID. Returns : The name of the profile, or undef if the ID isn't known. Throws : None Comments :</pre> <pre> See Also : PROFILE CONSTANTS</pre> <p> </p> <h2><a name="cgisprofilesupported">cgIsProfileSupported</a></h2> <pre> Usage : my $can_fp20 = cgIsProfileSupported(PROFILE_FP20); Purpose : Find out whether a given profile is supported. Returns : True is the profile is supported, false is it isn't. Arguments : The profile ID to be checked. Throws : None Comments :</pre> <pre> See Also : PROFILE CONSTANTS, cgDisableProfile, cgEnableProfile</pre> <p> </p> <h2><a name="cgloadprogram">cgLoadProgram</a></h2> <pre> Usage : cgLoadProgram($prog) or die ("Cannot load program"); Purpose : Loads a compiled program into memory. Returns : True if the program was loaded successfully, false if there was an error. Arguments : The program to be loaded. Throws : None Comments : Should be called after cgCompileProgram() and before cgBindProgram().</pre> <pre> SeeAlso : cgBindProgram, cgCompileProgram</pre> <p> </p> <h2><a name="cgsetmatrixparameterc">cgSetMatrixParameterc</a></h2> <pre> Usage : cgSetMatrixParameterc ($param, @vals) or die "Error!"; Purpose : Sets the value of a matrix parameter Returns : True if the assignment went okay, false if there was an error. Arguments : The parameter to be set, and the values to set it to. Throws : None Comments : Differs from cgSetMatrixParameterr in that this version expects the data to be in column format. TODO : Currently only sets float4x4 matrices.</pre> <pre> SeeAlso : cgGetNamedParameter, cgSetMatrixParameterc, cgSetParameter, cgSetStateMatrixParameter</pre> <p> </p> <h2><a name="cgsetmatrixparameterr">cgSetMatrixParameterr</a></h2> <pre> Usage : cgSetMatrixParameterr ($param, @vals) or die "Error!"; Purpose : Sets the value of a matrix parameter Returns : True if the assignment went okay, false if there was an error. Arguments : The parameter to be set, and the values to set it to. Throws : None Comments : Differs from cgSetMatrixParameterc in that this version expects the data to be in row format. TODO : Currently only sets float4x4 matrices.</pre> <pre> SeeAlso : cgGetNamedParameter, cgSetMatrixParameterc, cgSetParameter, cgSetStateMatrixParameter</pre> <p> </p> <h2><a name="cgsetstatematrixparameter">cgSetStateMatrixParameter</a></h2> <pre> Usage : cgSetStateMatrixParameter($param, CG_MODELVIEW_PROJECTION_MATRIX(), CG_MATRIX_IDENTITY()) or die "Error!"; Purpose : To allow parameters to follow the OpenGL matrix state more easily, to allow setting Modelview etc. for the shaders. Returns : True if the parameter was set without difficulty, undefined if a problem was experienced. Arguments : None Throws : None Comments : The second argument indicates which of OpenGL's matrices it should follow, and the third indicates which of the transforms to apply as it's copied. See MATRIX CONSTANTS for more information.
</pre> <p> </p> <hr /> <h1><a name="copyright">COPYRIGH/a</h1> <p>This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
</p> <p>The full text of the license can be found in the LICENSE file included with this module.
</p> <p> </p> <hr /> <h1><a name="see_also">SEE ALS/a</h1> <p>perl(1), SDL, SDL::OpenGL
</p>
</body>
</html>
3 POD Errors
The following errors were encountered while parsing the POD:
Deleting unknown formatting code T<>
Deleting unknown formatting code Y<>
Deleting unknown formatting code R<>
Unknown E content in E</a>
Deleting unknown formatting code O<>
To install SDL::OpenGL::Cg, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SDL::OpenGL::Cg
CPAN shell
perl -MCPAN -e shell install SDL::OpenGL::Cg
For more information on module installation, please visit the detailed CPAN module installation guide.