[QUOTE=ZeekyHBomb;22822152]It does bug you when you know that you can get more with about the same framework.
'tis what I said. And if you look at the link you'll see that it should throw an exception if it is 0.[/QUOTE]
[quote=Link][cpp]if (updates_per_second < 0.0 || updates_per_second > 200.0)
00384 throw new ArgumentOutOfRangeException("updates_per_second", updates_per_second,
00385 "Parameter should be inside the range [0.0, 200.0]");[/cpp][/quote]
Only if it's below 0. Also, this...
[quote=http://www.opentk.com/files/doc/class_open_t_k_1_1_game_window.html#acf250353ae71ed429642335d614da7c5]A value of 0.0 indicates that UpdateFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities).[/quote]
[editline]03:51PM[/editline]
I've been ninja'd three times today already and I just woke up! :saddowns:
Also, I'm reading the GameWindow code and found this:
if (++num_updates >= 10 || TargetUpdateFrequency == 0.0)
break;
It goes through the loop once, calling the OnUpdateFrameInternal() and then breaks if the frequency is 0 and since Run() calls the update and render functions in a while (true) loop it will execute as fast as it can.
[URL="http://www.opentk.com/files/doc/_game_window_8cs_source.html"]Link[/URL]
It's normal for a program to use all available CPU time (in your case, 100% of one core) if it's pushing frames through as fast as possible without waiting on anything, like vsync or a timer, between frames. Games do it too. OpenTK is not "draining" your CPU time; your own program contains an infinite loop that never willingly relinquishes the CPU.
Go ahead and write your program using OpenTK. and use vsync to avoid wasting CPU time sending unnecessarily large numbers of frames to the GPU.
[QUOTE=ZeekyHBomb;22822152]It does bug you when you know that you can get more with about the same framework.[/QUOTE]
I guess I'm doing it wrong then.
[img]http://www.imgdumper.nl/uploads3/4c1fabbaa5820/4c1fabba998b1-darwinapp.png[/img]
[img]http://www.imgdumper.nl/uploads3/4c220748e1f39/4c220748cee87-fraps.jpg[/img]
It uses all of one core, because it is going as fast it can: unless you put the thread sleep thing in there, which just tells it to do nothing for one millisecond, it is calculating the frame time as fast as it possibly can.
I do not see why you care about the fps of an empty window: it's entirely meaningless, as it's entirely unrepresentative of any normal use of the code. Write something in it, and if you are unsatisfied with the performance, and you think it is the fault of the library you are using, use a different library. Simple as. The chances are that whatever library you use to write your 3D stuff, the way in which you write it will be much more important.
That's true, I'll see how it handles actually doing something.
Darwin stated that the FPS is not too low or anything, but that Tao as opposed to OpenTK is notably faster and doesn't hug as much CPU. Which is strange, since they should perform almost the same.
It's not about OpenTK being dead slow or anything.
[QUOTE=ZeekyHBomb;22822593]Darwin stated that the FPS is not too low or anything, but that Tao as opposed to OpenTK is notably faster and doesn't hug as much CPU. Which is strange, since they should perform almost the same.
It's not about OpenTK being dead slow or anything.[/QUOTE]
Yes, I agree, but a framerate higher than 10000 is ridiculous and sounds invalid.
It obviously isn't, I've tested it with 3 methods, the slowesd one being the Glfw implementation which claims to use the systems most precise way of measuring time. And even that was 40 000.
I wasn't even running a clean project, just took something old and deleted the stuff that was supposed to draw.
[editline]03:27PM[/editline]
Also, SFML ran an empty window at 8K
1) Don't use FPS as a performance metric, it's broken.
2) There is literally no point measuring the comparative performance of nothing.
3) OpenTK is built on top of Tao, and they both P/Invoke GL. There will be no major performance differences.
4) Just write your game or whatever and worry about profiling that.
FPS is just fine for comparing stuff. 120 FPS is twice as fast as 60 FPS. 40 000 FPS is 40 times faster than a 1000 FPS. It means that a program running at 40 000 FPS doing the same thing another program running at 1000 FPS does, would do it 40 times while the slow program does it once.
Oh. And a question. If it's locked at 60 FPS should I still multiply stuff with frametime or just trust that it won't drop bellow 60?
Mmm so your 40X increase is certainly better than the 2X increase.
60fps is 16.67ms per frame.
120fps is 8.34ms per frame.
So that's a saving of 8.34ms.
1000fps is 1ms per frame.
40000fps is 0.025ms per frame.
So that's a saving of 0.975ms.
If you can't see the problem here you should not be programming games.
Hmmm, I see your logic. Never thought to look at it like that.
Not to mention frame time is less work to calculate. :)
[QUOTE=Darwin226;22823495]Oh. And a question. If it's locked at 60 FPS should I still multiply stuff with frametime or just trust that it won't drop bellow 60?[/QUOTE]
Depends what it is really, but 60 is too high to be relied on for almost everything.
I rely on 30fps for my pong game, but that has 0% CPU usage for me on my desktop and netbook. In cases like that I think it's safe to say that you needn't worry about frametime though I'm sure some purists will disagree with me with a furious enthusiasm.
One problem with depending on fixed frame time is that it's easy to simply slow the game down, but it depends whether you care about people doing that or not really.
It's also an ugly number with all the decimals and stuff.
OpenTK also has UpdateFrequency which is in Hz.
So, should I multiply with frame time or not? I mean, is a chance that the FPS might drop bellow 60 worth writing * FrameTime every time?
[QUOTE=Darwin226;22822718]Also, SFML ran an empty window at 8K[/QUOTE]
What's your point?
uargh automerge :argh:
[QUOTE=Darwin226;22824005]It's also an ugly number with all the decimals and stuff.
OpenTK also has UpdateFrequency which is in Hz.
So, should I multiply with frame time or not? I mean, is a chance that the FPS might drop bellow 60 worth writing * FrameTime every time?[/QUOTE]
That's for you to decide.
Is the game going into slo-mo a serious issue? Is it likely?
There's no point in an application running more than 60 frames per second unless it's for slow motion recording or something.
hi guys, new programmer here and taking a c++ class, my grade isnt so good, so im trying to boost it up, i finished most of my assignments but theres always a question or 2 im not sure about so ill post them here and hopefully somebody can help me:
[CODE]
1.
An anonymous type can be passed as a parameter to a function.
A) True
B) False
2.
The following statement creates an anonymous type:
enum {1ST, 2ND, 3RD, 4TH} places;
A) True
B) False
Which of the following statements creates an anonymous type?
A) enum grades {A, B, C, D, F};
B) enum grades {};
C) enum {};
D) enum {A, B, C, D, F} grades;
[/CODE]
Surely you should ask the teacher that?
lmao i dont think my teach will give me the answers with an explanation(hopefully)
Well, just think about what anonymous type means: It means that you have a type without a name.
Now 1) Can you declare a function taking a parameter with a type that has no name? How would you do it?
2) Does enum {1ST, 2ND, 3RD, 4TH} places; declare a type? If so, how is it named? (note: a variable is not a type!)
3) Which of those 4 statements creates a type that has no name? (again: a variable is not a type)
When making a console application on Linux, how do I make it open the terminal to display the output when it runs?
[QUOTE=ZeekyHBomb;22827885]Well, just think about what anonymous type means: It means that you have a type without a name.
Now 1) Can you declare a function taking a parameter with a type that has no name? How would you do it?
2) Does enum {1ST, 2ND, 3RD, 4TH} places; declare a type? If so, how is it named? (note: a variable is not a type!)
3) Which of those 4 statements creates a type that has no name? (again: a variable is not a type)[/QUOTE]
i think i understand, let me make sure im right though. I think its b, b, a? right?
[QUOTE=Overv;22828365]When making a console application on Linux, how do I make it open the terminal to display the output when it runs?[/QUOTE]
Some distributions will open a terminal for you, others won't.
[QUOTE=Overv;22828365]When making a console application on Linux, how do I make it open the terminal to display the output when it runs?[/QUOTE]
Run it from terminal?
[QUOTE=shemer77;22828842]i think i understand, let me make sure im right though. I think its b, b, a? right?[/QUOTE]
The first one you got right.
The second right answer is a, since the typename would follow the enum. What that line does is creating a variable with the name [i]places[/i] of an anonymous type. If you'd put [i]places[/i] between enum and the {, then you'd have a type named places (and no variable declaration).
The last answer is C and D. C is a simple, empty anonymous type and for D it's the same as in the question before.
Hello guys, I'm hoping you can help me with some code. I'm making a webserver in C# and I'm currently writing the section that will read the request from a web browser. My problem is that rcbuffer prints out as "System.Byte[]", rather than the HTTP Request the browser sent. Here is my code.
[code]
recieved = new Byte[1024];
int i = superSocket.Receive(recieved, recieved.Length, 0);
rcBuffer = recieved.ToString();
if (rcBuffer.Substring(0, 3) != "GET")
{
Console.WriteLine("Invalid request type: " + rcBuffer.Substring(0, 3));
//This is where is prints out "System.Byte[]"
Console.WriteLine(rcBuffer);
superSocket.Disconnect(true);
Console.WriteLine("Ready to listen moar!");
}
[/code]
Any help would be much appreciated!
You need to convert it to a string via System.Text.Encoding, e.g. System.Text.Encoding.ASCII.GetString(rcBuffer);.
[QUOTE=ZeekyHBomb;22834962]You need to convert it to a string via System.Text.Encoding, e.g. System.Text.Encoding.ASCII.GetString(rcBuffer);.[/QUOTE]
Thanks, that worked great!
Just out of curiosity, what does .ToString() do?
Sorry, you need to Log In to post a reply to this thread.