MCPcopy Index your code
hub / github.com/benfry/processing4 / initTexRectShader

Method initTexRectShader

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

Source from the content-addressed store, hash-verified

1459
1460
1461 protected PGL initTexRectShader() {
1462 PGL ppgl = primaryPGL ? this : graphics.getPrimaryPGL();
1463
1464 if (!ppgl.loadedTexRectShader || ppgl.texRectShaderContext != ppgl.glContext) {
1465 String[] preprocVertSrc = preprocessVertexSource(texVertShaderSource, getGLSLVersion(), getGLSLVersionSuffix());
1466 String vertSource = PApplet.join(preprocVertSrc, "\n");
1467 String[] preprocFragSrc = preprocessFragmentSource(texRectFragShaderSource, getGLSLVersion(), getGLSLVersionSuffix());
1468 String fragSource = PApplet.join(preprocFragSrc, "\n");
1469 ppgl.texRectVertShader = createShader(VERTEX_SHADER, vertSource);
1470 ppgl.texRectFragShader = createShader(FRAGMENT_SHADER, fragSource);
1471 if (0 < ppgl.texRectVertShader && 0 < ppgl.texRectFragShader) {
1472 ppgl.texRectShaderProgram = createProgram(ppgl.texRectVertShader,
1473 ppgl.texRectFragShader);
1474 }
1475 if (0 < ppgl.texRectShaderProgram) {
1476 ppgl.texRectVertLoc = getAttribLocation(ppgl.texRectShaderProgram, "position");
1477 ppgl.texRectTCoordLoc = getAttribLocation(ppgl.texRectShaderProgram, "texCoord");
1478 ppgl.texRectSamplerLoc = getUniformLocation(ppgl.texRectShaderProgram, "texMap");
1479 }
1480 ppgl.loadedTexRectShader = true;
1481 ppgl.texRectShaderContext = ppgl.glContext;
1482
1483 genBuffers(1, intBuffer);
1484 ppgl.texRectGeoVBO = intBuffer.get(0);
1485 bindBuffer(ARRAY_BUFFER, ppgl.texRectGeoVBO);
1486 bufferData(ARRAY_BUFFER, 16 * SIZEOF_FLOAT, null, STATIC_DRAW);
1487 }
1488
1489 return ppgl;
1490 }
1491
1492
1493 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