Setting Up Your Environment

Requirements

Before you can begin programming OpenGL ES for the PocketPC, you will need the following :

  1. Embedded Visual C++ 4.0
  2. Embedded Visual C++ 4.0 Service Pack 4
  3. Pocket PC 2003 SDK
  4. An OpenGL ES Implementation

OpenGL ES Implementations

Vincent Mobile 3D Rendering Library

The Vincent Mobile 3D Rendering Library an OpenGL ES implementation that can be used for both commercial and non-commercial projects without having to pay license fees. Another great feature is that the library arrives standard with window management functions, allowing applications to be setup quickly and easily.

Hybrid's "Rasteroid" Implementation

The Hybrid implementation is a commercial library which can be used freely for non-commercial use. License fees need to be payed if you wish to develop a commercial application using this library. The Hybrid implementation does offer advantages over the Vincent library. Some advantages I have come across include a higher frame rate for tested devices as well as the ability to use a depth buffer with greater precision.

Other OpenGL ES Implementations

As new implementations become available, they will be added here once tested.

GLUT|ES

The GLUT|ES library will be used in conjunction with these implementations as it greatly simplifies the creation and usage of an OpenGL ES window.

Installation

You will need to install the first 3 items above. They are normal windows installations. Note that the cd-key for Embedded Visual C++ 4.0 is given at the bottom of the download page given above.

Vincent Library Installation

Download the latest binary version of Vincent from the link above. After extracting the Vincent library, you will be copying files to your C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\ directory where C:\Program Files\Windows CE Tools\ is your pocket pc sdk install directory. We will refer to this directory from now on as your/sdk/ directory. In the Lib and Include sub-directories, you will notice that there is an Armv4 and an Emulatordirectory. These are the different directories that are used depending on what you are compiling for.

Copy the contents of the /dist/include directory to your sdk/Include/Armv4 and sdk/Include/Emulator directories.

Then copy the contents of the /dist/bin/emu/Debug directory except for the libGLES_CM.dll file to your/sdk/Lib/Emulator directory.

Copy the contents of the /dist/bin/arm/Release directory except for the libGLES_CM.dll file to your /sdk/lib/Armv4directory.

To simplify window creation, you can make use of the UG library that comes standard with the Vincent library. This is acceptable but it does have its problems. I would recommend using GLUT|ES library as it provides more features and seems to be more stable. You will be able to follow the tutorials whether you use the GLUT|ES library or whether you use the UG library (GLUT|ES Installation).

Installation of Hybrid "Rasteroid" Implementation and other OpenGL ES Implementations

Download the latest binary version of the library you are using from the link above or from another link you may have. After extracting the library, you will be copying files to your C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\ directory where C:\Program Files\Windows CE Tools\ is your pocket pc sdk install directory. We will refer to this directory from now on as your /sdk/ directory. In the Lib and Include sub-directories, you will notice that there is an Armv4 and an Emulator directory. These are the different directories that are used depending on what you are compiling for.

The library you have downloaded should contain an include directory. Copy the contents of this directory to yoursdk/Include/Armv4 and sdk/Include/Emulator directories.

The library you have downloaded should also contain a Release or a bin directory. Copy the contents of this directory (libGLES_CM.lib) except for the libGLES_CM.dll file to your /sdk/Lib/Emulator or /sdk/lib/Armv4directory depending on which version of the library you have downloaded.

Installation of GLUT|ES

To simplify the creation of an OpenGL ES window, we will be making use of the GLUT|ES library. This library can be downloaded from the link above. Also download the GLU|ES library from the same link.

Extract the GLUT|ES library and copy the contents of the Inc directory into your sdk/Include/Armv4 directory.

Copy the contents of the ARMV4Rel directory except for the glutes.dll into your /sdk/lib/Armv4 directory. If you are compiling for the x86 processor, you must make use of the libraries in the x86Rel directory.

Extract the GLU|ES library and copy all files into your sdk/Include/Armv4 directory.

The best option would be to download the GLUT|ES source code from the website given above and to compile it using your current OpenGL ES libraries. This can sometimes prove to be quite difficult so I have provided theGLUT|ES and GLU|ES header files and compiled (ARM) library files (Vincent 0.83 or Hybrid 1.1).

A few people have had problems compiling with GLUT|ES and receive errors about the winmm.lib library. One of our forum members, blotfib, has kindly re-compiled GLUT|ES to fix this problem. Please download and use there-compiled package if you are receiving these errors.

