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

Pages: 1 ... 13 14 [15] 16 17
211
Graphics / Re: [C++ and SFML 2.1] Scrolling backgrounds ( y+)
« on: November 09, 2013, 07:56:26 pm »
If you set the texture to repeating its as if there would be copies of it all around it until infinity. So you should be able to set a texture rectangle(x,y,800,600) for your texture of size 800x600 in the sprite of size 800x600, where x,y is the position inside the texture you want to show at screen position 0,0 and it should fill the whole screen. At least thats how it works in OpenGL and SFML would most likely translate this appropriately without imposing more constraints.

212
Graphics / Re: [C++ and SFML 2.1] Scrolling backgrounds ( y+)
« on: November 09, 2013, 06:17:32 pm »
Why dont you set the texture to be repeated? Then you should be able to only move the texture rectangle and draw a single fullscreen object.

213
General / Re: AABB Collision Detection - Checking which side
« on: November 09, 2013, 11:02:40 am »
Testing all tiles in the whole world for a collision sounds like an extremely contrived way to find coordinates of the player sprite. Why dont you check only the tiles positioned on the way from the old position to the possible new position, whether they are walkable?

214
Window / WaitEvent sleeping a bit too often
« on: November 03, 2013, 11:50:19 pm »
When looking through the SFML code I found it is always doing a sleep on waitEvent when the SFML queue is empty, even if process(Joystick)Events can get fresh events from the OS at first try.
Wouldn't it be better to restructure this code from WindowImpl.cpp
bool WindowImpl::popEvent(Event& event, bool block)
{
    // If the event queue is empty, let's first check if new events are available from the OS
    if (m_events.empty())
    {
        if (!block)
        {
            // Non-blocking mode: process events and continue
            processJoystickEvents();
            processEvents();
        }
        else
        {
            // Blocking mode: process events until one is triggered

            // Here we use a manual wait loop instead of the optimized
            // wait-event provided by the OS, so that we don't skip joystick
            // events (which require polling)
            while (m_events.empty())
            {
                processJoystickEvents();
                processEvents();
                sleep(milliseconds(10));
            }
        }
    }

    // Pop the first event of the queue, if it is not empty
    if (!m_events.empty())
    {
        event = m_events.front();
        m_events.pop();

        return true;
    }

    return false;
}
 
a bit, to get this where it does a first try always?
bool WindowImpl::popEvent(Event& event, bool block)
{
    // If the event queue is empty, let's first check if new events are available from the OS
    if (m_events.empty())
    {
        processJoystickEvents();
        processEvents();

        if (!block)
        {
            // Non-blocking mode: stop if no events found
            if (m_events.empty())
                return false;
        }
        else
        {
            // Blocking mode: process events until one is triggered

            // Here we use a manual wait loop instead of the optimized
            // wait-event provided by the OS, so that we don't skip joystick
            // events (which require polling)
            while (m_events.empty())
            {
                sleep(milliseconds(10));
                processJoystickEvents();
                processEvents();
            }
        }
    }

    // Pop the first event of the queue
    event = m_events.front();
    m_events.pop();

    return true;
}
 

215
Graphics / Re: [SFFont] Valgrind is not happy when loading fonts from file
« on: November 03, 2013, 10:03:24 pm »
The solution would be to not access everything from everywhere. If you structure your program in a tree-like way that shouldn't be difficult.
Then if you really need something at a second place put it inside a function parameter.

The good thing about unique_ptr is you just create something and it automatically destroys it when the scope ends, without you remembering, and is automatically exception safe. If really needed, you can still return it and it safely allows to give away responsibility of a pointer, without you worrying the user of the function may ignore the return value, because it then destroys it.

216
Graphics / Re: sf::Font - Multiple colors
« on: November 03, 2013, 01:49:13 am »
I would think making a colored image containing all characters you need and then using it like a sprite sheet, is far easier than fiddling with creation of suitable font files to enable shoehorning colors in by making 2-part-characters you draw over each other.

