原创文章,转载请注明: 转载自慢慢的回味
本文链接地址: Lesson 3 Adding Color
Color adds alot to an OpenGL project. By understanding both flat and smooth coloring, you can greatly enhance the way your OpenGL demos look. 本作品采用知识共享署名 4.0 国际许可协议进行许可。
Continues Learning
原创文章,转载请注明: 转载自慢慢的回味
本文链接地址: Lesson 2 Your First Polygon
Using the source code from the first tutorial, we will now add code to create a Triangle, and a Square on the screen. I know you’re probably thinking to yourself “a triangle and square… oh joy”, but it really is a BIG deal. Just about everything you create in OpenGL will be created out of triangles and squares. If you don’t understand how to create a simple little triangle in Three Dimensional space, you’ll be completely lost down the road. So read through this chapter and learn. 本作品采用知识共享署名 4.0 国际许可协议进行许可。
原创文章,转载请注明: 转载自慢慢的回味
In this tutorial, I will teach you how to set up, and use OpenGL in a Windows environment. The program you create in this tutorial will display an empty OpenGL window, switch the computer into fullscreen or windowed mode, and wait for you to press ESC or close the Window to exit. It doesn’t sound like much, but this program will be the framework for every other tutorial I release in the next while. It’s very important to understand how OpenGL works, what goes into creating an OpenGL Window, and how to write simple easy to understand code. You can download the code at the end of the tutorial, but I definitely recommend you read over the tutorial at least once, before you start programming in OpenGL.本作品采用知识共享署名 4.0 国际许可协议进行许可。
原创文章,转载请注明: 转载自慢慢的回味
本文链接地址: C++调用JVM执行
这是一个从C++调用JVM的使用例子
运行时需要加入环境变量LD_LIBRARY_PATH=/root/openjdk/build/linux-amd64/j2sdk-image/jre/lib/amd64/server
//============================================================================ // Name : JavaCPPJNI.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include "jniLegacyLibrary.h" using namespace std; int main() { cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! JavaVM* myvm = JavaCPP_init(0, 0); if(myvm == NULL){ return -1; } jint version = JNI_OnLoad(myvm, 0); JNIEnv* myenv; myvm->GetEnv((void**) &myenv, JNI_VERSION_1_6); jclass cls = myenv->FindClass("com/telenav/LegacyLibrary$LegacyClass"); jmethodID cid = myenv->GetMethodID(cls, "<init>", "()V"); if (cid == NULL) { return -1; /* exception thrown */ } /* Construct a java.lang.String object */ jobject obj = myenv->NewObject(cls, cid); if (obj == NULL) { return -1; /* exception thrown */ } jmethodID mid = myenv->GetMethodID(cls, "sayHello", "(Ljava/lang/String;)V"); jstring pname = myenv->NewStringUTF("Derek\n"); myenv->CallVoidMethod(obj, mid, pname); Java_com_telenav_LegacyLibrary_00024LegacyClass_sayHello(myenv,obj,pname); return 0; } |
本作品采用知识共享署名 4.0 国际许可协议进行许可。