From aa7d2884cb563f87294003981e03e37a1abeb961 Mon Sep 17 00:00:00 2001 From: Alex Sakhartchouk Date: Fri, 21 May 2010 12:53:13 -0700 Subject: Removed unnecessary change based on comments. Now using android utils lib. collada_to_a3d seems to work with android util libs. Integrating old changelist Changing assert to rsAssrt in VertexArray making context compile. Change-Id: I33890defa777f09253bfab630d97782359ec49d7 Added serialization code to rsLib Integrated old changelist Change-Id: Ie4746113f6d1817fbb3264f97fdddde25b779311 Added serialization code to rsLib Change-Id: Ie4746113f6d1817fbb3264f97fdddde25b779311 --- libs/rs/rsProgramVertex.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'libs/rs/rsProgramVertex.cpp') diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp index c3264aed76bd..d4c29c8871b2 100644 --- a/libs/rs/rsProgramVertex.cpp +++ b/libs/rs/rsProgramVertex.cpp @@ -14,13 +14,19 @@ * limitations under the License. */ +#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#include "rsProgramVertex.h" - #include #include #include #include +#else +#include "rsContextHostStub.h" +#include +#include +#endif //ANDROID_RS_BUILD_FOR_HOST + +#include "rsProgramVertex.h" using namespace android; using namespace android::renderscript; @@ -81,9 +87,12 @@ void ProgramVertex::setupGL(const Context *rsc, ProgramVertexState *state) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); if (mLightCount) { +#ifndef ANDROID_RS_BUILD_FOR_HOST // GLES Only int v = 0; glEnable(GL_LIGHTING); + glLightModelxv(GL_LIGHT_MODEL_TWO_SIDE, &v); + for (uint32_t ct = 0; ct < mLightCount; ct++) { const Light *l = mLights[ct].get(); glEnable(GL_LIGHT0 + ct); @@ -92,6 +101,7 @@ void ProgramVertex::setupGL(const Context *rsc, ProgramVertexState *state) for (uint32_t ct = mLightCount; ct < MAX_LIGHTS; ct++) { glDisable(GL_LIGHT0 + ct); } +#endif //ANDROID_RS_BUILD_FOR_HOST } else { glDisable(GL_LIGHTING); } @@ -351,6 +361,16 @@ void ProgramVertex::init(Context *rsc) createShader(); } +void ProgramVertex::serialize(OStream *stream) const +{ + +} + +ProgramVertex *ProgramVertex::createFromStream(Context *rsc, IStream *stream) +{ + return NULL; +} + /////////////////////////////////////////////////////////////////////// @@ -364,6 +384,7 @@ ProgramVertexState::~ProgramVertexState() void ProgramVertexState::init(Context *rsc) { +#ifndef ANDROID_RS_BUILD_FOR_HOST RsElement e = (RsElement) Element::create(rsc, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 1); rsi_TypeBegin(rsc, e); @@ -372,6 +393,7 @@ void ProgramVertexState::init(Context *rsc) ProgramVertex *pv = new ProgramVertex(rsc, false); Allocation *alloc = (Allocation *)rsi_AllocationCreateTyped(rsc, mAllocType.get()); + mDefaultAlloc.set(alloc); mDefault.set(pv); pv->init(rsc); @@ -383,6 +405,8 @@ void ProgramVertexState::init(Context *rsc) color[3] = 1.f; updateSize(rsc); +#endif //ANDROID_RS_BUILD_FOR_HOST + } void ProgramVertexState::updateSize(Context *rsc) -- cgit v1.2.3-59-g8ed1b