|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "javax_microedition_m3g_CompositingMode.h" |
|
19 |
|
20 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_CompositingMode__1isDepthTestEnabled |
|
21 (JNIEnv* aEnv, jclass, jint aHCompositingMode) |
|
22 { |
|
23 M3G_DO_LOCK |
|
24 jboolean enabled = (jboolean)m3gIsDepthTestEnabled((M3GCompositingMode)aHCompositingMode); |
|
25 M3G_DO_UNLOCK(aEnv) |
|
26 return enabled; |
|
27 } |
|
28 |
|
29 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_CompositingMode__1getBlending |
|
30 (JNIEnv* aEnv, jclass, jint aHCompositingMode) |
|
31 { |
|
32 M3G_DO_LOCK |
|
33 jint blending = (jint)m3gGetBlending((M3GCompositingMode)aHCompositingMode); |
|
34 M3G_DO_UNLOCK(aEnv) |
|
35 return blending; |
|
36 } |
|
37 |
|
38 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_CompositingMode__1isAlphaWriteEnabled |
|
39 (JNIEnv* aEnv, jclass, jint aHCompositingMode) |
|
40 { |
|
41 M3G_DO_LOCK |
|
42 jboolean enabled = (jboolean)m3gIsAlphaWriteEnabled((M3GCompositingMode)aHCompositingMode); |
|
43 M3G_DO_UNLOCK(aEnv) |
|
44 return enabled; |
|
45 } |
|
46 |
|
47 JNIEXPORT void JNICALL Java_javax_microedition_m3g_CompositingMode__1enableDepthWrite |
|
48 (JNIEnv* aEnv, jclass, jint aHCompositingMode, jboolean aEnable) |
|
49 { |
|
50 M3G_DO_LOCK |
|
51 m3gEnableDepthWrite((M3GCompositingMode)aHCompositingMode, (M3Gbool)aEnable); |
|
52 M3G_DO_UNLOCK(aEnv) |
|
53 } |
|
54 |
|
55 JNIEXPORT void JNICALL Java_javax_microedition_m3g_CompositingMode__1setAlphaThreshold |
|
56 (JNIEnv* aEnv, jclass, jint aHCompositingMode, jfloat aThreshold) |
|
57 { |
|
58 M3G_DO_LOCK |
|
59 m3gSetAlphaThreshold((M3GCompositingMode)aHCompositingMode, (M3Gfloat)aThreshold); |
|
60 M3G_DO_UNLOCK(aEnv) |
|
61 } |
|
62 |
|
63 JNIEXPORT void JNICALL Java_javax_microedition_m3g_CompositingMode__1enableColorWrite |
|
64 (JNIEnv* aEnv, jclass, jint aHCompositingMode, jboolean aEnable) |
|
65 { |
|
66 M3G_DO_LOCK |
|
67 m3gEnableColorWrite((M3GCompositingMode)aHCompositingMode, (M3Gbool)aEnable); |
|
68 M3G_DO_UNLOCK(aEnv) |
|
69 } |
|
70 |
|
71 JNIEXPORT void JNICALL Java_javax_microedition_m3g_CompositingMode__1setDepthOffset |
|
72 (JNIEnv* aEnv, jclass, jint aHCompositingMode, jfloat aFactor, jfloat aUnits) |
|
73 { |
|
74 M3G_DO_LOCK |
|
75 m3gSetDepthOffset((M3GCompositingMode)aHCompositingMode, (M3Gfloat)aFactor, (M3Gfloat)aUnits); |
|
76 M3G_DO_UNLOCK(aEnv) |
|
77 } |
|
78 |
|
79 JNIEXPORT void JNICALL Java_javax_microedition_m3g_CompositingMode__1enableDepthTest |
|
80 (JNIEnv* aEnv, jclass, jint aHCompositingMode, jboolean aEnable) |
|
81 { |
|
82 M3G_DO_LOCK |
|
83 m3gEnableDepthTest((M3GCompositingMode)aHCompositingMode, (M3Gbool)aEnable); |
|
84 M3G_DO_UNLOCK(aEnv) |
|
85 } |
|
86 |
|
87 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_CompositingMode__1ctor |
|
88 (JNIEnv* aEnv, jclass, jint aM3g) |
|
89 { |
|
90 M3G_DO_LOCK |
|
91 jint handle = (jint)m3gCreateCompositingMode((M3GInterface)aM3g); |
|
92 M3G_DO_UNLOCK(aEnv) |
|
93 return handle; |
|
94 } |
|
95 |
|
96 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_CompositingMode__1isColorWriteEnabled |
|
97 (JNIEnv* aEnv, jclass, jint aHCompositingMode) |
|
98 { |
|
99 M3G_DO_LOCK |
|
100 jboolean enabled = (jboolean)m3gIsColorWriteEnabled((M3GCompositingMode)aHCompositingMode); |
|
101 M3G_DO_UNLOCK(aEnv) |
|
102 return enabled; |
|
103 } |
|
104 |
|
105 JNIEXPORT void JNICALL Java_javax_microedition_m3g_CompositingMode__1setAlphaWriteEnable |
|
106 (JNIEnv* aEnv, jclass, jint aHCompositingMode, jboolean aEnable) |
|
107 { |
|
108 M3G_DO_LOCK |
|
109 m3gSetAlphaWriteEnable((M3GCompositingMode)aHCompositingMode, (M3Gbool)aEnable); |
|
110 M3G_DO_UNLOCK(aEnv) |
|
111 } |
|
112 |
|
113 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_CompositingMode__1isDepthWriteEnabled |
|
114 (JNIEnv* aEnv, jclass, jint aHCompositingMode) |
|
115 { |
|
116 M3G_DO_LOCK |
|
117 jboolean enabled = (jboolean)m3gIsDepthWriteEnabled((M3GCompositingMode)aHCompositingMode); |
|
118 M3G_DO_UNLOCK(aEnv) |
|
119 return enabled; |
|
120 } |
|
121 |
|
122 JNIEXPORT jfloat JNICALL Java_javax_microedition_m3g_CompositingMode__1getDepthOffsetFactor |
|
123 (JNIEnv* aEnv, jclass, jint aHCompositingMode) |
|
124 { |
|
125 M3G_DO_LOCK |
|
126 jfloat factor = (jfloat)m3gGetDepthOffsetFactor((M3GCompositingMode)aHCompositingMode); |
|
127 M3G_DO_UNLOCK(aEnv) |
|
128 return factor; |
|
129 } |
|
130 |
|
131 JNIEXPORT jfloat JNICALL Java_javax_microedition_m3g_CompositingMode__1getDepthOffsetUnits |
|
132 (JNIEnv* aEnv, jclass, jint aHCompositingMode) |
|
133 { |
|
134 M3G_DO_LOCK |
|
135 jfloat offset = (jfloat)m3gGetDepthOffsetUnits((M3GCompositingMode)aHCompositingMode); |
|
136 M3G_DO_UNLOCK(aEnv) |
|
137 return offset; |
|
138 } |
|
139 |
|
140 JNIEXPORT void JNICALL Java_javax_microedition_m3g_CompositingMode__1setBlending |
|
141 (JNIEnv* aEnv, jclass, jint aHCompositingMode, jint aMode) |
|
142 { |
|
143 M3G_DO_LOCK |
|
144 m3gSetBlending((M3GCompositingMode)aHCompositingMode, (int)aMode); |
|
145 M3G_DO_UNLOCK(aEnv) |
|
146 } |
|
147 |
|
148 JNIEXPORT jfloat JNICALL Java_javax_microedition_m3g_CompositingMode__1getAlphaThreshold |
|
149 (JNIEnv* aEnv, jclass, jint aHCompositingMode) |
|
150 { |
|
151 M3G_DO_LOCK |
|
152 jfloat treshold = (jfloat)m3gGetAlphaThreshold((M3GCompositingMode)aHCompositingMode); |
|
153 M3G_DO_UNLOCK(aEnv) |
|
154 return treshold; |
|
155 } |