blob: 65995be429be1faac2fbbcae61cd9f330c8250d8 [file] [log] [blame]
Jason Sams331bf9b2011-04-06 11:23:54 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18#include "rsdCore.h"
19#include "rsdProgramStore.h"
20
21#include "rsContext.h"
22#include "rsProgramStore.h"
23
24#include <GLES/gl.h>
25#include <GLES/glext.h>
26
27
28using namespace android;
29using namespace android::renderscript;
30
31bool rsdProgramRasterInit(const Context *, const ProgramRaster *) {
32 return true;
33}
34
35void rsdProgramRasterSetActive(const Context *, const ProgramRaster *pr) {
36 switch (pr->mHal.state.cull) {
37 case RS_CULL_BACK:
38 glEnable(GL_CULL_FACE);
39 glCullFace(GL_BACK);
40 break;
41 case RS_CULL_FRONT:
42 glEnable(GL_CULL_FACE);
43 glCullFace(GL_FRONT);
44 break;
45 case RS_CULL_NONE:
46 glDisable(GL_CULL_FACE);
47 break;
48 }
49
50}
51
52void rsdProgramRasterDestroy(const Context *, const ProgramRaster *) {
53}
54
55