|
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_Material.h" |
|
19 |
|
20 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_Material__1isVertexColorTrackingEnabled |
|
21 (JNIEnv* aEnv, jclass, jint aHMaterial) |
|
22 { |
|
23 M3G_DO_LOCK |
|
24 jboolean enabled = (jboolean)m3gIsVertexColorTrackingEnabled((M3GMaterial)aHMaterial); |
|
25 M3G_DO_UNLOCK(aEnv) |
|
26 return enabled; |
|
27 } |
|
28 |
|
29 JNIEXPORT jfloat JNICALL Java_javax_microedition_m3g_Material__1getShininess |
|
30 (JNIEnv* aEnv, jclass, jint aHMaterial) |
|
31 { |
|
32 M3G_DO_LOCK |
|
33 jfloat shininess = (jfloat)m3gGetShininess((M3GMaterial)aHMaterial); |
|
34 M3G_DO_UNLOCK(aEnv) |
|
35 return shininess; |
|
36 } |
|
37 |
|
38 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Material__1setVertexColorTrackingEnable |
|
39 (JNIEnv* aEnv, jclass, jint aHMaterial, jboolean aEnable) |
|
40 { |
|
41 M3G_DO_LOCK |
|
42 m3gSetVertexColorTrackingEnable((M3GMaterial)aHMaterial, (M3Gbool)aEnable); |
|
43 M3G_DO_UNLOCK(aEnv) |
|
44 } |
|
45 |
|
46 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Material__1ctor |
|
47 (JNIEnv* aEnv, jclass, jint aM3g) |
|
48 { |
|
49 M3G_DO_LOCK |
|
50 M3GMaterial material = (M3GMaterial)m3gCreateMaterial((M3GInterface)aM3g); |
|
51 M3G_DO_UNLOCK(aEnv) |
|
52 return (M3Guint)material; |
|
53 } |
|
54 |
|
55 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Material__1setColor |
|
56 (JNIEnv* aEnv, jclass, jint aHMaterial, jint aTarget, jint aARGB) |
|
57 { |
|
58 M3G_DO_LOCK |
|
59 m3gSetColor((M3GMaterial)aHMaterial, aTarget, aARGB); |
|
60 M3G_DO_UNLOCK(aEnv) |
|
61 } |
|
62 |
|
63 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Material__1setShininess |
|
64 (JNIEnv* aEnv, jclass, jint aHMaterial, jfloat aShininess) |
|
65 { |
|
66 M3G_DO_LOCK |
|
67 m3gSetShininess((M3GMaterial)aHMaterial, (M3Gfloat)aShininess); |
|
68 M3G_DO_UNLOCK(aEnv) |
|
69 } |
|
70 |
|
71 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Material__1getColor |
|
72 (JNIEnv* aEnv, jclass, jint aHMaterial, jint aTarget) |
|
73 { |
|
74 M3G_DO_LOCK |
|
75 jint color = (jint)m3gGetColor((M3GMaterial)aHMaterial, aTarget); |
|
76 M3G_DO_UNLOCK(aEnv) |
|
77 return color; |
|
78 } |