texture()

Image / Textures

Description

Sets a texture to be applied to vertex points. Must be called between beginShape() and endShape().

Syntax

void texture(PImage& img)

Parameters

NameTypeDescription
imgPImageimage to use as texture

Returns

void

Related

Under the Hood

From Processing.h:

void texture(PImage& img);

Under the Hood

From Processing.cpp:

void PApplet::texture(PImage& img){ if(img.dirty)img.uploadTexture(); if(img.texID){ glEnable(GL_TEXTURE_2D);glBindTexture(GL_TEXTURE_2D,img.texID); } }