rms
October 23rd, 2004, 08:16 AM
Hello!
I'm making my first DirectX game using Summer 2004 SDK and C#. The project is the 2D-game Puzzle Bobble (Bust-a-Move)!
And I've run into some problems.
Here is my code: http://egy.nu/~u85snms/puzzlebobble.cs
First of all, the game uses 50mb of memory if running in full screen, while only 2mb if windowed. I guess there's something wrong with the fullscreen code? =)
Also, another memory issue. When in full screen mode, minimized, and checking memory usage, every second it increases by 4 bytes. Each ALT-TAB increases it by 3mb.
In windowed mode it increases by 16 bytes every second.
Anyone can find why? Or is it supposed to? =O
Also, the memory is slightly lower if I use the OnDeviceLost-method (47mb fullscreen) but when I use it I get System.NullReferenceException on line 235 (base.OnKeyDown(e);)
What am I doing wrong? Also, which other objects should I dispose in OnDeviceLost, if use of that method at all?
AND, if someone could tell me how to get the current fps I'd appreciate that, not like it really matters in this 2D game but it would be a cool feature. I've tested alot of stuff but nothing really worked. Frames divided by seconds, but *****? How? =)
I greatly appreciate all answers to any of this. So I can begin with the REAL game-code. (I want to make sure everything else works first)
Thanks in advance,
Mattias
I'm making my first DirectX game using Summer 2004 SDK and C#. The project is the 2D-game Puzzle Bobble (Bust-a-Move)!
And I've run into some problems.
Here is my code: http://egy.nu/~u85snms/puzzlebobble.cs
First of all, the game uses 50mb of memory if running in full screen, while only 2mb if windowed. I guess there's something wrong with the fullscreen code? =)
Also, another memory issue. When in full screen mode, minimized, and checking memory usage, every second it increases by 4 bytes. Each ALT-TAB increases it by 3mb.
In windowed mode it increases by 16 bytes every second.
Anyone can find why? Or is it supposed to? =O
Also, the memory is slightly lower if I use the OnDeviceLost-method (47mb fullscreen) but when I use it I get System.NullReferenceException on line 235 (base.OnKeyDown(e);)
What am I doing wrong? Also, which other objects should I dispose in OnDeviceLost, if use of that method at all?
AND, if someone could tell me how to get the current fps I'd appreciate that, not like it really matters in this 2D game but it would be a cool feature. I've tested alot of stuff but nothing really worked. Frames divided by seconds, but *****? How? =)
I greatly appreciate all answers to any of this. So I can begin with the REAL game-code. (I want to make sure everything else works first)
Thanks in advance,
Mattias