1
Network / Congratulations
« on: September 14, 2009, 08:02:10 pm »
Haha. we're on to Laurent :shock:
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.
Quotedoesn't print FPS because there are some Sleep call inside Display so you're not measuring the right among of time
GetFrameTime takes this in account. Otherwise it would be completely uselessQuoteI noticed when i use SetFramerateLimit(60) the FPS actually seems to be 30-32...
Do you have vertical synchronization enabled (in your display driver settings)?
Quote from: "Nexus"why are so many people using raw, possessing pointers inside STL containers even if they don't need it? That can be quite dangerous (regarding memory leaks, dangling pointers and those problems).
because there is no law how to code. i code how i want and i explicitly mentioned, that there is a option. pointers are just dangerous if you don't know what your are doing.Quote
Even for these cases, there are better alternatives like Boost's pointer containers
but thats another library, i dont want to use tons of libraries for things that are already thereQuote
Additionally, your code contains several other mistakes, for example copying noncopyable objects or using sizeof on types without parentheses. By the way: structs are classes.
read my lips: this is untested code, just to show the principle
why next time not try to answer his question instead of trying to force others program your way?
i am not interested in pure oo, as it makes everything slow, and 25 years of experience in game industry are my proof (ok, i admit, the first commercial game was in pure assembler), but i always encourage people to program the way *they* like instead of forcing them my pattern.
efeX, in this case I think, a container of instances - std::vector<Bullet> - would be appropriate, since the Bullet class doesn't require any particular semantics. Anyway, thanks for the support, I felt a little bit surrounded by raw-pointer-in-container-users.
If you're creating new bullet objects at runtime you'll want your container to store pointers:Code: [Select]
std::vector<Bullet*> bulletList;
Example of creating the bullet:Code: [Select]
bulletList.push_back(new Bullet());
When destroying the bullet:Code: [Select]
delete bulletList[i]; //Of course, you would actually want an iterator.
bulletList.erase(i);
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "Test");
Window.SetFramerateLimit(60);
while (Window.IsOpened())
{
sf::Event Event;
while (Window.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
Window.Close();
}
Window.Clear();
std::cout << 1 / Window.GetFrameTime() << std::endl;
Window.Display();
}
}
[/code]
Yes this project does use SFML, NOT gamemaker
i'm sorry for those that this project does not work for...
all i can say is that in future versions i shall be looking for ways to increase the compatiblity with vista!
anyways, any suggestions on how to do this would be great
Quote from: "efeX"*sigh* the reason it doesn't work in vista is because what he has posted is made in game maker.... this project was made in game maker and i guess he's trying to remake it in sfml.. but claiming that the client on the site is C++/SFML?.... no.
AFAIR Game Maker games are vista compatible if created with the latest version. Also Game Maker executables are much bigger in size.