MCPcopy Index your code
hub / github.com/processing/processing / initTexRectShader

Method initTexRectShader

core/src/processing/opengl/PGL.java:1418–1447  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1416
1417
1418 protected PGL initTexRectShader() {
1419 PGL ppgl = primaryPGL ? this : graphics.getPrimaryPGL();
1420
1421 if (!ppgl.loadedTexRectShader || ppgl.texRectShaderContext != ppgl.glContext) {
1422 String[] preprocVertSrc = preprocessVertexSource(texVertShaderSource, getGLSLVersion(), getGLSLVersionSuffix());
1423 String vertSource = PApplet.join(preprocVertSrc, "\n");
1424 String[] preprocFragSrc = preprocessFragmentSource(texRectFragShaderSource, getGLSLVersion(), getGLSLVersionSuffix());
1425 String fragSource = PApplet.join(preprocFragSrc, "\n");
1426 ppgl.texRectVertShader = createShader(VERTEX_SHADER, vertSource);
1427 ppgl.texRectFragShader = createShader(FRAGMENT_SHADER, fragSource);
1428 if (0 < ppgl.texRectVertShader && 0 < ppgl.texRectFragShader) {
1429 ppgl.texRectShaderProgram = createProgram(ppgl.texRectVertShader,
1430 ppgl.texRectFragShader);
1431 }
1432 if (0 < ppgl.texRectShaderProgram) {
1433 ppgl.texRectVertLoc = getAttribLocation(ppgl.texRectShaderProgram, "position");
1434 ppgl.texRectTCoordLoc = getAttribLocation(ppgl.texRectShaderProgram, "texCoord");
1435 ppgl.texRectSamplerLoc = getUniformLocation(ppgl.texRectShaderProgram, "texMap");
1436 }
1437 ppgl.loadedTexRectShader = true;
1438 ppgl.texRectShaderContext = ppgl.glContext;
1439
1440 genBuffers(1, intBuffer);
1441 ppgl.texRectGeoVBO = intBuffer.get(0);
1442 bindBuffer(ARRAY_BUFFER, ppgl.texRectGeoVBO);
1443 bufferData(ARRAY_BUFFER, 16 * SIZEOF_FLOAT, null, STATIC_DRAW);
1444 }
1445
1446 return ppgl;
1447 }
1448
1449
1450 protected void drawTextureRect(int id, int texW, int texH,

Callers 1

drawTextureRectMethod · 0.95

Calls 14

getGLSLVersionMethod · 0.95
getGLSLVersionSuffixMethod · 0.95
joinMethod · 0.95
createShaderMethod · 0.95
createProgramMethod · 0.95
getAttribLocationMethod · 0.95
getUniformLocationMethod · 0.95
genBuffersMethod · 0.95
bindBufferMethod · 0.95
bufferDataMethod · 0.95

Tested by

no test coverage detected