Docs @ Psychtoolbox Wiki : glShaderSource

Search PTB Function help:
homepsychtoolbox.orgpage updateslogin

glShaderSource

PsychtoolboxPsychOpenGLMOGLwrap

glShaderSource Interface to glShaderSource

usage: glShaderSource(shader, shadersource, debug)

This function differs from its C counterpart. You have to pass in the
handle of the shader as returned by glCreateShader in 'shader'.

You have to pass a single character string 'shadersource' that
contains the ASCII text of the shaders source code. Each line in the
string needs to be terminated by a '\n' aka ASCII code 10 aka newline.
This string will be split up into the array of strings as expected by
the C function glShaderSource.

A simple way to read a shader from a standard text file is as follows:
fid=fopen('MyShader.txt', 'r');
shadersource=fread(fid);
fclose(fid);
glShaderSource(shader, shadersource);

C function: void glShaderSource(GLuint shader, int numOfStrings, const char strings, int *lenOfStrings);




Path   Retrieve current version of glShaderSource.m from berliOS: beta | view WebSVN changelog of trunk branch
Psychtoolbox/PsychOpenGL/MOGL/wrap/glShaderSource.m


Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0192 seconds