org_ogre4j_viewport.cpp

来自「使用stl技术,(还没看,是听说的)」· C++ 代码 · 共 168 行

CPP
168
字号
/*  Ogre4J
    Copyright (C) 2002 macross

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
#include "org_ogre4j_Viewport.h"

#include "Ogre4JRoot.h"


//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Viewport_update
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    vp->update();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jobject JNICALL Java_org_ogre4j_Viewport_getCamera
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return OGRE4J.newJRef(OGRE4J.cameraClass, vp->getCamera());
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Viewport_setCamera
(JNIEnv *, jobject obj, jobject camera) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    Camera*  cam = (Camera*)OGRE4J.getCppRef(camera);
    vp->setCamera(cam);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jfloat JNICALL Java_org_ogre4j_Viewport_getLeft
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getLeft();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jfloat JNICALL Java_org_ogre4j_Viewport_getTop
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getTop();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jfloat JNICALL Java_org_ogre4j_Viewport_getWidth
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getWidth();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jfloat JNICALL Java_org_ogre4j_Viewport_getHeight
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getHeight();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jint JNICALL Java_org_ogre4j_Viewport_getActualLeft
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getActualLeft();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jint JNICALL Java_org_ogre4j_Viewport_getActualTop
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getActualTop();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jint JNICALL Java_org_ogre4j_Viewport_getActualWidth
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getActualWidth();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jint JNICALL Java_org_ogre4j_Viewport_getActualHeight
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getActualHeight();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Viewport_setDimensions
(JNIEnv *, jobject obj, jfloat left, jfloat top, jfloat width, jfloat height) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    vp->setDimensions(top, left, width, height);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Viewport_setBackgroundColour
(JNIEnv *, jobject obj, jobject col) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    vp->setBackgroundColour(OGRE4J.newColourValue(col));
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jobject JNICALL Java_org_ogre4j_Viewport_getBackgroundColour
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return OGRE4J.newColourValue(vp->getBackgroundColour());
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Viewport_setClearEveryFrame
(JNIEnv *, jobject obj, jboolean clear) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    vp->setClearEveryFrame(clear?true:false);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jboolean JNICALL Java_org_ogre4j_Viewport_getClearEveryFrame
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getClearEveryFrame();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Viewport_setOverlaysEnabled
(JNIEnv *, jobject obj, jboolean enable) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    vp->setOverlaysEnabled(enable?true:false);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jboolean JNICALL Java_org_ogre4j_Viewport_getOverlaysEnabled
(JNIEnv *, jobject obj) {
    Viewport* vp = (Viewport*)OGRE4J.getCppRef(obj);
    return vp->getOverlaysEnabled();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?