Giter Club home page Giter Club logo

Comments (6)

leadedge avatar leadedge commented on August 12, 2024

it appears from this code that "defaultFramebufferObject()" is an fbo rather than a texture.

There may be a texture attached to the fbo, but this will not work with the SendTexture function. I have not considered a function to take an fbo input but will think about it.

from spout2.

leadedge avatar leadedge commented on August 12, 2024

I am not familiar with QT, but it seems to me that you might need to create a texture and then load it from the framebuffer.

glBindTexture(GL_TEXTURE_2D, myTexture);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, width, height);
glBindTexture(GL_TEXTURE_2D, 0);

Then use that texture in SendTexture.

from spout2.

avilleret avatar avilleret commented on August 12, 2024

this is my mistake, I'm not familiar with OpenGL and I was thinking I can pass an FBO as a regular texture.
I'll try what you suggest asap.
Thanks

from spout2.

leadedge avatar leadedge commented on August 12, 2024

There is example code to create a texture in the Openframeworks sender example -

https://github.com/leadedge/Spout2/blob/master/SpoutSDK/Example/ofSpoutExample/src/ofSpoutSender/Graphics/ofApp.cpp

from spout2.

avilleret avatar avilleret commented on August 12, 2024

thanks again ! this works too !

here is the code I use :

  glBindTexture(GL_TEXTURE_2D, m_texture);
  glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, m_tex_width, m_tex_height);
  m_spoutSender.SendTexture(m_texture, GL_TEXTURE_2D, m_tex_width, m_tex_height);
  glBindTexture(GL_TEXTURE_2D, 0);

where m_texture is a GLuint created with the init function from Openframeworks example

from spout2.

leadedge avatar leadedge commented on August 12, 2024

That's good. This is resolved too. I looked at adding support for SendFbo or similar but it's probably not worth the complication.

from spout2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.