javauis/m3g_qt/src/jni/texture2d.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_Texture2D.h"
       
    18 
       
    19 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Texture2D__1getBlending
       
    20 (JNIEnv* aEnv, jclass, jint aHTexture2D)
       
    21 {
       
    22     M3G_DO_LOCK
       
    23     jint blending = (jint)m3gTextureGetBlending((M3GTexture)aHTexture2D);
       
    24     M3G_DO_UNLOCK(aEnv)
       
    25     return blending;
       
    26 }
       
    27 
       
    28 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Texture2D__1getWrappingT
       
    29 (JNIEnv* aEnv, jclass, jint aHTexture2D)
       
    30 {
       
    31     M3G_DO_LOCK
       
    32     jint wrapping = (jint)m3gGetWrappingT((M3GTexture)aHTexture2D);
       
    33     M3G_DO_UNLOCK(aEnv)
       
    34     return wrapping;
       
    35 }
       
    36 
       
    37 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Texture2D__1getWrappingS
       
    38 (JNIEnv* aEnv, jclass, jint aHTexture2D)
       
    39 {
       
    40     M3G_DO_LOCK
       
    41     jint wrapping = (jint)m3gGetWrappingS((M3GTexture)aHTexture2D);
       
    42     M3G_DO_UNLOCK(aEnv)
       
    43     return wrapping;
       
    44 }
       
    45 
       
    46 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Texture2D__1setFiltering
       
    47 (JNIEnv* aEnv, jclass, jint aHTexture2D, jint aLevelFilter, jint aImageFilter)
       
    48 {
       
    49     M3G_DO_LOCK
       
    50     m3gSetFiltering((M3GTexture)aHTexture2D, aLevelFilter, aImageFilter);
       
    51     M3G_DO_UNLOCK(aEnv)
       
    52 }
       
    53 
       
    54 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Texture2D__1getBlendColor
       
    55 (JNIEnv* aEnv, jclass, jint aHTexture2D)
       
    56 {
       
    57     M3G_DO_LOCK
       
    58     jint color = (jint)m3gGetBlendColor((M3GTexture)aHTexture2D);
       
    59     M3G_DO_UNLOCK(aEnv)
       
    60     return color;
       
    61 }
       
    62 
       
    63 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Texture2D__1setBlendColor
       
    64 (JNIEnv* aEnv, jclass, jint aHTexture2D, jint aRGB)
       
    65 {
       
    66     M3G_DO_LOCK
       
    67     m3gSetBlendColor((M3GTexture)aHTexture2D, aRGB);
       
    68     M3G_DO_UNLOCK(aEnv)
       
    69 }
       
    70 
       
    71 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Texture2D__1ctor
       
    72 (JNIEnv* aEnv, jclass, jint aM3g, jint aHImage)
       
    73 {
       
    74     M3G_DO_LOCK
       
    75     jint handle = (M3Guint)m3gCreateTexture((M3GInterface)aM3g, (M3GImage)aHImage);
       
    76     M3G_DO_UNLOCK(aEnv)
       
    77     return handle;
       
    78 }
       
    79 
       
    80 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Texture2D__1setWrapping
       
    81 (JNIEnv* aEnv, jclass, jint aHTexture2D, jint aWrapS, jint aWrapT)
       
    82 {
       
    83     M3G_DO_LOCK
       
    84     m3gSetWrapping((M3GTexture)aHTexture2D, aWrapS, aWrapT);
       
    85     M3G_DO_UNLOCK(aEnv)
       
    86 }
       
    87 
       
    88 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Texture2D__1setImage
       
    89 (JNIEnv* aEnv, jclass, jint aHTex, jint aHImg)
       
    90 {
       
    91     M3G_DO_LOCK
       
    92     m3gSetTextureImage((M3GTexture)aHTex, (M3GImage)aHImg);
       
    93     M3G_DO_UNLOCK(aEnv)
       
    94 }
       
    95 
       
    96 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Texture2D__1setBlending
       
    97 (JNIEnv* aEnv, jclass, jint aHTexture2D, jint aFunc)
       
    98 {
       
    99     M3G_DO_LOCK
       
   100     m3gTextureSetBlending((M3GTexture)aHTexture2D, aFunc);
       
   101     M3G_DO_UNLOCK(aEnv)
       
   102 }
       
   103 
       
   104 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Texture2D__1getImage
       
   105 (JNIEnv* aEnv, jclass, jint aHTex)
       
   106 {
       
   107     M3G_DO_LOCK
       
   108     jint image = (M3Guint) m3gGetTextureImage((M3GTexture)aHTex);
       
   109     M3G_DO_UNLOCK(aEnv)
       
   110     return image;
       
   111 }
       
   112 
       
   113 /* M3G 1.1 JNI Calls */
       
   114 
       
   115 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Texture2D__1getImageFilter
       
   116 (JNIEnv* aEnv, jclass, jint aHTex)
       
   117 {
       
   118     M3Gint levelFilter = 0;
       
   119     M3Gint imageFilter = 0;
       
   120     M3G_DO_LOCK
       
   121     m3gGetFiltering((M3GTexture)aHTex, &levelFilter, &imageFilter);
       
   122     M3G_DO_UNLOCK(aEnv)
       
   123     return (jint)imageFilter;
       
   124 }
       
   125 
       
   126 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Texture2D__1getLevelFilter
       
   127 (JNIEnv* aEnv, jclass, jint aHTex)
       
   128 {
       
   129     M3Gint levelFilter = 0;
       
   130     M3Gint imageFilter = 0;
       
   131     M3G_DO_LOCK
       
   132     m3gGetFiltering((M3GTexture)aHTex, &levelFilter, &imageFilter);
       
   133     M3G_DO_UNLOCK(aEnv)
       
   134     return (jint)levelFilter;
       
   135 }