Vuo  0.5.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
VuoShader.c File Reference

Description

VuoShader implementation.

Functions

void VuoShader_free (void *shader)
 Decrements the retain count of the OpenGL Texture Object associated with the specified VuoImage, and frees the texture VuoImage struct.
 
void VuoShader_printProgramInfoLog (CGLContextObj cgl_ctx, GLuint obj)
 Prints GLSL debug information to the console.
 
VuoShader VuoShader_make (const char *summary, const char *vertexShaderSource, const char *fragmentShaderSource)
 Compiles, links, and uploads the specified shader sources.
 
VuoShader VuoShader_valueFromJson (json_object *js)
 Decodes the JSON object js, expected to contain a 64-bit integer (memory address or 0), to create a new VuoShader.
 
json_object * VuoShader_jsonFromValue (const VuoShader value)
 Encodes value as a JSON object.
 
char * VuoShader_summaryFromValue (const VuoShader value)
 Returns a summary of the shader: the text description provided to VuoShader_make(), and the number of textures associated with the shader.
 
void VuoShader_setUniformFloat (VuoShader shader, VuoGlContext glContext, const char *uniformIdentifier, float value)
 Sets a float uniform value on the specified shader.
 
void VuoShader_setUniformPoint2d (VuoShader shader, VuoGlContext glContext, const char *uniformIdentifier, VuoPoint2d value)
 Sets a vec2 uniform value on the specified shader.
 
void VuoShader_setUniformPoint3d (VuoShader shader, VuoGlContext glContext, const char *uniformIdentifier, VuoPoint3d value)
 Sets a vec3 uniform value on the specified shader.
 
void VuoShader_setUniformPoint4d (VuoShader shader, VuoGlContext glContext, const char *uniformIdentifier, VuoPoint4d value)
 Sets a vec4 uniform value on the specified shader.
 
const char * VuoShader_getDefaultVertexShader (void)
 Returns the default vertex shader, which projects verties and passes through texture coordinates.
 
VuoPoint2d VuoShader_samplerCoordinatesFromVuoCoordinates (VuoPoint2d vuoCoordinates, VuoImage image)
 Converts the provided vuoCoordinates into GLSL Sampler Coordinates relative to the provided image.
 
VuoReal VuoShader_samplerSizeFromVuoSize (VuoReal vuoSize)
 Converts an x-axis distance in Vuo Coordinates into GLSL Sampler Coordinates.
 
VuoShader VuoShader_makeImageShader (void)
 Returns a shader that renders objects with an image (ignoring lighting), specified by uniform texture.
 
void VuoShader_resetTextures (VuoShader shader)
 Empties the list of textures associated with shader.
 
void VuoShader_addTexture (VuoShader shader, VuoGlContext glContext, const char *uniformIdentifier, VuoImage texture)
 Adds to shader an association between texture and uniformIdentifier.
 
void VuoShader_activateTextures (VuoShader shader, VuoGlContext glContext)
 Assigns each of the shader's textures to a texture unit, and passes the texture unit number along to the shader.
 
void VuoShader_deactivateTextures (VuoShader shader, VuoGlContext glContext)
 Unbinds the texture units used by this shader.
 
VuoShader VuoShader_makeColorShader (VuoColor color)
 Returns a shader that renders a solid color.
 

Function Documentation

void VuoShader_setUniformPoint3d ( VuoShader  shader,
VuoGlContext  glContext,
const char *  uniformIdentifier,
VuoPoint3d  value 
)

Sets a vec3 uniform value on the specified shader.

This function may be called from any thread. (However, the caller is responsible for ensuring that the GL context is not used simultaneously on multiple threads.)

void VuoShader_setUniformPoint4d ( VuoShader  shader,
VuoGlContext  glContext,
const char *  uniformIdentifier,
VuoPoint4d  value 
)

Sets a vec4 uniform value on the specified shader.

This function may be called from any thread. (However, the caller is responsible for ensuring that the GL context is not used simultaneously on multiple threads.)