javauis/m3g_qt/javasrc/javax/microedition/m3g/CompositingMode.java
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2003 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 
       
    19 package javax.microedition.m3g;
       
    20 
       
    21 public class CompositingMode extends Object3D
       
    22 {
       
    23     //------------------------------------------------------------------
       
    24     // Static data
       
    25     //------------------------------------------------------------------
       
    26 
       
    27     public static final int ALPHA       = 64;
       
    28     public static final int ALPHA_ADD   = 65;
       
    29     public static final int MODULATE    = 66;
       
    30     public static final int MODULATE_X2 = 67;
       
    31     public static final int REPLACE     = 68;
       
    32 
       
    33     //------------------------------------------------------------------
       
    34     // Constructors
       
    35     //------------------------------------------------------------------
       
    36 
       
    37     public CompositingMode()
       
    38     {
       
    39         super(_ctor(Interface.getHandle()));
       
    40     }
       
    41 
       
    42     /**
       
    43      */
       
    44     CompositingMode(int handle)
       
    45     {
       
    46         super(handle);
       
    47     }
       
    48 
       
    49     //------------------------------------------------------------------
       
    50     // Public methods
       
    51     //------------------------------------------------------------------
       
    52 
       
    53     public void setBlending(int mode)
       
    54     {
       
    55         _setBlending(handle, mode);
       
    56     }
       
    57 
       
    58     public int getBlending()
       
    59     {
       
    60         return _getBlending(handle);
       
    61     }
       
    62 
       
    63     public void setAlphaThreshold(float threshold)
       
    64     {
       
    65         _setAlphaThreshold(handle, threshold);
       
    66     }
       
    67 
       
    68     public float getAlphaThreshold()
       
    69     {
       
    70         return _getAlphaThreshold(handle);
       
    71     }
       
    72 
       
    73     public void setAlphaWriteEnable(boolean enable)
       
    74     {
       
    75         _setAlphaWriteEnable(handle, enable);
       
    76     }
       
    77 
       
    78     public boolean isAlphaWriteEnabled()
       
    79     {
       
    80         return _isAlphaWriteEnabled(handle);
       
    81     }
       
    82 
       
    83     public void setColorWriteEnable(boolean enable)
       
    84     {
       
    85         _enableColorWrite(handle, enable);
       
    86     }
       
    87 
       
    88     public boolean isColorWriteEnabled()
       
    89     {
       
    90         return _isColorWriteEnabled(handle);
       
    91     }
       
    92 
       
    93     public void setDepthWriteEnable(boolean enable)
       
    94     {
       
    95         _enableDepthWrite(handle, enable);
       
    96     }
       
    97 
       
    98     public boolean isDepthWriteEnabled()
       
    99     {
       
   100         return _isDepthWriteEnabled(handle);
       
   101     }
       
   102 
       
   103     public void setDepthTestEnable(boolean enable)
       
   104     {
       
   105         _enableDepthTest(handle, enable);
       
   106     }
       
   107 
       
   108     public boolean isDepthTestEnabled()
       
   109     {
       
   110         return _isDepthTestEnabled(handle);
       
   111     }
       
   112 
       
   113     public void setDepthOffset(float factor, float units)
       
   114     {
       
   115         _setDepthOffset(handle, factor, units);
       
   116     }
       
   117 
       
   118     public float getDepthOffsetFactor()
       
   119     {
       
   120         return _getDepthOffsetFactor(handle);
       
   121     }
       
   122 
       
   123     public float getDepthOffsetUnits()
       
   124     {
       
   125         return _getDepthOffsetUnits(handle);
       
   126     }
       
   127 
       
   128     //------------------------------------------------------------------
       
   129     // Private methods
       
   130     //------------------------------------------------------------------
       
   131 
       
   132     private native static int _ctor(int hInterface);
       
   133     private native static void _setBlending(int handle, int mode);
       
   134     private native static int _getBlending(int handle);
       
   135     private native static void _setAlphaThreshold(int handle, float threshold);
       
   136     private native static float _getAlphaThreshold(int handle);
       
   137     private native static void _setAlphaWriteEnable(int handle, boolean enable);
       
   138     private native static boolean _isAlphaWriteEnabled(int handle);
       
   139     private native static void _enableDepthTest(int handle, boolean enable);
       
   140     private native static boolean _isDepthTestEnabled(int handle);
       
   141     private native static void _enableDepthWrite(int handle, boolean enable);
       
   142     private native static boolean _isDepthWriteEnabled(int handle);
       
   143     private native static void _enableColorWrite(int handle, boolean enable);
       
   144     private native static boolean _isColorWriteEnabled(int handle);
       
   145     private native static void _setDepthOffset(int handle, float factor, float units);
       
   146     private native static float _getDepthOffsetFactor(int handle);
       
   147     private native static float _getDepthOffsetUnits(int handle);
       
   148 }