当前位置: 首页 > 编程日记 > 正文

【Android OpenGL ES】阅读hello-gl2代码(二)Java代码

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.android.gl2jni"><applicationandroid:label="@string/gl2jni_activity"><activity android:name="GL2JNIActivity"android:theme="@android:style/Theme.NoTitleBar.Fullscreen"android:launchMode="singleTask"android:configChanges="orientation|keyboardHidden"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity></application><uses-feature android:glEsVersion="0x00020000"/><uses-sdk android:minSdkVersion="5"/>
</manifest>

首先,我们看<activity />标签,定义了GL2JNIActivity

android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 定义该Activity的主题,全屏无标题栏。

android:launchMode="singleTask"  定义该Activity运行模式为“singleTask”。

android:configChanges="orientation|keyboardHidden"

默认情况下,Android每次屏幕旋转都会重新创建Activity,该属性将不会重新创建Activity,而只是调用onConfigurationChange(Configuration config)。

然后,我们看<users-feature android:glEsVersion="0x00020000">,定义使用的OpenGL ES版本为2.0。

GL2JNIActivity.java

package com.android.gl2jni;import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.WindowManager;import java.io.File;public class GL2JNIActivity extends Activity {GL2JNIView mView;@Override protected void onCreate(Bundle icicle) {super.onCreate(icicle);mView = new GL2JNIView(getApplication());setContentView(mView);}@Override protected void onPause() {super.onPause();mView.onPause();}@Override protected void onResume() {super.onResume();mView.onResume();}
}

mView = new GL2JNIView(getApplication());

setContentView(mView);

新建一个GL2JNIView对象,并设置该GL2JNIView为Activity的Content View显示。

@Override protected void onPause() {
    super.onPause();
    mView.onPause();
}

@Override protected void onResume() {
    super.onResume();
    mView.onResume();
}

GL2JNIView为GLSurfaceView子类:

A GLSurfaceView must be notified when the activity is paused and resumed. GLSurfaceView clients are required to call onPause() when the activity pauses and onResume() when the activity resumes. These calls allow GLSurfaceView to pause and resume the rendering thread, and also allow GLSurfaceView to release and recreate the OpenGL display.

GL2JNIView.java

