openframeworks / openframeworks/openFrameworks

ofFbo android render

Open
#6,023 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.