🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Untitled

posted in DruinkJournal
Published July 12, 2006
Advertisement
I made my sound classes all nice and OOPY today, and then decided I need smart pointers, since I'm implementing reference counting right, left and center. I also figured I'd write my own smart pointer class, just for the exercise really. And it's working pretty well. The only problem is, I have to double cast some things. Example:
CSmartPointer LoadResource(...){   // ...}CSmartPointer pBinaryRes = (CBinaryResource*)(CResource*)LoadResource(...);

Apparently the compiler isn't clever enough to cast my CSmartPointer to a CResource* so it can be cast to a CBinaryResource. It seems I have to do the same to cast to a derived class too (E.g. to a CResource smart pointer from a CBinaryResource smart pointer).
Anyway, apart from being ugly, it works. All the reference counting is done properly. So I'm happy.

My performance is pretty good too. I'm getting around 90FPS in a debug build with my background map, 5 alpha blended sprites (256x256) and a streaming ogg playing. And I get around 900FPS on my main PC. Yeah, my lappy sucks ass - I'm pretty sure it's GPU bound. I want to stay above 60 FPS on my laptop in release mode, since my lappy is probably about the minimum spec I want to aim for (512MB RAM (128MB for integreated graphics), ATI X200M graphics, AMD Semphron 2800+ (~1.6GHz)).

I'm gonna do a bit of poking around on google tonight and try to find out what I need to do to get audio notes playing, oldschool style. I also want to get a good memory manager working. I tried mmgr, but because of the way my headers are laid out now, it's not possible to use it. So I'm going to do what I did for the memory manager I wrote at work - not use new and delete, but macro-ify up a NEW and DELETE macro. I could just use new and delete, but I want to track file and line numbers of allocations, like MMGR does. Using my own macros will mean


I ordered a 4 CDs, Failure, Contempt, Defiance, and Addendum all from an Amazon marketplace seller in the US. Addendum arrived today, I'm wondering why the hell it was sent seperately from the other 3, considering the postage cost from the US... Still, the delivery estimate is "5 Jul 2006 - 20 Jul 2006", so if there's no more shortly after the 20th, I'll investigate further.

Anyway, off to look up note frequencies...
Previous Entry Untitled
Next Entry Untitled
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement