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

Author Topic: is it possible to subtract a texture from an other  (Read 15335 times)

0 Members and 1 Guest are viewing this topic.

grimmreefer

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • Email
Re: is it possible to subtract a texture from an other
« Reply #30 on: September 22, 2012, 10:40:25 pm »
 YES YES YES, i made it YES YES YES 8)


Edit:

it still works, but at 5 lights the performance is terrible
« Last Edit: September 23, 2012, 08:21:34 pm by grimmreefer »

grimmreefer

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • Email
Re: is it possible to subtract a texture from an other
« Reply #31 on: September 24, 2012, 12:54:39 pm »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: is it possible to subtract a texture from an other
« Reply #32 on: September 24, 2012, 12:59:48 pm »
I don't see where there are multiple 'lights' but congrats! ;)
Btw it crashes at exit on my PC.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

grimmreefer

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • Email
Re: is it possible to subtract a texture from an other
« Reply #33 on: September 24, 2012, 01:09:28 pm »
Sorry, with T you can add a torchlight.


EDIT:

This funktion is the problem, maybe someone have a idea how i can fix this.


Code: [Select]
void CLights::SyncLightPosition(int PosX, int PosY)
{
    for(int i = 0; i < m_VectorShape.size(); i++)
    {
        m_RTex.clear();
        m_VectorShape[0].setPosition(PosX, PosY);
            for(int i = 0; i < m_VectorShape.size(); i++)
            {
                m_RTex.draw(m_VectorShape[i], sf::BlendNone);
            }

    }
}

« Last Edit: September 24, 2012, 04:48:32 pm by grimmreefer »

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: is it possible to subtract a texture from an other
« Reply #34 on: September 24, 2012, 05:30:40 pm »
void CLights::SyncLightPosition(int PosX, int PosY)
{
        m_RTex.clear();
        m_VectorShape[0].setPosition(PosX, PosY);
            for(int i = 0; i < m_VectorShape.size(); i++)
            {
                m_RTex.draw(m_VectorShape[i], sf::BlendNone);
            }
m_RTex.display();
}
 
Back to C++ gamedev with SFML in May 2023

grimmreefer

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • Email
Re: is it possible to subtract a texture from an other
« Reply #35 on: September 24, 2012, 05:39:15 pm »
as i used one for loop it doesn't work, but now is works fine, 40 lights and still playable.


thank you guys!

 

anything