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 - deathsangel

Pages: [1]
1
Graphics / I have two questions
« on: May 02, 2009, 05:06:08 am »
First is how do I pass the RenderWindow to a function.

For example I want to have a render function in my layer class

void render(Sprite& s, RenderWindow& rw)
{
rw.Draw(s);
}

how would I go about making that :?:
-----------------------------------------------------------------------------
The second question is how come when I change the image of the sprite, when I draw it, it appears white ?!?!??!

2
Graphics / Tile Engine
« on: April 29, 2009, 05:29:55 am »
Can somebody tell me how one would approach making a tile engine.
I used to use sdl so im used to being to just blit a surface.
Is this possible in sfml if so how do you do it?

example code from sdl
Code: [Select]

for (int r = 0; r < rows; r++)
{
    for (int c = 0; c < columns; c++)
    {
          SDL_Rect rect = {c * tileWidth, r * tileHeight, tileWidth, tileHeight}
         
          switch(map[r][c])
          {
                case 0:
                     break;
                case 1:
                     SDL_BlitSurface(tileImage, NULL, screen, &rect);
                      break;
          }
    }

}

So pretty much is it possible to recreate something similar in sfml.  Or if not what should I do?[/code]

Pages: [1]