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

Pages: 1 2 3 [4] 5 6 ... 34
General discussions / Re: What physics engine to use?
« on: April 13, 2013, 12:39:44 am »
The havoc physics engine has long been a favorite also, I would give that a look.
Except it's commercial, incredibly overpowered for anything 2D, and known for having some pretty bad bugs.

Graphics / Re: Origin after sub rect
« on: April 12, 2013, 01:51:02 am »
Also why are you interested in knowing what SFML 1.6 does, if you're already using SFML 2?

SFML 1.6 is easier (for me) when I port to other platforms (like Windows). It also shows where my library has holes in abstracting the graphic/audio/input systems. I'm really liking SFML 2.0, so when it is released I'll probably slowly abandon 1.6

Thanks for the fast answers.
SFML2 is technically done. All that remains is for Laurent to finish updating the website. I highly recommend switching to SFML2 now, as SFML 1.6 and prior have some severe and fatal bugs (e.g. the ATi bug) that have been resolved in SFML2.

General / Re: Implement Timestep and Gravity
« on: April 12, 2013, 01:48:52 am »
Like I said, we need a COMPLETE and MINIMAL copy of your code that reproduces the problem if you want us to help more. When I say complete, I mean it must be enough that we can compile it. By minimal, I mean it needs to be a single source file with everything except for the bare minimum to see the bug in action delete.

General / Re: Implement Timestep and Gravity
« on: April 12, 2013, 01:21:30 am »
There are MANY problems with your code.

First of all, you use an if statement when polling for events. This is very bad, as it will only catch one event, and other events will end up in the backlog. You REALLY should use a while loop instead.

Secondly, you're only moving the character if you pick up a KeyPressed event. Unless you have KeyRepeat enabled (and I recommend against using that as a solution), this will only move your character once at the first frame that the key is pressed. Your character won't continue moving, even if you hold the key down. What you should do instead is use sf::Keyboard to check the real-time state of each key.

Third, you aren't displaying the window at all. So how are you supposed to tell how the character is moving?

Fourth, you're putting all of the game logic inside the event loop. This is a TERRIBLE idea, as it means that the game won't update until it receives an event from somewhere.

Fifth, if you want us to help you further, provide a COMPLETE and MINIMAL copy of your code that reproduces your issues.

General discussions / Re: A new logo for SFML
« on: April 11, 2013, 08:33:14 am »
I like 3, 4, and 10 the best. And I agree with Laurent, moving the power icon to the left may be better.

General / Re: Loading fonts to a custom surface?
« on: April 10, 2013, 12:26:00 am »
I didn't know I had an inherent ability to tell the future :P.
You jinxed it. You monster.

General / Re: Why can't I use static libs for SFML on Linux?
« on: April 07, 2013, 11:18:41 pm »
When you link statically, the static libs can't be linked to other libs. Dynamic libs can be linked to other libs, though. If you want to link to SFML statically, you need to link to all of SFML's dependencies as well. So just link to OpenGL and you should be fine.

General discussions / Re: SFML 2.0 tagged in repository
« on: April 07, 2013, 03:33:27 am »
As much as I want to ask for a guestimate timeframe for the 2.0 release, I won't (because the answer is always "it's done when it's done").

I do, however, want to ask about how much work is left. If I recall correctly, you said the tutorials are all done, and now that the code is done, I assume the only thing left is the website. About how much of the website is done vs how much of it is not finished?

Also, I'm excited :)
He said on github that the website is mostly done and will be released this month. Here's to hoping he doesn't get hit by Hofstadter's Law.

Hm, I don't know what player.h is, so im guessing

maybe, just maybe, its because 2.f is a small number, so you can't see the difference, try 20 for example
No, 2.f is two whole pixels, and this is per frame, from what I can tell, so that's not it.

Can you post a complete and minimal code that reproduces the problem so we can compile it and test it ourselves?


That's the full works right now, all you need to do is copy and paste them into the corresponding file names and it should compile.

EDIT: Oops, forgot to add my ImageManager, it's all functional now.
That is DEFINITELY not minimal. Minimal means cut out every single line of code that isn't relevant to the problem, and put it all into a SINGLE file. Preferably put it all into main() as well. For this problem, you definitely don't need all those classes to reproduce the problem.

I do, however, see what is most likely the cause of your problem. In Engine::ProcessInput(), you have these lines
                if(Event.type == sf::Event::Closed)
The problem here is that you say if(window->pollEvent(Event)). That won't work. That will only catch one event per frame, meaning any other events will get "backlogged" and not make it to the game for a long time. Since the keyboard state is updated by pollEvent, that means that your if statements won't know that the keyboard has been pressed until the keypress events get out of the backlog. If you want to fix this, you just need to change the if(window->pollEvent(Event)) to while(window->pollEvent(Event)).

Hm, I don't know what player.h is, so im guessing

maybe, just maybe, its because 2.f is a small number, so you can't see the difference, try 20 for example
No, 2.f is two whole pixels, and this is per frame, from what I can tell, so that's not it.

Can you post a complete and minimal code that reproduces the problem so we can compile it and test it ourselves?

People say not to use 'New' or 'Delete' but ...
This confuses me, why would you not use Dynamic Memory?
Because it's very dangerous and easy to screw up, and should be held off until you're comfortable with the language. Not to mention, newbies have a tendency to use new and delete everywhere they possibly can, when 99% of the time you either don't need it or are doing it wrong.

Graphics / Re: Bug in sf::RenderTexture
« on: March 25, 2013, 02:41:46 am »
If you mean delete NULL; it's alright.
In C++, the definition of NULL is 0
deleting a zero pointer is harmless by definition

Huh, I didn't know that. But wasn't the point of creating the nullptr keyword in C++11 was because NULL (thus, 0) could be a valid pointer address on some obscure cases and obscure compilers? (for example, pointer to the first virtual method in a vtable, because pointer addresses can be relatives).
No, I thought it was because letting 0 be null would leave ambiguities over whether 0 should be an integer or a pointer in certain situations, e.g.  a function has two overloads, one where you can pass a pointer, and the other where you can pass an integer.

General discussions / Re: A new logo for SFML
« on: March 24, 2013, 11:44:31 pm »
Well, it's always difficult to create a new logo but there is a greate rule that always works for those kind of things : "Less is more". The best idea is usually the simplest one, so I have just give it a try in order to give new materials to work with.

I'm a bit late to the party, but I absolutely LOVE this one. It's simple, the font looks nice, there isn't so many colours that it's distracting, but there  also isn't so few colours that it's boring. I like the idea of the pentagon representing the 5 modules, and overall this works really well.

SFML projects / Re: Terra Game Engine
« on: March 23, 2013, 08:45:53 pm »
Man, what timing. Unfortunately, I went through a phase of severe depression over the last couple years, with all of my projects dying in the process. I can confirm that I'm doing much better now and working on a similar project to replace this one (since everything was lost), but it's nowhere near ready for release.

General / Re: I can't setup SFML 2.0
« on: November 06, 2012, 07:20:52 am »
Well first of all, why are you using Winmain? Just use main, Winmain isn't portable or standards compliant.

The problem is that you aren't linking to sfml-graphics or sfml-window.

Pages: 1 2 3 [4] 5 6 ... 34