Esempio n. 1
0
    instance->imageRenderer = VuoImageRenderer_make(instance->glContext);
    VuoRetain(instance->imageRenderer);

    return instance;
}

void nodeInstanceEvent
(
    VuoInstanceData(struct nodeInstanceData *) instance,
    VuoInputData(VuoColor, {"default":{"r":1,"g":1,"b":1,"a":1}}) color,
    VuoInputData(VuoInteger, {"default":640, "suggestedMin":1, "suggestedStep":32}) width,
    VuoInputData(VuoInteger, {"default":480, "suggestedMin":1, "suggestedStep":32}) height,
    VuoOutputData(VuoImage) image
)
{
    VuoShader shader = VuoShader_makeUnlitColorShader(color);
    VuoRetain(shader);

    // Render.
    *image = VuoImageRenderer_draw((*instance)->imageRenderer, shader, width, height, VuoImageColorDepth_8);

    VuoRelease(shader);
}

void nodeInstanceFini(VuoInstanceData(struct nodeInstanceData *) instance)
{
    VuoRelease((*instance)->imageRenderer);
    VuoGlContext_disuse((*instance)->glContext);
}
Esempio n. 2
0
	instance->imageRenderer = VuoImageRenderer_make(instance->glContext);
	VuoRetain(instance->imageRenderer);

	return instance;
}

void nodeInstanceEvent
(
		VuoInstanceData(struct nodeInstanceData *) instance,
		VuoInputData(VuoColor,{"default":{"r":1,"g":1,"b":1,"a":1}}) color,
		VuoInputData(VuoInteger, {"default":640, "suggestedMin":1, "suggestedStep":32}) width,
		VuoInputData(VuoInteger, {"default":480, "suggestedMin":1, "suggestedStep":32}) height,
		VuoOutputData(VuoImage) image
)
{
	VuoShader shader = VuoShader_makeColorShader(color);
	VuoRetain(shader);

	// Render.
	*image = VuoImageRenderer_draw((*instance)->imageRenderer, shader, width, height);

	VuoRelease(shader);
}

void nodeInstanceFini(VuoInstanceData(struct nodeInstanceData *) instance)
{
	VuoRelease((*instance)->imageRenderer);
	VuoGlContext_disuse((*instance)->glContext);
}