GL2JNIView.java
package com.android.gl2jni;import android.content.Context;
import android.graphics.PixelFormat;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.opengles.GL10;/*** A simple GLSurfaceView sub-class that demonstrate how to perform* OpenGL ES 2.0 rendering into a GL Surface. Note the following important* details:** - The class must use a custom context factory to enable 2.0 rendering.*   See ContextFactory class definition below.** - The class must use a custom EGLConfigChooser to be able to select*   an EGLConfig that supports 2.0. This is done by providing a config*   specification to eglChooseConfig() that has the attribute*   EGL10.ELG_RENDERABLE_TYPE containing the EGL_OPENGL_ES2_BIT flag*   set. See ConfigChooser class definition below.** - The class must select the surface's format, then choose an EGLConfig*   that matches it exactly (with regards to red/green/blue/alpha channels*   bit depths). Failure to do so would result in an EGL_BAD_MATCH error.*/
class GL2JNIView extends GLSurfaceView {private static String TAG = "GL2JNIView";private static final boolean DEBUG = false;public GL2JNIView(Context context) {super(context);init(false, 0, 0);}public GL2JNIView(Context context, boolean translucent, int depth, int stencil) {super(context);init(translucent, depth, stencil);}private void init(boolean translucent, int depth, int stencil) {/* By default, GLSurfaceView() creates a RGB_565 opaque surface.* If we want a translucent one, we should change the surface's* format here, using PixelFormat.TRANSLUCENT for GL Surfaces* is interpreted as any 32-bit surface with alpha by SurfaceFlinger.*/if (translucent) {this.getHolder().setFormat(PixelFormat.TRANSLUCENT);}/* Setup the context factory for 2.0 rendering.* See ContextFactory class definition below*/setEGLContextFactory(new ContextFactory());/* We need to choose an EGLConfig that matches the format of* our surface exactly. This is going to be done in our* custom config chooser. See ConfigChooser class definition* below.*/setEGLConfigChooser( translucent ?new ConfigChooser(8, 8, 8, 8, depth, stencil) :new ConfigChooser(5, 6, 5, 0, depth, stencil) );/* Set the renderer responsible for frame rendering */setRenderer(new Renderer());}private static class ContextFactory implements GLSurfaceView.EGLContextFactory {private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {Log.w(TAG, "creating OpenGL ES 2.0 context");checkEglError("Before eglCreateContext", egl);int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);checkEglError("After eglCreateContext", egl);return context;}public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) {egl.eglDestroyContext(display, context);}}private static void checkEglError(String prompt, EGL10 egl) {int error;while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));}}private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser {public ConfigChooser(int r, int g, int b, int a, int depth, int stencil) {mRedSize = r;mGreenSize = g;mBlueSize = b;mAlphaSize = a;mDepthSize = depth;mStencilSize = stencil;}/* This EGL config specification is used to specify 2.0 rendering.* We use a minimum size of 4 bits for red/green/blue, but will* perform actual matching in chooseConfig() below.*/private static int EGL_OPENGL_ES2_BIT = 4;private static int[] s_configAttribs2 ={EGL10.EGL_RED_SIZE, 4,EGL10.EGL_GREEN_SIZE, 4,EGL10.EGL_BLUE_SIZE, 4,EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,EGL10.EGL_NONE};public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {/* Get the number of minimally matching EGL configurations*/int[] num_config = new int[1];egl.eglChooseConfig(display, s_configAttribs2, null, 0, num_config);int numConfigs = num_config[0];if (numConfigs <= 0) {throw new IllegalArgumentException("No configs match configSpec");}/* Allocate then read the array of minimally matching EGL configs*/EGLConfig[] configs = new EGLConfig[numConfigs];egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config);if (DEBUG) {printConfigs(egl, display, configs);}/* Now return the "best" one*/return chooseConfig(egl, display, configs);}public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display,EGLConfig[] configs) {for(EGLConfig config : configs) {int d = findConfigAttrib(egl, display, config,EGL10.EGL_DEPTH_SIZE, 0);int s = findConfigAttrib(egl, display, config,EGL10.EGL_STENCIL_SIZE, 0);// We need at least mDepthSize and mStencilSize bitsif (d < mDepthSize || s < mStencilSize)continue;// We want an *exact* match for red/green/blue/alphaint r = findConfigAttrib(egl, display, config,EGL10.EGL_RED_SIZE, 0);int g = findConfigAttrib(egl, display, config,EGL10.EGL_GREEN_SIZE, 0);int b = findConfigAttrib(egl, display, config,EGL10.EGL_BLUE_SIZE, 0);int a = findConfigAttrib(egl, display, config,EGL10.EGL_ALPHA_SIZE, 0);if (r == mRedSize && g == mGreenSize && b == mBlueSize && a == mAlphaSize)return config;}return null;}private int findConfigAttrib(EGL10 egl, EGLDisplay display,EGLConfig config, int attribute, int defaultValue) {if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {return mValue[0];}return defaultValue;}private void printConfigs(EGL10 egl, EGLDisplay display,EGLConfig[] configs) {int numConfigs = configs.length;Log.w(TAG, String.format("%d configurations", numConfigs));for (int i = 0; i < numConfigs; i++) {Log.w(TAG, String.format("Configuration %d:\n", i));printConfig(egl, display, configs[i]);}}private void printConfig(EGL10 egl, EGLDisplay display,EGLConfig config) {int[] attributes = {EGL10.EGL_BUFFER_SIZE,EGL10.EGL_ALPHA_SIZE,EGL10.EGL_BLUE_SIZE,EGL10.EGL_GREEN_SIZE,EGL10.EGL_RED_SIZE,EGL10.EGL_DEPTH_SIZE,EGL10.EGL_STENCIL_SIZE,EGL10.EGL_CONFIG_CAVEAT,EGL10.EGL_CONFIG_ID,EGL10.EGL_LEVEL,EGL10.EGL_MAX_PBUFFER_HEIGHT,EGL10.EGL_MAX_PBUFFER_PIXELS,EGL10.EGL_MAX_PBUFFER_WIDTH,EGL10.EGL_NATIVE_RENDERABLE,EGL10.EGL_NATIVE_VISUAL_ID,EGL10.EGL_NATIVE_VISUAL_TYPE,0x3030, // EGL10.EGL_PRESERVED_RESOURCES,
                    EGL10.EGL_SAMPLES,EGL10.EGL_SAMPLE_BUFFERS,EGL10.EGL_SURFACE_TYPE,EGL10.EGL_TRANSPARENT_TYPE,EGL10.EGL_TRANSPARENT_RED_VALUE,EGL10.EGL_TRANSPARENT_GREEN_VALUE,EGL10.EGL_TRANSPARENT_BLUE_VALUE,0x3039, // EGL10.EGL_BIND_TO_TEXTURE_RGB,0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGBA,0x303B, // EGL10.EGL_MIN_SWAP_INTERVAL,0x303C, // EGL10.EGL_MAX_SWAP_INTERVAL,
                    EGL10.EGL_LUMINANCE_SIZE,EGL10.EGL_ALPHA_MASK_SIZE,EGL10.EGL_COLOR_BUFFER_TYPE,EGL10.EGL_RENDERABLE_TYPE,0x3042 // EGL10.EGL_CONFORMANT
            };String[] names = {"EGL_BUFFER_SIZE","EGL_ALPHA_SIZE","EGL_BLUE_SIZE","EGL_GREEN_SIZE","EGL_RED_SIZE","EGL_DEPTH_SIZE","EGL_STENCIL_SIZE","EGL_CONFIG_CAVEAT","EGL_CONFIG_ID","EGL_LEVEL","EGL_MAX_PBUFFER_HEIGHT","EGL_MAX_PBUFFER_PIXELS","EGL_MAX_PBUFFER_WIDTH","EGL_NATIVE_RENDERABLE","EGL_NATIVE_VISUAL_ID","EGL_NATIVE_VISUAL_TYPE","EGL_PRESERVED_RESOURCES","EGL_SAMPLES","EGL_SAMPLE_BUFFERS","EGL_SURFACE_TYPE","EGL_TRANSPARENT_TYPE","EGL_TRANSPARENT_RED_VALUE","EGL_TRANSPARENT_GREEN_VALUE","EGL_TRANSPARENT_BLUE_VALUE","EGL_BIND_TO_TEXTURE_RGB","EGL_BIND_TO_TEXTURE_RGBA","EGL_MIN_SWAP_INTERVAL","EGL_MAX_SWAP_INTERVAL","EGL_LUMINANCE_SIZE","EGL_ALPHA_MASK_SIZE","EGL_COLOR_BUFFER_TYPE","EGL_RENDERABLE_TYPE","EGL_CONFORMANT"};int[] value = new int[1];for (int i = 0; i < attributes.length; i++) {int attribute = attributes[i];String name = names[i];if ( egl.eglGetConfigAttrib(display, config, attribute, value)) {Log.w(TAG, String.format("  %s: %d\n", name, value[0]));} else {// Log.w(TAG, String.format("  %s: failed\n", name));while (egl.eglGetError() != EGL10.EGL_SUCCESS);}}}// Subclasses can adjust these values:protected int mRedSize;protected int mGreenSize;protected int mBlueSize;protected int mAlphaSize;protected int mDepthSize;protected int mStencilSize;private int[] mValue = new int[1];}private static class Renderer implements GLSurfaceView.Renderer {public void onDrawFrame(GL10 gl) {GL2JNILib.step();}public void onSurfaceChanged(GL10 gl, int width, int height) {GL2JNILib.init(width, height);}public void onSurfaceCreated(GL10 gl, EGLConfig config) {// Do nothing.
        }}
}

