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

Pages: 1 2 [3] 4 5
31
General / Re: Flickering
« on: June 06, 2015, 04:56:45 am »
That's because the event is generated when the key is pressed, and every few milliseconds (depending on the configuration of your operating system). They do not occur in all frames. You should use a bool to maintain the state of the key.

32
Window / Re: key press problems
« on: April 22, 2015, 06:36:18 am »
no problem  :)

33
Window / Re: key press problems
« on: April 22, 2015, 06:13:01 am »
The pollEvent function needs to receive a reference (or pointer) as parameter to modify.

For example:
pollEvent(sf::Event &TheEvent)

34
SFML projects / Re: Screenshot Thread
« on: January 05, 2015, 10:56:28 pm »
Here is the 2D game I'm doing.

(click to show/hide)

This is the map editor (will also have a tileset editor).

(click to show/hide)

I use SFML 2.1 (for now), Box2D 2.3, C++03 (without Boost), Visual C++ 2008 Express Edition on Windows XP SP3 on a monitor 17" (1024 x 768). Yes, I'm a masochist, a poor masochist :P

(click to show/hide)

35
Feature requests / Re: Detect if vsync is active
« on: July 20, 2014, 05:15:36 am »
I found this post in the forum. I do not know if you had seen: http://en.sfml-dev.org/forums/index.php?topic=12224.0

36
Feature requests / Re: Detect if vsync is active
« on: July 20, 2014, 05:06:18 am »
I know that if SFML can do, one would expect that the library does. The question is whether SFML can really do (and on all platforms). I have no idea if you can check if for example the video driver disabled the vertical sync. Or if there is a system function that allows to know the current state of vsync.

37
Feature requests / Re: Detect if vsync is active
« on: July 20, 2014, 04:33:07 am »
One way to know if Vsync is enabled is to calculate the number of frames that are drawn in, say, a second. Then you compare it to the amount that should be (refresh rate monitor).

The way I get the monitor refresh rate in Windows is with the code below:

DEVMODE lpDevMode;
memset(&lpDevMode, 0, sizeof(DEVMODE));
lpDevMode.dmSize = sizeof(DEVMODE);
lpDevMode.dmDriverExtra = 0;
if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &lpDevMode))
    rate = lpDevMode.dmDisplayFrequency;    // rate = refresh rate monitor

For Linux I have the following code, but I never tried:

Display *dpy = XOpenDisplay(NULL);
Window root = RootWindow(dpy, 0);
XRRScreenConfiguration *conf = XRRGetScreenInfo(dpy, root);
rate = static_cast<int>(XRRConfigCurrentRate(conf));
XCloseDisplay(dpy);

Unfortunately I could not find it for Mac.

38
Graphics / Re: Tile map to image for color masking/transparent tiles
« on: June 26, 2014, 06:17:52 pm »
If you want a simple editor, you can use Paint.NET (Windows). If you want something more complete, I recommend GIMP.

40
General / Re: How can you toggle something with pressing a key?
« on: March 13, 2014, 03:45:06 am »
Maybe you have a = 0 in the same loop.

In what way are you checking the value of a?

You can put the code here, it will be much easier to see the error.

41
Graphics / Re: Screen starts flickering when on fullscreen
« on: March 07, 2014, 02:27:17 am »
Interesting. I always used a View to maintain 1:1 ratio, with the maximum possible size, in full screen and with any window size.

Returning to the subject.
Question for those who know: There may be problems if you create and use a RenderTexture before creating a window?

42
Graphics / Re: Screen starts flickering when on fullscreen
« on: March 07, 2014, 01:33:06 am »
Does it make sense to use 64 as bpp? Seriously, I do not know.

sf::VideoMode(640, 480, 64)

43
General / Re: Lag when checking for collision in a top down shooter
« on: March 01, 2014, 10:56:03 pm »
You would have to pass Sprites by reference instead of copying.

44
Graphics / Re: Check if draw over something
« on: February 17, 2014, 04:27:31 am »
You have to use:
sprite.getGlobalBounds();

instead of:
sprite.getLocalBounds();

45
Window / Re: setFramerateLimit doesn't work
« on: February 09, 2014, 08:06:53 pm »

Pages: 1 2 [3] 4 5