c_cpp openFrameworks ofxPBR ofApp文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp openFrameworks ofxPBR ofApp文件相关的知识,希望对你有一定的参考价值。

#pragma once

#include "ofMain.h"

#include "ofxImGui.h"
#include "ofxPBR.h"
#include "ofxPBRHelper.h"

class ofApp : public ofBaseApp{

	public:
		void setup();
		void update();
		void draw();
		void renderScene();

		void keyPressed(int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void mouseEntered(int x, int y);
		void mouseExited(int x, int y);
		void windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);
		
    function<void()> scene;
    
    ofxPBR pbr;
    ofxPBRHelper pbrHelper;
    ofxImGui gui;
    
};
#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
    scene = bind(&ofApp::renderScene, this);

    gui.setup();    

    ofDisableArbTex();
    pbr.setup(1024);
    ofxPBRFiles::getInstance()->setup("ofxPBRAssets");
    pbrHelper.setup(&pbr, ofxPBRFiles::getInstance()->getPath() + "/settings", true);
}

//--------------------------------------------------------------
void ofApp::update(){

}

//--------------------------------------------------------------
void ofApp::draw(){

}

//--------------------------------------------------------------
void ofApp::renderScene(){

}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){

}

//--------------------------------------------------------------
void ofApp::keyReleased(int key){

}

//--------------------------------------------------------------
void ofApp::mouseMoved(int x, int y ){

}

//--------------------------------------------------------------
void ofApp::mouseDragged(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::mousePressed(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::mouseReleased(int x, int y, int button){
    
}

//--------------------------------------------------------------
void ofApp::mouseEntered(int x, int y){

}

//--------------------------------------------------------------
void ofApp::mouseExited(int x, int y){

}

//--------------------------------------------------------------
void ofApp::windowResized(int w, int h){

}

//--------------------------------------------------------------
void ofApp::gotMessage(ofMessage msg){

}

//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){ 

}
#include "ofMain.h"
#include "ofApp.h"

int main() {
    ofGLWindowSettings settings;
    settings.setGLVersion(4, 1);
    settings.width = 1280;
    settings.height = 720;
    ofCreateWindow(settings);
    ofRunApp(new ofApp());
}

以上是关于c_cpp openFrameworks ofxPBR ofApp文件的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp 在openFrameworks中找到单应性

c_cpp openFrameworks - 使用ofFmodSoundPlayer从audioPlayer获取原始音频帧

c_cpp openFrameworks内联着色器模板(仅限vert和frag)

c_cpp openFrameworks现代main.cpp(Open GL 4.1)

c_cpp 矢量函数(openFrameworks的Vec2f / 3f / 4f端口)

opencv + openframeworks + 代码块 + win7