重载构造方法:

public GL2JNIView(Context context)

public GL2JNIView(Context context, boolean translucent, int depth, int stencil)

构造方法调用

private void init(boolean translucent, int depth, int stencil)

进行初始化工作:

if (translucent) {
    this.getHolder().setFormat(PixelFormat.TRANSLUCENT);
}

By default GLSurfaceView will create a PixelFormat.RGB_565 format surface. If a translucent surface is required, call getHolder().setFormat(PixelFormat.TRANSLUCENT). The exact format of a TRANSLUCENT surface is device dependent, but it will be a 32-bit-per-pixel surface with 8 bits per component.

 

setEGLContextFactory(new ContextFactory());

文档:public void setEGLContextFactory (GLSurfaceView.EGLContextFactory factory)

 

setEGLConfigChooser( translucent ?
    new ConfigChooser(8, 8, 8, 8, depth, stencil) :
    new ConfigChooser(5, 6, 5, 0, depth, stencil) ); 

文档:public void setEGLConfigChooser (GLSurfaceView.EGLConfigChooser configChooser)

 

setRenderer(new Renderer());

文档:public void setRenderer (GLSurfaceView.Renderer renderer)

私有内部类Renderer定义如下:

private static class Renderer implements GLSurfaceView.Renderer {
    public void onDrawFrame(GL10 gl) {
        GL2JNILib.step();
    }

