Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  
Evil Steve


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...
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!