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

Pages: [1]
1
General discussions / Any workaround for Lion OpenGL 3.2 Support?
« on: September 06, 2012, 05:45:20 am »
I read the thread about Laurent eventually removing deprecated functions from the 2.x code.

This is the thread started about a year ago on github: https://github.com/SFML/SFML/issues/84

I was curious.

1. Are we any closer to being able to support OpenGL 3.2 on Mac OSX?
2. If not, is there any workaround? What if I just use SFML for Window creation. Does that still utilize deprecated functions?

Does anyone have OpenGL 3.2 running with SFML on a Mac?

Thanks and I apologize if I have misunderstood anything. I always try to do my research before posting.

Cheers!

2
General / Drawing 3D Geometry (Vertex Arrays/VBOs)
« on: July 19, 2012, 05:39:09 am »
Hi.

I am trying to figure out where SFML takes care of things and where it lets OpenGL do its own thing when it comes to 3D rendering. I guess I am curious as to the capabilities of using shaders I have written that render 3D geometry in SFML.

Does anyone have a code example of rendering geometry from arrays? Even a simple example will do the trick (like a single triangle). I guess my confusion stems from the fact I have only used shaders on sprites and images in SFML but not geometry.

Thank you. Sorry if my question is confusing. If anyone has some simple code in which shaders are used to render 3D geometry from arrays, that would help me greatly.

PixelMuffin

3
General / Two Mac Bugs - RC 2.0 and OSX 10.7.4
« on: July 16, 2012, 04:03:16 am »
Hi. I'd like to report two bugs I have noticed.

1. Oddly, my game/menu when in fullscreen on OSX, the entire screen if shifted upwards by about a third making the top of the screen non viewable.

2. The first time I play a sound, there is often a crack/half sound/no sound at all. When it is used again, it plays fine. The sound is in .ogg format.

Please let me know if I can be more specific or if these are known bugs.

Thank!

4
Window / setFramerateLimit causes major stuttering
« on: July 16, 2012, 02:46:35 am »
I know there are other threads about this but I haven't found it resolved at all.

Ideally, I would like the game not to use 100% of its allotted CPU budget so that's why I would like to limit the FPS to 60. Doing so however cause a ton of stuttering where the object will stall and hang. It's very minor but obvious. How do big companies get away with completely smooth rendering? Have any of you found a way to make it incredibly smooth.

Here is a VERY simple example that stutters on the latest Mac OSX 10.7.4.

Let me know how it runs for you and what system you are on.

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

int main()
{
    sf::RenderWindow window( sf::VideoMode( 800, 600 ), "Test" );
    window.setVerticalSyncEnabled( true );
    window.setFramerateLimit(60);
   
    sf::Vector2f player1(380, 280);
    sf::RectangleShape paddle1(sf::Vector2f(40, 40));
   
    sf::Clock clock;
    sf::Time time;
   
    float dt = 0;
    const int speed = 100;
   
    // Start the game loop
    while (window.isOpen())
    {       
       
        // Poll for events
        sf::Event event;
        while (window.pollEvent(event))
        {
            // Close window : exit
            if (event.type == sf::Event::Closed)
                window.close();
           
            // Escape pressed : exit
            if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape)
                window.close();
        }
       
       
        // Check for user input
        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
            player1.y += speed * dt;
       
       
        // Check for user input
        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
            player1.y -= speed * dt;
       
       
        // Restart the clock and get the delta time
        time = clock.restart();
        dt = time.asSeconds();
       
       
        // Update the object positions
        paddle1.setPosition(player1.x, player1.y);
       
        // Clear screen
        window.clear();
       
        // Draw the sprites
        window.draw(paddle1);
       
        // Update the window
        window.display();
    }
   
    return EXIT_SUCCESS;
}

If we can get this fixed, that would be great. Let's pool information if we can.

Edit: Seems that this is fixed on Windows 7 by making it full screen. Going to full screen on OSX makes the screen shift up by 1/4-1/3. Not sure why. I still see the stuttering though.

5
Hi. I have a main function which creates all of the main objects in the game and the loop and then a render function. When I try to use functions I can use in my main loop window.draw(), window.clear() in my rendering function, they don't show up. Am I being an idiot here and have they been disabled/removed for a reason?

6
General / SFML 2.0 - Issue distributing builds to any other Macs
« on: July 13, 2012, 09:08:29 am »
Hi. I have seen a few other threads about this around but not for the latest version of Xcode (4.3.3) and the latest version of Mac OSX 10.7.4. I am using the RC 2.0 build on the SFML website. I can get it to build fine but when it comes time to send it to anyone else, I get something like this:



Now, the other threads I have found, like http://en.sfml-dev.org/forums/index.php?topic=7196.0, deal with different versions of Xcode and MacOSX. The person I am sending the build to is using the exact same version of OSX I am using.

So, taking apart the error, I can see the he doesn't have the library. I have tried creating projects with the frameworks option check and unchecked with no luck.

My other idea was to build SFML whereas I had simply installed it and used a template. But I am not sure what kind of difference that will make seeing as how it works great on this version of my OS.

For some reason, the library isn't being linked. Maybe I am being an idiot and forgot to check an option but I have looked in the .app bundle of my application and see all of the Frameworks included. I am at a loss here.

I tried to do my research before posting and genuinely was unable to find an answer so I hope this hasn't been answered exactly before.

Thank you for your time and again, you guys do fantastic work.

Cheers!

7
Graphics / SFML equivalent of SDL Blitting?
« on: July 10, 2012, 08:35:09 pm »
Hi. I am working on my first SFML project and I am trying to figure out how to create a sprite using an x, y, width and height source from a texture.

For my example, I am working on a menu system with text and I would rather not save 20 different individual text images. Is such an operation possible in SFML?

Thanks!

8
Window / Updating positions based on delta time
« on: July 06, 2012, 03:17:06 am »
Hi.

I just found out about SFML and have been developing games for a few years now. I absolutely love the API. One question however is regarding the apparent ability for SFML to handle most of the timing and updating groundwork. I am writing a simple pong clone all in one file in case I had trouble and am finding some oddities in the updating of the paddle locations. Here is the source for my main loop. I do enable vertical sync in the initialization phase.

 
  // Start the game loop
    while (window.isOpen())
    {    
        // Restart the clock and get the delta time
        time = clock.restart();
        float dt = time.asSeconds();
       
        // Poll for events
        sf::Event event;
        while (window.pollEvent(event))
        {
            // Close window : exit
            if (event.type == sf::Event::Closed)
                window.close();
           
            // Escape pressed : exit
            if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape)
                window.close();
           
            // Check for user input
            if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Down)
                player1.y += 10 * dt;

           
            // Check for user input
            if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Up)
                player1.y -= 10 * dt;
        }
   
        // Update the object positions
        paddle1.setPosition(player1.x, player1.y);
        paddle2.setPosition(player2.x, player2.y);
           
        // Clear screen
        window.clear();
           
        // Draw the sprites
        window.draw(background);
        window.draw(paddle1);
        window.draw(paddle2);
        window.draw(ball);
        window.draw(text);
       
        // Update the window
        window.display();
    }

 

It compiles fine but the paddle moves way too slowly. I tried multiplying the number by 1000, to where is got to a reasonable speed but it was jerky and not smooth. Has anyone dealt with this? I don't really need a super accurate fixed timestep loop. I should also add that my player1 and 2 are structs with a simple x and y float.

Thank you.

Pages: [1]
anything