217
Graphics / Re: Is clear() that necessary?
« on: November 01, 2013, 02:12:19 pm »
Yeah, the clear call may be optimized in many gpu to not do that equivalent of memset of gpu-memory you assume but just set a few bits to indicate its cleared. That means you wont get a performance win.

The bigger problem is there can be quirks in some gpu/drivers you wont imagine. For example I read there may be a few gpu doing tiled drawing(especially on mobile), where they first do all vertex processing for new data, then write all data of the frame back into memory by appending it to some kind of internal queue, then repeatedly do fragment processing for everything inside that queue for all screen tiles. When the clear call is done it would also empty that queue, but if you never call it that queue may get longer and longer keeping all the old data from previous frames...

218
General / Re: rbSFML
« on: October 31, 2013, 04:20:45 pm »
I just wanted to say thank you again. I noticed the vertex array didn't want to accept changes to its data after appending to it (I guess thats one of those shortcomings you mentioned), but I managed to work around it so its all well. :)

219
SFML projects / Re: Winter-Pong
« on: October 31, 2013, 03:53:25 pm »
I packaged a new version of my game, where I added a new power-up and animated snow.
You can get it from https://www.dropbox.com/s/rc08imb7d7mltlr/winter-pong-1.0.zip.

Installation is the same as described above. If you installed Ruby and the rbSFML gem already for trying the older version you only need to unzip and start the game.

I'll be happy if you try it out and tell me how you like it. ;)

220
Audio / Re: Question on how audio is stored in SoundBuffer
« on: October 31, 2013, 02:45:33 pm »
You could calculate the Fourier-Transform and look at the data in frequency form.

221
SFML projects / Re: Winter-Pong
« on: October 31, 2013, 12:15:14 am »
Yes, its Pong. I was hoping people get curious about the extras I wrote about and just try it. :P

Ok, it got menu screens, intro, sound, music, power-ups; I made images with inkscape for the different things in the game. ;)

There is a screen of an old version without the new things: http://www.gamedev.net/topic/648431-putt-updates-and-finals-thread/page-2#entry5103151

222
SFML projects / Winter-Pong
« on: October 30, 2013, 04:59:54 pm »
I think I mentioned already that I'm making a little game to learn Ruby.
Its a Pong game with a few extras and I'll use it for a contest on GameDev. The contest-deadline is approaching(about a day left) and I only got notice of a single person who wanted to try it out, but not if it runs now.
This makes me incredibly nervous as I dont want to get into the situation where the game only runs on my computer and some small quirk prevents it to run on others.
Please, try it out and be so kind as to give a reply. Even something simple like: "I tried it on ... OS with Ruby version ... and it runs/runs not/runs only with additionally having the DevKit installed, because ... ."

For installation on Windows get Ruby 1.9.3 from http://rubyinstaller.org/ and install it in a dir without spaces with the extra options enabled to let it make file associations and add it to the path.
Unpack the game package you can dl from https://www.dropbox.com/s/g7ykbg55jj4w4vn/winter-pong-0.3.zip somewhere, start install-rbSFML.bat from that directory, double click one of the two .rbw files.
The game should run on other OS, but its untested and more involved, having to compile your own version of rbSFML and possibly SFML. Detailed instructions are inside the package.

This is a preview version, I plan on doing an update soon to add/improve a few more things.

223
General / Re: Fixed time-step game loop and rendering
« on: October 27, 2013, 01:01:15 am »
You could just return a bool, without directly calling the close method of the window, save it in a local variable and then use that information to get out of the loop.

224
General discussions / Re: Moderation reports
« on: October 26, 2013, 03:15:06 pm »
Maybe you can let the forum disallow new threads with the stupid title "I am the new one", because there is another of these spams already. :P

225
Graphics / Re: Fonts best qualitity?
« on: October 26, 2013, 11:52:05 am »
I dont understand the question either.
I see though that you are using a Sasquatch sprite ripped from Ragnarok Online and you are probably aware this is illegal?

Pages: 1 ... 13 14 [15] 16 17
anything