jvcleave / ofxImGui

Use ImGui in openFrameworks
296 stars 124 forks source link

ImGui :: Image use ofFbo error #17

Closed o2co2 closed 8 years ago

o2co2 commented 8 years ago

GLuint id = m_ui.loadTexture(image_fbo.getTexture()); ImGui::Image((ImTextureID)(uintptr_t)id, ImVec2(fingerMovie.getWidth(), fingerMovie.getHeight()));

display blank

jvcleave commented 8 years ago

you using the develop branch?

o2co2 commented 8 years ago

@jvcleave yes develop branch

jvcleave commented 8 years ago

anything but master often a work in progress

You may want to try to use ofDisableArbTex() before allocating your FBO. I think that you may be able to give an ofFbo and external texture that you allocate yourself.

The issue is that OF uses ARB textures by default

jvcleave commented 8 years ago

Here's how you have to do it

    ofFbo::Settings fboSettings;
    fboSettings.width = videoPlayer.getWidth();
    fboSettings.height = videoPlayer.getHeight();
    fboSettings.internalformat = GL_RGBA;
    fboSettings.textureTarget = GL_TEXTURE_2D;
    videoFBO.allocate(fboSettings);
    videoButtonID = videoFBO.getTexture().texData.textureID;
o2co2 commented 8 years ago

Thank you @jvcleave