openframeworks / openframeworks/openFrameworks
ofFbo android render
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
when i use a fbo on android without fbo.draw()
do i still get the fbo render.
a simple example of code to reproduce the problem:
/* ofApp.h */
#pragma once
#include "ofMain.h"
#include "ofxAndroid.h"
class ofApp : public ofxAndroidApp{
public:
void setup();
void update();
void draw();
ofFbo fbo;
ofTexture tex;
ofImage img;
};
/* ofApp.cpp */
#include "ofApp.h"
void ofApp::setup()
{
img.load("img.jpg");
fbo.allocate(img.getWidth(),img.getHeight());
}
//--------------------------------------------------------------
void ofApp::update()
{
fbo.begin();
img.draw(0,0);
fbo.end();
}
//--------------------------------------------------------------
void ofApp::draw()
{
}
/* main.cpp */
#include "ofMain.h"
#include "ofApp.h"
int main(){
ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp( new ofApp() );
return 0;
}
#ifdef TARGET_ANDROID
void ofAndroidApplicationInit()
{
//application scope init
}
void ofAndroidActivityInit()
{
//activity scope init
main();
}
#endif
my device: Huawei p20 or Huawei P20 pro with android version 8.1.0 and openframeworks v0.10.0
Ciao
Dario
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the example from ofApp.h, ofApp.cpp, and main.cpp on the reported Android setup, focusing on the fbo.begin(), img.draw(), and fbo.end() sequence. Trace the Android FBO rendering path to determine whether rendering persists without fbo.draw(); done means the behavior is confirmed and either corrected or clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cpp
- Domain
- computer-graphics, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100