javauis/m3g_qt/src/jni/appearance.inl
changeset 35 85266cc22c7f
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
       
     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_Appearance.h"
       
    19 
       
    20 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Appearance__1setLayer
       
    21 (JNIEnv* aEnv,   jclass, jint aHApp, jint aLayer)
       
    22 {
       
    23     M3G_DO_LOCK
       
    24     m3gSetLayer((M3GAppearance)aHApp, (M3Gint)aLayer);
       
    25     M3G_DO_UNLOCK(aEnv)
       
    26 }
       
    27 
       
    28 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Appearance__1getCompositingMode
       
    29 (JNIEnv* aEnv,   jclass, jint aHApp)
       
    30 {
       
    31     M3G_DO_LOCK
       
    32     jint compMode = (jint)m3gGetCompositingMode((M3GAppearance)aHApp);
       
    33     M3G_DO_UNLOCK(aEnv)
       
    34     return compMode;
       
    35 }
       
    36 
       
    37 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Appearance__1getFog
       
    38 (JNIEnv* aEnv,   jclass, jint aHApp)
       
    39 {
       
    40     M3G_DO_LOCK
       
    41     jint fog = (jint)m3gGetFog((M3GAppearance)aHApp);
       
    42     M3G_DO_UNLOCK(aEnv)
       
    43     return fog;
       
    44 }
       
    45 
       
    46 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Appearance__1getLayer
       
    47 (JNIEnv* aEnv,   jclass, jint aHApp)
       
    48 {
       
    49     M3G_DO_LOCK
       
    50     jint layer = (jint)m3gGetLayer((M3GAppearance)aHApp);
       
    51     M3G_DO_UNLOCK(aEnv)
       
    52     return layer;
       
    53 }
       
    54 
       
    55 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Appearance__1setCompositingMode
       
    56 (JNIEnv* aEnv,   jclass, jint aHApp, jint aHMode)
       
    57 {
       
    58     M3G_DO_LOCK
       
    59     m3gSetCompositingMode((M3GAppearance)aHApp, (M3GCompositingMode)aHMode);
       
    60     M3G_DO_UNLOCK(aEnv)
       
    61 }
       
    62 
       
    63 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Appearance__1setPolygonMode
       
    64 (JNIEnv* aEnv,   jclass, jint aHApp, jint aHMode)
       
    65 {
       
    66     M3G_DO_LOCK
       
    67     m3gSetPolygonMode((M3GAppearance)aHApp, (M3GPolygonMode)aHMode);
       
    68     M3G_DO_UNLOCK(aEnv)
       
    69 }
       
    70 
       
    71 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Appearance__1getPolygonMode
       
    72 (JNIEnv* aEnv,   jclass, jint aHApp)
       
    73 {
       
    74     M3G_DO_LOCK
       
    75     jint polyMode = (jint)m3gGetPolygonMode((M3GAppearance)aHApp);
       
    76     M3G_DO_UNLOCK(aEnv)
       
    77     return polyMode;
       
    78 }
       
    79 
       
    80 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Appearance__1setTexture
       
    81 (JNIEnv* aEnv,   jclass, jint aHApp, jint aUnit, jint aHTex)
       
    82 {
       
    83     M3G_DO_LOCK
       
    84     m3gSetTexture((M3GAppearance)aHApp, (M3Gint)aUnit, (M3GTexture)aHTex);
       
    85     M3G_DO_UNLOCK(aEnv)
       
    86 }
       
    87 
       
    88 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Appearance__1ctor
       
    89 (JNIEnv* aEnv,   jclass, jint aM3g)
       
    90 {
       
    91     M3G_DO_LOCK
       
    92     jint handle = (jint)m3gCreateAppearance((M3GInterface)aM3g);
       
    93     M3G_DO_UNLOCK(aEnv)
       
    94     return handle;
       
    95 }
       
    96 
       
    97 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Appearance__1getTexture
       
    98 (JNIEnv* aEnv,   jclass, jint aHApp, jint aUnit)
       
    99 {
       
   100     M3G_DO_LOCK
       
   101     jint texture = (jint)m3gGetTexture((M3GAppearance)aHApp, (M3Gint)aUnit);
       
   102     M3G_DO_UNLOCK(aEnv)
       
   103     return texture;
       
   104 }
       
   105 
       
   106 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Appearance__1setFog
       
   107 (JNIEnv* aEnv,   jclass, jint aHApp, jint aHFog)
       
   108 {
       
   109     M3G_DO_LOCK
       
   110     m3gSetFog((M3GAppearance)aHApp, (M3GFog)aHFog);
       
   111     M3G_DO_UNLOCK(aEnv)
       
   112 }
       
   113 
       
   114 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Appearance__1setMaterial
       
   115 (JNIEnv* aEnv,   jclass, jint aHApp, jint aHMaterial)
       
   116 {
       
   117     M3G_DO_LOCK
       
   118     m3gSetMaterial((M3GAppearance)aHApp, (M3GMaterial)aHMaterial);
       
   119     M3G_DO_UNLOCK(aEnv)
       
   120 }
       
   121 
       
   122 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Appearance__1getMaterial
       
   123 (JNIEnv* aEnv,   jclass, jint aHApp)
       
   124 {
       
   125     M3G_DO_LOCK
       
   126     jint material = (jint)m3gGetMaterial((M3GAppearance)aHApp);
       
   127     M3G_DO_UNLOCK(aEnv)
       
   128     return material;
       
   129 }