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 - Tex Killer

Pages: 1 ... 3 4 [5] 6 7 ... 17
61
Graphics / Polygonal views
« on: December 04, 2012, 01:59:46 am »
Hi

What I want to do is a view with the shape of a polygon, so that I can cut the screen however I'd like with as many cameras I'd like (mainly for split-screen multiplayer games, but does have other uses).

I think there is currently no clean way to do this. I know I can create a RenderTexture, draw on it, then draw a vertex array using the texture, but having a better way to do this would be good.

From what I've seen, I think there is an issue on the tracker for "clipping masks" that would solve this. Is that right? What is the status on that?

Thank you very much.

62
Graphics / Re: sfml view issue
« on: September 11, 2012, 07:41:42 am »
You have to rotate the sprite and draw it rotated on some texture... Then you put that texture on a sprite, scale it and draw it scaled on the screen.

63
Graphics / Re: Trouble adding spacing and margin to Tiled map loader
« on: September 09, 2012, 07:40:57 pm »
I think your width and height calculations are wrong, but try this:

//Columns and rows (of tileset image)
    int columns = (tilesetTexture.getSize().x - margin) / tileWidth;
    int rows = (tilesetTexture.getSize().y - margin) / tileHeight;

    std::vector <sf::Rect<int> > subRects;//container of subrects (to divide the tilesheet image up)

    //tiles/subrects are counted from 0, left to right, top to bottom
    for (int y = 0; y < rows; y++)
    {
        for (int x = 0; x < columns; x++)
        {
            sf::Rect <int> rect;
            rect.top = margin + y * tileHeight + space;
            rect.height = tileHeight - 2 * space;
            rect.left = margin + x * tileWidth + space;
            rect.width = tileWidth - 2 * space;
            subRects.push_back(rect);
        }
    }
 

I've assumed you had margin and space variables.

64
Window / Re: Low FPS
« on: August 08, 2012, 05:49:12 am »
Is framerate limiting enabled? Is vertical sync enabled?

65
According to the documentation, there is no constructor taking an sf::Image argument.
There is, however, a constructor taking a sf::Texture argument, and you can load a texture just like an image.

Read the examples on that page.

66
Audio / Re: Listener rotation
« on: May 23, 2012, 09:24:38 pm »
Laurent, I think the solution you proposed would not solve the problem in hand.



If I understood correctly, you proposed something like the left scheme, but what would be correct is the right scheme.

The Y axis would be rendered correctly, but the X axis would be mistanken for "front/back" instead of "up/down". In other words, the listener would not be facing the floor of the game, as the view is.

For example, the S1 sound would be in front instead of up, and the S2 sound would be in the back instead of down.

67
Audio / Re: Listener rotation
« on: May 23, 2012, 11:04:32 am »
Hi Laurent

I'm not the question author, but I think I understand what he meant.

Lets say the view is rotated 90 degrees clockwise. That means that what is on negative Y (relative to the listener position) should come out from the right speaker, and what is on positive Y should come out from the left speaker.

The direction of the listener remains the same as the default, but it is rotated. An angle can be used to make a direction, but the other way around misses some data.

Or, of course, I may have missunderstood the whole cenario, and all I'm saying is non-sense.

68
Graphics / Re: 'class sf::Window' has no member named 'Member' error
« on: April 08, 2012, 07:08:29 am »
Ok, glad you solved your problem.

69
Graphics / Re: 'class sf::Window' has no member named 'Member' error
« on: April 08, 2012, 06:28:56 am »
You are probably using a recent SFML2, wich name convention changed to camelCase for member functions.

Display, for example, should now be display, and IsOpened changed to isOpen.

For precise information, read the documentation:
http://www.sfml-dev.org/documentation/2.0/classsf_1_1RenderWindow.php

70
General / [SOLVED] cannot compile; no match for operators '<' and '
« on: March 17, 2012, 08:32:32 am »
I see you are using the current SFML 2 release. Recently the getElapsedTime was changed, and its return is now a sf::Time variable. If you want to do math with it, first call .asSeconds(), .asMilliseconds() or .asMicroseconds().

The sleep function was also altered so that it receive a sf::Time object as parameter, instead of float.

I think you want something like this:

Code: [Select]
#include<SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while(Clock.getElapsedTime().asSeconds() < 5.f)
    {
        std::cout << Clock.getElapsedTime().asSeconds() << std::endl;
        sf::sleep(sf::seconds(0.5f));
    }

    return 0;
}

71
General / SFML app does nothing
« on: March 15, 2012, 05:27:32 am »
The ATI problem only happens with SFML 1.6.
If you are using SFML 2 you should not have to worry about it.

72
General / SFML app does nothing
« on: March 15, 2012, 03:40:44 am »
You must use binaries made with Visual Studio 2010 if you are also using it. There are some user-compiled binaries on the forum, and some information on how to compile SFML yourself as well. Just search a little.

Also pay attention to what Zephilinox posted.

73
General / How to manage different screens?
« on: March 13, 2012, 04:36:22 am »
You can control the time (with sf::Clock) and then decide on what to print based on that. You can also control input events and use them to manage the menu options.

If you want something automatic, you should search for a game engine instead.

74
General discussions / Do you use C++11?
« on: March 10, 2012, 04:35:23 pm »
No, and I intend to stick with C programming. Gives lower level control.

75
Audio / Increasing Sound::GetPlayingOffset() precision
« on: March 10, 2012, 03:12:49 pm »
As far as I know, the current playing offset is updated at each audio buffer fill.

The buffer is refilled each time it runs out, so it is not constant, and that should be why the playing offset is jumping like that.

Pages: 1 ... 3 4 [5] 6 7 ... 17
anything