    public void onSurfaceChanged(GL10 gl, int width, int height) {
        GL2JNILib.init(width, height);
    }

    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
        // Do nothing.
    }
}

文档:GLSurfaceView.Renderer

当surface改变尺寸,调用GL2JNILib.init(width, height);

当画当前帧的时候,调用GL2JNILib.step();

GL2JNILib.java

package com.android.gl2jni;// Wrapper for native librarypublic class GL2JNILib {static {System.loadLibrary("gl2jni");}/*** @param width the current view width* @param height the current view height*/public static native void init(int width, int height);public static native void step();
}

static {
    System.loadLibrary("gl2jni");
}

加载静态库gl2jni

public static native void init(int width, int height);
public static native void step();

声明public static native方法,通过JNI调用C/C++的native方法。

 

转载于:https://www.cnblogs.com/dyingbleed/archive/2012/11/05/2754519.html

相关文章:

activiti任务TASK

一、概要 设计TASK的表主要是&#xff1a;ACT_RU_TASK&#xff0c;ACT_HI_TASKINST&#xff08;见参考-activiti表&#xff09;&#xff1b;任务主要有&#xff1a;人工任务&#xff08;usertask&#xff09;,服务任务&#xff08;servicetask&#xff09;等&#xff1b;候选人…

matlab数值分析拟合实例,数值分析函数拟合matlab代码.doc

数值分析函数拟合matlab代码.doc 第一题MATLAB代码用SPLINE作图XI0204060810YI098092081064038X10012Y1NEWTON3XI,YI,X源代码见M文件Y2SPLINEXI,YI,XPLOTXI,YI, O ,X,Y1, R ,X,Y2, K 用CSAPE作图XI0204060810YI098092081064038X10012Y1NEWTON3XI,YI,X源代码见M文件PPCSAPEXI,YI…

ArrayList Iterator remove java.lang.UnsupportedOperationException

在使用Arrays.asList()后调用add&#xff0c;remove这些method时出现 java.lang.UnsupportedOperationException异常。这是由于Arrays.asList() 返回java.util.Arrays$ArrayList&#xff0c; 而不是ArrayList。Arrays$ArrayList和ArrayList都是继承AbstractList&#xff0c;rem…

android中方法调用super(..)的相关知识

java中的多态有重写 方法被子类重写后 父类的原方法就会被隐藏 当你又需要调用父类所定义的原方法 这个时候就可以用super来调用super调用指向了父类&#xff0c;在一些调用里可以很巧妙的利用&#xff0c;比如监听返回键了在onKeyDown的方法里&#xff0c;如果想让系统对back…

在使用Reference Source调试.Net 源代码时如何取消optimizations(代码优化)-翻译

当你在使用Reference Source functionality in VS 2008 调试.Net 的源代码的时候&#xff0c;你会发现很多变量没法再调试时查看。 这是因为源代码服务器上提供的代码默认是为最终销售优化过的&#xff08;optimized &#xff09;。这些值虽然你没法查看&#xff0c;但不会阻断…

java旅游网站毕业论文,基于JAVA技术的旅游网站的开发.doc

摘要: 这次毕设主要是为了实现基于JAVA技术的旅游网站的开发&#xff0c;方便人们近距离的出行游玩。网站的开发过程中用到了很多方法技术&#xff0c;最主要的是JAVA技术&#xff0c;用于编写后台的功能实现代码&#xff1b;框架采用的是Spring MVC&#xff0c;作为轻量级企业…

Spring 实践 -IoC

Spring 实践标签&#xff1a; Java与设计模式 Spring简介 Spring是分层的JavaSE/EE Full-Stack轻量级开源框架.以IoC(Inverse of Control 控制反转)和AOP(Aspect Oriented Programming 面向切面编程)为内核, 取代EJB的臃肿/低效/脱离现实. 主页http://spring.io/ IoC与DI IOC…

