javauis/m3g_qt/src/jni/polygonMode.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 #include "javax_microedition_m3g_PolygonMode.h"
       
    18 
       
    19 JNIEXPORT void JNICALL Java_javax_microedition_m3g_PolygonMode__1setCulling
       
    20 (JNIEnv* aEnv, jclass, jint aHPolygonMode, jint aModeBits)
       
    21 {
       
    22     M3G_DO_LOCK
       
    23     m3gSetCulling((M3GPolygonMode)aHPolygonMode, aModeBits);
       
    24     M3G_DO_UNLOCK(aEnv)
       
    25 }
       
    26 
       
    27 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_PolygonMode__1getCulling
       
    28 (JNIEnv* aEnv, jclass, jint aHPolygonMode)
       
    29 {
       
    30     M3G_DO_LOCK
       
    31     jint culling = (jint)m3gGetCulling((M3GPolygonMode)aHPolygonMode);
       
    32     M3G_DO_UNLOCK(aEnv)
       
    33     return culling;
       
    34 }
       
    35 
       
    36 JNIEXPORT void JNICALL Java_javax_microedition_m3g_PolygonMode__1setWinding
       
    37 (JNIEnv* aEnv, jclass, jint aHPolygonMode, jint aModeBits)
       
    38 {
       
    39     M3G_DO_LOCK
       
    40     m3gSetWinding((M3GPolygonMode)aHPolygonMode, aModeBits);
       
    41     M3G_DO_UNLOCK(aEnv)
       
    42 }
       
    43 
       
    44 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_PolygonMode__1getWinding
       
    45 (JNIEnv* aEnv, jclass, jint aHPolygonMode)
       
    46 {
       
    47     M3G_DO_LOCK
       
    48     jint winding = (jint)m3gGetWinding((M3GPolygonMode)aHPolygonMode);
       
    49     M3G_DO_UNLOCK(aEnv)
       
    50     return winding;
       
    51 }
       
    52 
       
    53 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_PolygonMode__1isTwoSidedLightingEnabled
       
    54 (JNIEnv* aEnv, jclass, jint aHPolygonMode)
       
    55 {
       
    56     M3G_DO_LOCK
       
    57     jboolean enabled = (jboolean)m3gIsTwoSidedLightingEnabled((M3GPolygonMode)aHPolygonMode);
       
    58     M3G_DO_UNLOCK(aEnv)
       
    59     return enabled;
       
    60 }
       
    61 
       
    62 JNIEXPORT void JNICALL Java_javax_microedition_m3g_PolygonMode__1setTwoSidedLightingEnable
       
    63 (JNIEnv* aEnv, jclass, jint aHPolygonMode, jboolean aEnable)
       
    64 {
       
    65     M3G_DO_LOCK
       
    66     m3gSetTwoSidedLightingEnable((M3GPolygonMode)aHPolygonMode, (M3Gbool)aEnable);
       
    67     M3G_DO_UNLOCK(aEnv)
       
    68 }
       
    69 
       
    70 JNIEXPORT void JNICALL Java_javax_microedition_m3g_PolygonMode__1setPerspectiveCorrectionEnable
       
    71 (JNIEnv* aEnv, jclass, jint aHPolygonMode, jboolean aEnable)
       
    72 {
       
    73     M3G_DO_LOCK
       
    74     m3gSetPerspectiveCorrectionEnable((M3GPolygonMode)aHPolygonMode, (M3Gbool)aEnable);
       
    75     M3G_DO_UNLOCK(aEnv)
       
    76 }
       
    77 
       
    78 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_PolygonMode__1ctor
       
    79 (JNIEnv* aEnv, jclass, jint aM3g)
       
    80 {
       
    81     M3G_DO_LOCK
       
    82     M3GPolygonMode gm = m3gCreatePolygonMode((M3GInterface)aM3g);
       
    83     M3G_DO_UNLOCK(aEnv)
       
    84     return (M3Guint)gm;
       
    85 }
       
    86 
       
    87 JNIEXPORT void JNICALL Java_javax_microedition_m3g_PolygonMode__1setLocalCameraLightingEnable
       
    88 (JNIEnv* aEnv, jclass, jint aHPolygonMode, jboolean aEnable)
       
    89 {
       
    90     M3G_DO_LOCK
       
    91     m3gSetLocalCameraLightingEnable((M3GPolygonMode)aHPolygonMode, (M3Gbool)aEnable);
       
    92     M3G_DO_UNLOCK(aEnv)
       
    93 }
       
    94 
       
    95 JNIEXPORT void JNICALL Java_javax_microedition_m3g_PolygonMode__1setShading
       
    96 (JNIEnv* aEnv, jclass, jint aHPolygonMode, jint aModeBits)
       
    97 {
       
    98     M3G_DO_LOCK
       
    99     m3gSetShading((M3GPolygonMode)aHPolygonMode, aModeBits);
       
   100     M3G_DO_UNLOCK(aEnv)
       
   101 }
       
   102 
       
   103 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_PolygonMode__1getShading
       
   104 (JNIEnv* aEnv, jclass, jint aHPolygonMode)
       
   105 {
       
   106     M3G_DO_LOCK
       
   107     jint shading = (jint)m3gGetShading((M3GPolygonMode)aHPolygonMode);
       
   108     M3G_DO_UNLOCK(aEnv)
       
   109     return shading;
       
   110 }
       
   111 
       
   112 /* M3G 1.1 JNI Calls */
       
   113 
       
   114 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_PolygonMode__1isLocalCameraLightingEnabled
       
   115 (JNIEnv* aEnv, jclass, jint aHPolygonMode)
       
   116 {
       
   117     M3G_DO_LOCK
       
   118     jboolean enabled = (jboolean)m3gIsLocalCameraLightingEnabled((M3GPolygonMode)aHPolygonMode);
       
   119     M3G_DO_UNLOCK(aEnv)
       
   120     return enabled;
       
   121 }
       
   122 
       
   123 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_PolygonMode__1isPerspectiveCorrectionEnabled
       
   124 (JNIEnv* aEnv, jclass, jint aHPolygonMode)
       
   125 {
       
   126     M3G_DO_LOCK
       
   127     jboolean enabled = (jboolean)m3gIsPerspectiveCorrectionEnabled((M3GPolygonMode)aHPolygonMode);
       
   128     M3G_DO_UNLOCK(aEnv)
       
   129     return enabled;
       
   130 }