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

Pages: [1]
1
Hello,

I played around with my graphics drivers and did an entire system update on everything, still this is a problem for me. My graphics card is ATI Radeon HD 5670 and I'm using Code::Blocks

However, I found something very interesting. If I use a win32 GUI project, and copy the code to a new project, and all the resources, then it would fix the problem on the first try building and running the project, but if I run the compiled release .exe file in my bin folder, then it would break it. Compiling it again under SFML would fix it again.

This issue isn't as much of a problem using a console application project, but it still happens.

Sometimes it's broken to the point where even compiling it again would not fix it, but then all I need to do is make a new project with the same code and resources and it would work again.


I'm a beginner programmer so I really don't know what's going on here and how I can fix it. Does anyone know anything about this issue? If not, does anyone know where I can go to seek help on this issue? Thank you very much for your help.

EDIT: I've noticed that the issue tends to appear more often if I go watch videos online or something. For example, the program will run fine, but if I go and watch a youtube video, then come back and run the same exe file again, it would have FPS issues, and it won't be fixed until I make a new project and recompile it again. I have no clue what to do or even who to ask to solve this issue.


EDIT #2: Something else I realized, when it doesn't work (FPS issue present), then when I quit my program, it would not return 0. When it works fine, it returns 0 when I quit. When the FPS issue is present, main() returns something like -2147418113 <0x8000FFFF>, does that mean anything? Thanks again.

2
Alright I will play around with my driver settings. Thank you very much for your help!

3
Hmm should I be attempting to change my graphics driver settings then in that case?

4
If I delete vertical sync, it still would not change anything. If I delete frame rate limit, then there would be no limit and FPS will be around 1000. I read on some of the forums that the way to fix it would be activating vertical sync in addition to limiting frames?

EDIT: Example of supposed solution: http://www.gamedev.net/topic/567471-sfml-setframelimit-not-limiting-frame-rate/

5
Hmm okay, how should I do it then so that it would work? I'm not too familiar with how they should be activated. Thanks!

6
Hello Laurent,

Not to my surprise, I ended up recreating the problem with minimal code, the results are pretty daunting:

#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <iostream>
#include <sstream>

int main()
{
    sf::Clock clock;
    sf::RenderWindow App(sf::VideoMode(1280, 800, 32), "window");
    App.setFramerateLimit(60);
    App.setVerticalSyncEnabled(true);

    //Intro Resources



//Important global variables

//Menu sequence variables

//Game sequence variables

//Text data
int timer =0;
int frames =0;
//GAME STARTS
    while (App.isOpen())
    {
        if (clock.getElapsedTime().asSeconds() >= .5)
        {
            std::cout<<frames*2<< "\n";
            frames=0;
            clock.restart();
        }

        App.clear();
        sf::Event Event;

        if (App.pollEvent(Event))
        {
            if (Event.type == sf::Event::Closed)
                App.close();
        }
        frames++;
        App.display();
    }

    return 0;
}
 

It basically is a "hello world" program for SFML, it makes a render window, and nothing else. The frames don't spike to 100s, but it stays around 50s much like what the old broken program did when idle. Here's an output of FPS:

http://i.imgur.com/VkqRJ.jpg

Capped at 60 it should return something like 63ish from experience, and without the limit it goes to the 1000s so I know it's not a hardware issue.

Like I said, this issue comes and goes, it's quite unstable and I'm really not sure what's going on anymore. using the same exact code in another project, it would work fine.

7
Hello Laurent,

