javauis/m3g_qt/javasrc/javax/microedition/m3g/Material.java
changeset 35 85266cc22c7f
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
       
     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 Material extends Object3D
       
    22 {
       
    23     //------------------------------------------------------------------
       
    24     // Static data
       
    25     //------------------------------------------------------------------
       
    26 
       
    27     public static final int AMBIENT  = 1024;
       
    28     public static final int DIFFUSE  = 2048;
       
    29     public static final int EMISSIVE = 4096;
       
    30     public static final int SPECULAR = 8192;
       
    31 
       
    32     //------------------------------------------------------------------
       
    33     // Constructor(s)
       
    34     //------------------------------------------------------------------
       
    35 
       
    36     public Material()
       
    37     {
       
    38         super(_ctor(Interface.getHandle()));
       
    39     }
       
    40 
       
    41     /**
       
    42      */
       
    43     Material(int handle)
       
    44     {
       
    45         super(handle);
       
    46     }
       
    47 
       
    48     //------------------------------------------------------------------
       
    49     // Public methods
       
    50     //------------------------------------------------------------------
       
    51 
       
    52     public void setColor(int target, int ARGB)
       
    53     {
       
    54         _setColor(handle, target, ARGB);
       
    55     }
       
    56 
       
    57     public int getColor(int target)
       
    58     {
       
    59         return _getColor(handle, target);
       
    60     }
       
    61 
       
    62     public void setShininess(float shininess)
       
    63     {
       
    64         _setShininess(handle, shininess);
       
    65     }
       
    66 
       
    67     public float getShininess()
       
    68     {
       
    69         return _getShininess(handle);
       
    70     }
       
    71 
       
    72     public void setVertexColorTrackingEnable(boolean enable)
       
    73     {
       
    74         _setVertexColorTrackingEnable(handle, enable);
       
    75     }
       
    76 
       
    77     public boolean isVertexColorTrackingEnabled()
       
    78     {
       
    79         return _isVertexColorTrackingEnabled(handle);
       
    80     }
       
    81 
       
    82     //------------------------------------------------------------------
       
    83     // Private methods
       
    84     //------------------------------------------------------------------
       
    85 
       
    86     private native static int _ctor(int hInstance);
       
    87     private native static void _setColor(int handle, int target, int ARGB);
       
    88     private native static int _getColor(int handle, int target);
       
    89     private native static void _setShininess(int handle, float shininess);
       
    90     private native static float _getShininess(int handle);
       
    91     private native static void _setVertexColorTrackingEnable(int handle, boolean enable);
       
    92     private native static boolean _isVertexColorTrackingEnabled(int handle);
       
    93 }