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

Pages: [1]
1
This bit of code is helping me work around the issue.
Thanks!! I had the problem in my project too. After checking everything relevant, I could have sworn I didn't do anything wrong, then I found this thread. Your hack fixed the problem.

Guess I'll have to leave the hack in the code until the official 12.11 drivers has been out for at least a year or so.

2
General / Re: Drawing over previous drawing
« on: December 04, 2012, 11:49:11 pm »
Sure, http://www.sfml-dev.org/documentation/2.0/classsf_1_1Texture.php#ad3cceef238f7d5d2108a98dd38c17fc5
Thanks!! Haven't tested it yet, but from reading, it seems to do exactly what I want  :)

By the way, could this also be a solution to the problem, when you minimize the window and open it again, it's completely black? Just check for the minimize event (I only assume there is one triggered), and when it happens, store the screen to a texture. On restore (again, I assume there is an event for it), you immediately draw from this texture and update the window.

Can't you have a sf::Text of which you change the string when necessary?
I don't use fonts, I display characters from a .png sheet. And the number querying itself is done and ready (just 40 lines of code to do exactly what I want), so I'd rather not waste time changing how I do it. Thanks for your input anyway.

3
General / Drawing over previous drawing
« on: December 04, 2012, 10:44:26 pm »
Hello
In my game I have a function asking the player for number. I use it in the game's options menu among other things. It can look like this:
"PROJECTILE DELAY (ms) : 25"

And when you press return with this one selected, the player can modify this number, it should look like this:
"PROJECTILE DELAY (ms): 25_"

Where the "_" is the cursor for editing the number.

I recently switched from SDL to SFML 2.0, which I'm mostly very happy about. But I'm stuck on this function.
In SDL, the calling function first rendered its things (options menu), then called the number query function with parameters given for where to draw the number while its being typed. The query function simply drew the number over the background left from the calling function.

SFML's "philosophy" seems to be that everything should be drawn at once from a cleared screen. This gives me a problem here. The query function doesn't know anything about the background images.

One solution I see is to have the query function take a screen shot, using sf::RenderWindow::capture(). Saving that to a png file. Then load that to a texture, and render over that while the player edits the number. But it just seems... dumb somehow :P

How can I do this? What about my idea?

Can I capture the screen and use that for drawing directly, instead of having to save it to a file first?

4
Window / No "Colon" in sf::Keyboard::Key ?
« on: November 26, 2012, 07:39:36 pm »
As topic says.

Why is there a sf::Keyboard::SemiColon, but no sf::Keyboard::Colon?

Am I missing something?

5
Window / Re: Key repeat behavior
« on: November 23, 2012, 02:14:20 pm »
Next time, write the question down, instead of having it in mind ;)
I did write it down in my original post didn't I? I assumed this was clear enough:

Quote from: Me
I want the key repeat to behave just like when typing text in Windows and Linux, i.e. when user holds down a key, there is one "event" (letter typed/player character moves, or whatever), then a small delay before repeating starts.

The behavior is as you described in A).
Excellent.

6
Window / Re: Key repeat behavior
« on: November 23, 2012, 01:55:31 pm »
Yes, enabling/disabling key repeat is possible: sf::Window::setKeyRepeatEnabled()
Yeah but that doesn't answer my question. What I need to know is, is the behavior like this:

A) <User holds down key> - <one event> - <short delay> - <events repeating quickly>

-or like this:

B) <User holds down key> - <events repeating quickly>

By the way, begin with SFML 2 (either RC or GitHub revision), not an old SFML 1.x version.
Thanks, that was my plan :)

7
Window / Key repeat behavior
« on: November 23, 2012, 01:45:09 pm »
Hi
I have a game (Roguelike) that I'm considering migrating from SDL 1.2 to SFML. I've heard great things about SFML in general, and it seems to suit me perfectly. But there's one thing I'm concerned about that I can't find an answer to.

I want the key repeat to behave just like when typing text in Windows and Linux, i.e. when user holds down a key, there is one "event" (letter typed/player character moves, or whatever), then a small delay before repeating starts. In SDL this is controlled by "SDL_EnableKeyRepeat(int delay, int interval)".

I don't care so much about the specific delay or interval timings, but it's important for me that the behavior of it is such as I described above. I'm hoping I don't have to write my own code to handle this.

So how does it work in SFML? Happy for a fast response as I'm eager to try it! :D

Pages: [1]
anything