javauis/m3g_qt/src/jni/fog.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_Fog.h"
       
    19 
       
    20 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Fog__1setMode
       
    21 (JNIEnv* aEnv, jclass, jint aHandle, jint aMode)
       
    22 {
       
    23     M3G_DO_LOCK
       
    24     m3gSetFogMode((M3GFog)aHandle, aMode);
       
    25     M3G_DO_UNLOCK(aEnv)
       
    26 }
       
    27 
       
    28 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Fog__1setLinear
       
    29 (JNIEnv* aEnv, jclass, jint aHandle, jfloat aNear, jfloat aFar)
       
    30 {
       
    31     M3G_DO_LOCK
       
    32     m3gSetFogLinear((M3GFog)aHandle, aNear, aFar);
       
    33     M3G_DO_UNLOCK(aEnv)
       
    34 }
       
    35 
       
    36 JNIEXPORT jfloat JNICALL Java_javax_microedition_m3g_Fog__1getDistance
       
    37 (JNIEnv* aEnv, jclass, jint aHandle, jint aWhich)
       
    38 {
       
    39     M3G_DO_LOCK
       
    40     jfloat distance = (jfloat)m3gGetFogDistance((M3GFog)aHandle, aWhich);
       
    41     M3G_DO_UNLOCK(aEnv)
       
    42     return distance;
       
    43 }
       
    44 
       
    45 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Fog__1ctor
       
    46 (JNIEnv* aEnv, jclass, jint aM3g)
       
    47 {
       
    48     M3G_DO_LOCK
       
    49     jint handle = (jint)m3gCreateFog((M3GInterface)aM3g);
       
    50     M3G_DO_UNLOCK(aEnv)
       
    51     return handle;
       
    52 }
       
    53 
       
    54 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Fog__1getMode
       
    55 (JNIEnv* aEnv, jclass, jint aHandle)
       
    56 {
       
    57     M3G_DO_LOCK
       
    58     jint mode = (jint)m3gGetFogMode((M3GFog)aHandle);
       
    59     M3G_DO_UNLOCK(aEnv)
       
    60     return mode;
       
    61 }
       
    62 
       
    63 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Fog__1setDensity
       
    64 (JNIEnv* aEnv, jclass, jint aHandle, jfloat aDensity)
       
    65 {
       
    66     M3G_DO_LOCK
       
    67     m3gSetFogDensity((M3GFog)aHandle, aDensity);
       
    68     M3G_DO_UNLOCK(aEnv)
       
    69 }
       
    70 
       
    71 JNIEXPORT jfloat JNICALL Java_javax_microedition_m3g_Fog__1getDensity
       
    72 (JNIEnv* aEnv, jclass, jint aHandle)
       
    73 {
       
    74     M3G_DO_LOCK
       
    75     jfloat density = (jfloat)m3gGetFogDensity((M3GFog)aHandle);
       
    76     M3G_DO_UNLOCK(aEnv)
       
    77     return density;
       
    78 }
       
    79 
       
    80 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Fog__1setColor
       
    81 (JNIEnv* aEnv, jclass, jint aHandle, jint aRGB)
       
    82 {
       
    83     M3G_DO_LOCK
       
    84     m3gSetFogColor((M3GFog)aHandle, aRGB);
       
    85     M3G_DO_UNLOCK(aEnv)
       
    86 }
       
    87 
       
    88 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Fog__1getColor
       
    89 (JNIEnv* aEnv, jclass, jint aHandle)
       
    90 {
       
    91     M3G_DO_LOCK
       
    92     jint color = (jint)m3gGetFogColor((M3GFog)aHandle);
       
    93     M3G_DO_UNLOCK(aEnv)
       
    94     return color;
       
    95 }