summaryrefslogtreecommitdiff
path: root/rsScriptC_LibGL.cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2012-09-05 18:05:08 -0700
committerStephen Hines <srhines@google.com>2012-09-06 15:14:59 -0700
commit414a46166126da6864258bd25ff183f9a3c6261d (patch)
tree6c67bb0293e4aa6594a0707533350154ae35d967 /rsScriptC_LibGL.cpp
parent17de8e2330e7fb3206c43b7cf8de248208c893e6 (diff)
downloadrs-414a46166126da6864258bd25ff183f9a3c6261d.tar.gz
Attempt to create libRSDriver as shared library.
Change-Id: I047b32325efe2fa471b73c48fa7296beecc0c47d
Diffstat (limited to 'rsScriptC_LibGL.cpp')
-rw-r--r--rsScriptC_LibGL.cpp66
1 files changed, 0 insertions, 66 deletions
diff --git a/rsScriptC_LibGL.cpp b/rsScriptC_LibGL.cpp
index 6a897a37..63fb53e6 100644
--- a/rsScriptC_LibGL.cpp
+++ b/rsScriptC_LibGL.cpp
@@ -147,72 +147,6 @@ void rsrVpGetProjectionMatrix(Context *rsc, Script *sc, rsc_Matrix *m) {
// Drawing
//////////////////////////////////////////////////////////////////////////////
-void rsrDrawQuadTexCoords(Context *rsc, Script *sc,
- float x1, float y1, float z1, float u1, float v1,
- float x2, float y2, float z2, float u2, float v2,
- float x3, float y3, float z3, float u3, float v3,
- float x4, float y4, float z4, float u4, float v4) {
- if (!rsc->setupCheck()) {
- return;
- }
-
- RsdHal *dc = (RsdHal *)rsc->mHal.drv;
- if (!dc->gl.shaderCache->setup(rsc)) {
- return;
- }
-
- //ALOGE("Quad");
- //ALOGE("%4.2f, %4.2f, %4.2f", x1, y1, z1);
- //ALOGE("%4.2f, %4.2f, %4.2f", x2, y2, z2);
- //ALOGE("%4.2f, %4.2f, %4.2f", x3, y3, z3);
- //ALOGE("%4.2f, %4.2f, %4.2f", x4, y4, z4);
-
- float vtx[] = {x1,y1,z1, x2,y2,z2, x3,y3,z3, x4,y4,z4};
- const float tex[] = {u1,v1, u2,v2, u3,v3, u4,v4};
-
- RsdVertexArray::Attrib attribs[2];
- attribs[0].set(GL_FLOAT, 3, 12, false, (uint32_t)vtx, "ATTRIB_position");
- attribs[1].set(GL_FLOAT, 2, 8, false, (uint32_t)tex, "ATTRIB_texture0");
-
- RsdVertexArray va(attribs, 2);
- va.setup(rsc);
-
- RSD_CALL_GL(glDrawArrays, GL_TRIANGLE_FAN, 0, 4);
-}
-
-void rsrDrawQuad(Context *rsc, Script *sc,
- float x1, float y1, float z1,
- float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4) {
- rsrDrawQuadTexCoords(rsc, sc, x1, y1, z1, 0, 1,
- x2, y2, z2, 1, 1,
- x3, y3, z3, 1, 0,
- x4, y4, z4, 0, 0);
-}
-
-void rsrDrawSpriteScreenspace(Context *rsc, Script *sc,
- float x, float y, float z, float w, float h) {
- ObjectBaseRef<const ProgramVertex> tmp(rsc->getProgramVertex());
- rsc->setProgramVertex(rsc->getDefaultProgramVertex());
- //rsc->setupCheck();
-
- //GLint crop[4] = {0, h, w, -h};
-
- float sh = rsc->getHeight();
-
- rsrDrawQuad(rsc, sc,
- x, sh - y, z,
- x+w, sh - y, z,
- x+w, sh - (y+h), z,
- x, sh - (y+h), z);
- rsc->setProgramVertex((ProgramVertex *)tmp.get());
-}
-
-void rsrDrawRect(Context *rsc, Script *sc, float x1, float y1, float x2, float y2, float z) {
- //ALOGE("SC_drawRect %f,%f %f,%f %f", x1, y1, x2, y2, z);
- rsrDrawQuad(rsc, sc, x1, y2, z, x2, y2, z, x2, y1, z, x1, y1, z);
-}
void rsrDrawPath(Context *rsc, Script *sc, Path *sm) {
CHECK_OBJ(sm);