大话编程(一)

2013年1月15日 11:40:38 还有20分钟下班,实在忍不住了,想说点儿什么 编程入门的可以看看 (一)什么是0什么是1 有那么一堆叫半导体的东西,某个牛逼人用铜线连起来,组成了一个电路. 这个电路在一直通电的情况下,可以使某个点的电压保持不变, 如果这个点的电压大于某个值,就抽象为…

php 保存表单数据,使用jquery和php自动保存表单数据

我对PHP非常好,但是使用jQuery的总菜单,并且卡在自动保存表单数据中.自动保存功能在dummy.php中每30秒调用一次.我正在将用于处理的序列化表单数据( – >数据库)发送到savetest.php.此刻,我坚持这个问题&#xff1a;如何让savetest.php“监听”传入的数据并对其作出反应&…

Finalize/Dispose/Destructor

我总是会搞混这些东西&#xff0c;还是写下来帮助记忆。 Finalize 即Object.Finalize()&#xff0c;C#中不允许使用Finalize&#xff0c;析构器就等价于Finalize。 Destructor 析构器&#xff08;Destructor&#xff09;是在对象没有被引用的时候&#xff0c;由CLR自动调用的。…

linux 串口minicom配置使用

在minicom -s配置是记得取消硬件流控制。 1.minicom -o 配置文件 2.alias comminicom -o 配置文件 转载于:https://www.cnblogs.com/niceskyfly/p/5257713.html

POJ-1185 炮兵阵地 动态规划+状态压缩