Creating a New Project and Setting up the Emulator / PDA

  1. Open Embedded Visual C++ 4.0
  2. Click on File > New
  3. Select WCP Pocket PC 2003 Application
  4. Input TestProject under Project name
  5. Click OK
  6. On the next dialog, select A typical "Hello World!" Application and click Finish
  7. Click OK on the next dialog.

A project will open with an already made application. Above the code window, select POCKET PC 2003 Emulatorfrom the rightmost dropdown box.

Select Pocket PC 2003 Emulator

Press F7 or click on Build > Build TestProject.exe.

The emulator will appear. Click Emulator > Folder Sharing and specify a directory on your hard drive. The contents of this directory will be available in the storage card location on the emulator.

The last thing you need to do is to copy the libGLES_CM.dll file to your /Windows directory on your emulator. The location of this file for the Vincent library is /dist/bin/emu/Debug/libGLES_CM.dll.

Select Pocket PC 2003 Emulator

This can be achieved by clicking on the Emulator > Folder Sharing menu option. You will then need to select a directory that will be shared between your emulator and your normal windows file system. Place the dll file in the directory that you have specified and then you will be able to retrieve it by accessing the storage card of the emulator. The storage card can be accessed by clicking on the storage card button in the file explorer as shown circled in red below.

Select Pocket PC 2003 Emulator

Dll files are generally hidden by default. You therefore may have to hold down your stylus on an empty space and click on the View All Files menu option as shown circled in blue above. Place the dll file in your share directory and copy it across to your /Windows directory.

You can now create a new project using the steps above except that you will need to create an empty project to start a new OpenGL ES program.

One last thing to remember is that you must select what version you want to compile for. Select Win32 (WCE emulator) Debug when you want to test your program on the emulator and select Win32 (WCE ARMV4) Releasewhen you want to deploy the program to your Pocket PC device. Also remember to copy the/dist/bin/arm/Release/libGLES_CM.dll file to your Pocket PC device.

Select Pocket PC 2003 Emulator

You should now be able to start creating OpenGL ES projects.

Please let me know of any comments you may have : Contact Me

### 关于 JPYPE 找不到 JVM 共享库文件 `jvm.dll` 的解决方案 当遇到 `JVMNotFoundException` 或者提示无法加载 `jvm.dll` 文件时,通常是因为 Java 虚拟机路径未被正确识别或者环境变量配置不完整。以下是针对此问题的具体分析和解决方法: #### 1. **确认 JAVA_HOME 配置** 确保系统的 `JAVA_HOME` 环境变量已正确定义并指向有效的 JDK 安装目录。可以通过以下命令验证其设置是否正确: ```bash echo %JAVA_HOME% ``` 如果返回为空或路径无效,则需手动调整该变量至正确的 JDK 目录位置[^1]。 #### 2. **检查 jvm.dll 存在性** 进入 `%JAVA_HOME%\bin\server` 文件夹下查找是否存在名为 `jvm.dll` 的动态链接库文件。若缺失则表明当前安装包可能损坏或是精简版 JRE 并不含所需组件;此时建议重新下载标准全量版本的 Oracle/Sun JDK 来替换现有环境。 #### 3. **指定 JVM 路径给 JPype** 即使设置了全局性的 `JAVA_HOME`,有时仍需显式告知 Python 应用程序具体使用的 JVM 地址。可以尝试通过如下方式初始化 JPype 实例前加入额外参数来实现这一点: ```python import jpype jpype.startJVM(r"C:\Program Files\Java\jdk-xx.x\bin\server\jvm.dll") # 替换为实际路径 ``` 注意这里填写绝对物理磁盘上的确切地址而非依赖相对寻址逻辑获取目标资源。 #### 4. **操作系统架构匹配** 保证所选用的 JDK 版本与运行平台保持一致(即均为32位或64位),否则即便其他条件满足也可能因二进制结构差异引发兼容性冲突而报错。 --- ### 示例代码片段 下面给出一段完整的测试脚本来帮助排查上述提到的各种可能性因素: ```python import os from pathlib import Path def check_jvm_setup(): try: java_home = os.environ['JAVA_HOME'] print(f"Detected JAVA_HOME={java_home}") expected_dll_path = Path(java_home)/'bin/server/jvm.dll' if not expected_dll_path.exists(): raise FileNotFoundError('Missing required file: {}'.format(expected_dll_path)) import jpype jpype.startJVM(str(expected_dll_path)) print("Successfully started JVM.") except KeyError as e: print("Error:", str(e), "- Please set your JAVA_HOME environment variable correctly.") except Exception as ex: print("An error occurred while starting the JVM:") print(ex) if __name__ == "__main__": check_jvm_setup() ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值