I tried to recreate the problem using minimal code, but I cannot. The problem at first glance seems to go away as I delete away parts of the irrelevant code (which doesn't make any sense to me). Here's a brief description of how the program works:


Quote
Within main:
start render window, set options, etc.

int z =0
while renderwindow is open
{


if z = 0
{... draw stuff
}
else if z = 1
{... draw other stuff
}

......

else if z = 360
{...
}

render window display
}

the entire program is a linear sequence of events, labeled by integer z. Once an event is finished, z++, so the next event will start. There's a total of around 8200 lines of code and around 360 events. As a test I deleted all the events except for the first 3 (so z only goes to 2), now it has around 1200 lines of code, and the FPS stabilized at around 65.

Perhaps this is a programming issue unrelated to SFML, but I feel like changing the code there, which was unused in testing in the first place, should not have affected anything. I literally just deleted parts of the code that wasn't even used and the problem seemed to go away.

Also, like earlier, the problem seems to come and go. Sometimes it just fixes itself for no reason and breaks again later. This also may be one of those occurrences.

Sorry for being vague. It's still definitely broken when all put together. I will read over my code again (I already have several times), I don't think I will find anything new however. Thanks for the fast reply and please let me know if you have any idea what might be causing this. Thank you!


EDIT: I kept trying new things to get it to work, here's the funny part. I literally just made a new project, copy pasted all the code and resource files over, and it seems to work perfectly stable now at around 63 FPS. However I'm afraid to make any changes to the code since usually it would end up breaking it irreversibly. Perhaps this sheds some light to the real problem at hand?

8
Graphics / Set Frame Rate Limit Not Working Even With Vertsync On
« on: May 24, 2012, 04:28:43 am »
Hi,

I've encountered a problem recently which sounds like a common problem with SFML. My frame rate limit is set at 60, but the FPS is usually around ~50, but sometimes jumps to ~100. Without the framerate limit it can go as high as 2000 so I'm sure it's not hardware limitations.

I did some searching and it seems like turning vertical sync to true would usually fix the issue, however the problem is I already did that. The more amazing part is that sometimes it works and sometimes it doesn't. I would move my code

App.setVerticalSyncEnabled(true);
App.setFramerateLimit(60);

around and almost randomly it would work again in different spots of the code, but if I change parts of the code then it would stop working again. The weird part is if I undo the changes I made to break the code, it would remain broken, even if it worked earlier.

I thought it may have been outdated SFML issue, so I went ahead and got the sfml 2 RC and the issue is still present. I'm running out of ideas on how to fix this.

Anything would help me at this point, I am finalizing a large project and months of work right now. Thank you very much for your time!

EDIT: Here's a sample output of FPS that I get.

http://i.imgur.com/R5ZmP.jpg

The way I calculated FPS was to count an integer every frame, and when clock as seconds = .5, then take that number and double that number to get the FPS, then reset it for the next round. It basically calculates the frames per .5 seconds, then double it. Should be fairly accurate, shouldn't be off by too much anyways.

9
Thank you for the reply! I went ahead and manually bolded the font used instead to perform a workaround.

Cheers!

10
Graphics / Help - Bold Text Appearing with Artifacts - Possible Bug?
« on: April 09, 2012, 07:01:29 am »
Hello,

I've been working hard on an issue and I think I've encountered what seems like a bug.

When I'm bolding the text in SFML, everything looks fine to me (1680x 1050 resolution), and every other resolution I tested on. However, friends of mine with 1366 x 768 resolutions encountered bugs of text displaying random artifacts on screen.

I went through all my view/renderwindow code and nothing suggests that this was a code issue. Everything looked to work fine on everything except the specific resolution.

Examples:

SS 1 Bad: http://i.imgur.com/PXimZ.jpg
SS 1 Good: http://i.imgur.com/MkIpv.jpg
SS 2 Bad: http://i.imgur.com/XRzAC.png
SS 2 Good: http://i.imgur.com/dwxBT.png


Can someone please help me with this issue? The issue goes away as soon as Bold is turned off, so it must be part of that. Thank you very much for your help!

11
Graphics / Re: Trouble understanding SFML 2 RectangleShape
« on: April 08, 2012, 03:54:45 am »
Update: I ended up building a workaround for this, just went ahead and wrote a function that took the necessary variables and built the rectangle that way.

12
Graphics / Trouble understanding SFML 2 RectangleShape
« on: April 08, 2012, 01:04:00 am »
Hi, I recently switched to sfml 2 and I've been having trouble understanding the rectangle shape. Did a lot of forum searches but not much came up.

Anyways, I'm trying to draw rectangles in an efficient way, one liner, setting the position and color. Originally, this is my code for sfml 1.6 was


App.Draw(sf::Shape::Rectangle(45, 45, 500, 160, sf::Color::Color(0,0,0,100)));


I was just wondering if that's still possible somehow in SFML 2.

Thanks!

EDIT: forgot to mention, yeah I've looked at the documentation and everything. The vector construction part was very confusing and I'm kind of a beginner.

Pages: [1]
anything