由于递推的时候依赖于三个连续层的关系.一开始想着直接三重for循环,但是这里有个问题就是上一层的0位置上包括着上上层是0和1两种可能,而后者又对当前行有约束,因此该方法不行.当然有一个办法就是增加状态数,让状态能够表示是从1还是从0转移过来的.(这题有个解法是采用多进制的…

php字符串转换表达式,php处理字符串格式的计算表达式

有时候我们对每一种产品都有一个提成公式&#xff0c;而这个计算提成的公式是以字符串格式存在表中的当我们用这个计算公式时&#xff0c;他并不像我们写的&#xff1a;$a23*5;这样简单的能计算出结果&#xff0c;而它是个字符串所以&#xff0c;我们就必须把字符串转化为我们能…

JS函数式编程【译】5.2 函子 (Functors)

函子&#xff08;Functors&#xff09; 态射是类型之间的映射&#xff1b;函子是范畴之间的映射。可以认为函子是这样一个函数&#xff0c;它从一个容器中取出值&#xff0c; 并将其加工&#xff0c;然后放到一个新的容器中。这个函数的第一个输入的参数是类型的态射&#xff0…

[转]Introduction of iSCSI Target in Windows Server 2012

Introduction of iSCSI Target in Windows Server 2012 源地址&#xff1a;http://blogs.technet.com/b/filecab/archive/2012/05/21/introduction-of-iscsi-target-in-windows-server-2012.aspx The iSCSI Target made its debut as a free download for Windows 2008 R2 in A…

全国移动联通基站数据升级包(2013年1月基站升级包).rar

“全国移动联通基站数据升级包(2013年1月基站升级包).rar” 已经上传到CNBLOGS 地址&#xff1a;http://files.cnblogs.com/topwang-com/%E5%85%A8%E5%9B%BD%E7%A7%BB%E5%8A%A8%E8%81%94%E9%80%9A%E5%9F%BA%E7%AB%99%E6%95%B0%E6%8D%AE%E5%8D%87%E7%BA%A7%E5%8C%85(2013%E5%B9%…

php自动计算增长率,如何写sql计算增长率?

问题已有数据表(假定表名为t)time sale1999 4844904672000 651413668.92001 13713710082002 18177416252003 25053320952004 37654384862005 48177203842006 6083322598需要产生如下的数据表time sale …

我先了解一下博客园创建随笔/文章/日记的过程与三者的区别(隐私等级,是否审核等)...

我先了解一下博客园创建随笔/文章/日记的过程与三者的区别(隐私等级,是否审核等)转载于:https://www.cnblogs.com/Totooria-Hyperion/p/5260289.html

构建Java并发模型框架

2002 年 2 月 22 日 Java的多线程特性为构建高性能的应用提供了极大的方便&#xff0c;但是也带来了不少的麻烦。线程间同步、数据一致性等烦琐的问题需要细心的考虑&#xff0c;一不小心就会出现一些微妙的&#xff0c;难以调试的错误。另外&#xff0c;应用逻辑和线程逻辑纠缠…

Unity Note 1

1.把开始时间设定到播放完成的时间点&#xff0c;作为倒放的起点 animation["clip"].timeanimation["clip"].clip.length; animation["clip"].speed-1; animation.Play("clip"); 2.寻找场景中物体var door GameObject.Find(…

基于matlab的硅晶体模型,基于Matlab的图像处理技术识别硅太阳电池的缺陷

第 44 卷 第 7 期  2010 年 7 月 上 海 交 通 大 学 学 报 JOURNAL OF SHANGHAI J IAOTON G UNIVERSITY Vol. 44 No. 7   Jul. 2010   收稿日期 :20090908 作者简介 :柳效辉(19852) ,男 ,江西九江人 ,硕士生 ,主要从事光伏检测与光伏系统方面的研究. 徐  林(联系人) ,男 ,副…

spark- PySparkSQL之PySpark解析Json集合数据

PySparkSQL之PySpark解析Json集合数据 数据样本 12341234123412342|asefr-3423|[{"name":"spark","score":"65"},{"name":"airlow","score":"70"},{"name":"flume",&quo…

cmd库的导入Java,在cmd命令窗口导入第三方jar包来运行java文件

在cmd命令窗口导入第三方jar包来运行java文件&#xff0c;以下测试都是基于window环境&#xff0c;Linux环境没有测试。1、编译使用命令javac -cp或者javac -classpath本机测试&#xff1a;如下图所示&#xff0c;java文件路径为D:\workspace\demo,StringUtilsTest.java依赖了第…

JQuery 动态创建表单,并自动提交

前言&#xff1a;写这个是为了实现使用cookie进行自动登录的功能&#xff0c; 下面的代码是一个元素一个元素进行创建和赋值的&#xff0c; (可以尝试下将所有的html代码(form、input&#xff09;全部拼好以后放到${ } 中&#xff0c;再进行提交。) submit的时候注意下写法&…

(转)利用ArcScene进行三维地形模拟

本文摘自&#xff1a;http://www.sunzx.net/archive/1109.html 在ArcGIS Desktop中&#xff0c;可用于三维场景展示的程序为ArcGlobe和ArcScene&#xff0c;由于两者的差别&#xff0c;在三维场景展示中适用的情况有所不同。ArcScene是一个适合于展示三维透视场景的平台&#x…

Android使用自定义View时:Error inflating class错误的原因。

当在布局文件里使用自定义的View的时候&#xff0c;出现Error inflating class错误的原因&#xff1a; 1、没有定义inflate需要的默认构造函数&#xff1b; eg:自定义View为TestView,需要定义TestView(Context context),TestView(Context context,AttributeSet set); 2、这是个…

oracle的表几种连接比较,几种表连接方式的使用场景

1)nested loopnested loop&#xff0c;指的是两个表连接时, 通过两层嵌套循环来进行依次的匹配, 最后得到返回结果集的表连接方法.select t1.owner,t1.object_name,t2.OBJECT_IDfrom test_tab1 t1,test_tab2 t2where t1.OBJECT_ID t2.OBJECT_IDand ROWNUM select *from test_t…

Ajax 完整教程 (转)

Ajax 完整教程第 1 页 Ajax 简介Ajax 由 HTML、JavaScript™ 技术、DHTML 和 DOM 组成&#xff0c;这一杰出的方法可以将笨拙的 Web 界面转化成交互性的 Ajax 应用程序。本文的作者是一位 Ajax 专家&#xff0c;他演示了这些技术如何协同工作 —— 从总体概述到细节的讨论 ——…

.Net中如何操作IIS(源代码)

http://www.daima.com.cn/Info/3/Info20453/转载于:https://www.cnblogs.com/luoyuan/archive/2005/09/17/238986.html

Enterprise Library Configuration DAAB的使用

1.要试用DAAB,首先要引用两个类库 第一个是Enterprise Library Shared Library 这个类库是所有Enterprist Library都必须引用的类库,它提供所需的结构类型. 第二个是Enterprist Library Data Access Application Block 这个就是daab的核心类库. 2试用DAAB的第一个步骤就是配置a…