Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mr.ao

Pages: [1]
1
sorry @eXpl0it3r, My description was not enough!
I think my Opengl context is differ from sf::RenderTexture and I can not bind sf::Texture of RenderTexture to my mesh.

I maked a program for drawing mesh in video every frame in Qt by Opengl,  I binded texure and draw mesh correctly, but when I change texture (with SFML::Texture in above code), it didn't work.(I didn't use from sf::window and ...)

2
I want to draw my mesh by using  texture of SFML without using from (sf::window ,sf::Renderwindow....)
    sf::RenderTexture renderTexture;
    renderTexture.create(800,600);
    renderTexture.clear(sf::Color::Blue);

    sf::Text text;
    // select the font
    sf::Font font;
    if (!font.loadFromFile("BNazanin.ttf"))
    {
        // error...
    }
    text.setFont(font); // font is a sf::Font
    // set the string to display
    text.setString("hello");
    // set the character size
    text.setCharacterSize(40); // in pixels, not points!
    // set the color
    text.setColor(sf::Color::Red);
    // set the text style
    text.setStyle(sf::Text::Bold | sf::Text::Underlined);

    renderTexture.draw(text); // or any other drawable
    renderTexture.display();

    //renderTexture.getTexture().copyToImage().saveToFile("test.png");
    const sf::Texture& texture = renderTexture.getTexture()

   sf::Texture::bind(&texture);

  _shaderProgram->bind();
  _shaderProgram->setUniformValue("modelInWorldMatrix", _model2WorldMatrix);
  glFlush();
  QOpenGLContext::currentContext()->functions()->glDrawArrays(_mode, startVertex, std::min(vertexCount, verticesCount()));;

it save texture correctly, but when i use binded texture for drawing my mesh in Qt Scene, it Doesn't work!

Pages: [1]