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.


Topics - boniomri

Pages: [1]
1
General / Importing shaders from shaderstoy
« on: January 08, 2016, 12:19:41 pm »
I have been trying to mess with shaders on my project recently and I encountered  afew problems.
Firstly I am a total noobie with shaders and sfml so excuse me if I state things that are wrong, I probably understood info I read incorrectly.

I saw there is a site called shaderstoy and I tried to figure out how to implement shaders from the site into my project. I read the sfml wiki about shaders, I got the SFML code part, although I'm not sure what to do on the shaders side.
What file to create with the code from the site, what parameters to pass etc.
For example this shader:
https://www.shadertoy.com/view/MsjXzh

How would one implement it and know what parameters to pass to it?

Again, sorry if I said stuff that made you cringe from my lack of knowledge in this department.
I just couldnt find lots of info regarding my question, I hope I was clear.

2
General / Point values of the edges of a sprite
« on: December 12, 2015, 02:23:12 pm »
I have a square shaped sprite that is sometimes rotated.
I want to get the x,y cords of all the edges of that certain sprite even when its rotated.
What is the best way to do so?

Illustration to show what I mean (32x32 square):
http://i.imgur.com/YweUiAT.png

3
I made an Object Layer in tiled with afew spawn points.
I have been trying to use this code to iterate through the spawn points but it dosent seem to work.

if (type.find("enemy") != std::string::npos)
        {
                for (auto layer = ml->GetLayers().begin(); layer != ml->GetLayers().end(); ++layer)
                {
                        if (layer->name == "spawns")
                        {
                                for (auto object = layer->objects.begin(); object != layer->objects.end(); ++object)
                                {
                                        std::unordered_map<std::string, Entity*>::const_iterator it = this->map.find(type);
                                        while (it != this->map.end())
                                        {
                                                if (it->second->getPosition() != object->GetPosition())
                                                {
                                                        e->setPosition(object->GetPosition());
                                                        return 1;
                                                }
                                        }
                                        return 0;
                                }
                                break;
                        }
                }
        }
It wont go inside the second for-loop for some reason.
This is the object group located in the tmx file:
 <objectgroup name="spawns">
  <object id="18" name="spawn" x="390" y="225"/>
  <object id="20" name="spawn" x="642" y="225"/>
  <object id="21" name="spawn" x="390" y="515"/>
  <object id="22" name="spawn" x="642" y="515"/>
 </objectgroup>
 

I thought since the collision code that he showed in his Github wiki page was pretty similliar with what I was trying to do, I'd use it for getting the spawn locations aswell.

Link to the git : https://github.com/fallahn/sfml-tmxloader

4
General / Help with Fallahn's tmx loader
« on: November 10, 2015, 02:27:31 pm »
Hey,
I have been experiencing problem when trying to use the tmx loader in my project.
If anyone could explain what I have to include/link to my project and what am I supposed to do with zlib, it'd be amazing!

That's the github link:
https://github.com/fallahn/sfml-tmxloader

Pages: [1]
anything