Thread: Useful class hierarchy?

  1. #1
    Registered User
    Join Date
    Dec 2001

    Useful class hierarchy?

    Would you implement animated Sprites in this way:

    class Animation{
    RECT StartFrame,EndFrame,CurrentFrame,VisiblePart;
    int frameDelay;


    bool Create(LPDIRECTDRAWSURFACE7 lpDDSx,int LinesOnSurf,
    int RowsOnSurf,int StartXindex,int StartYindex,int EndXindex,
    int EndYindex, int framedelay,int Colorkey=RGB(255,255,255));

    bool Draw(LPDIRECTDRAWSURFACE7 lpDDSbackbuffer,
    RECT WhereToDrawThere,RECT WhatToDrawThere);


    class ComplexSprite{
    Animation* AvailableAnimations; // Will be initialized with
    // actual Animation-array
    int Status; // f.e. jumping, smiling, doesn't matter what
    // but I'm hoping to control the Animation shown with this
    // member
    // Rest is something like SetXY() any easy Sprite-functions

    Do I have to 'invent' a class hierarchy on my own or are there
    resources somewhere on the internet I can learn from?
    Oh - my very first 'game' is attached, you'll need DirectX 8.1- I guess (and a 800x600x16-able screen)

  2. #2
    Registered User
    Join Date
    Dec 2001

    Question Frames

    How to calculate the amount of videomemory a 800x600 16-bit surface uses?
    Also, if a game runs with 50 frames (screen updates) per second: Would you say this is fast or slow? How many different Blits from videomemory to a backbuffer can a program do in 1/50 seconds?
    How to know how many procedures calculating the state of the game (Position in Level, Position on Screen, Collision ...) can be executed in 1/50 seconds? Do you know an example for a professionally written game updating its screen 50 times a second and can you tell me how complex it is (or what you guess how many function calls and blits are done in 0.02 seconds in this specific game). I'm afraid to call to many functions and do to many blits in my programs, because I've no idea of professionally efficient programming.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 01:09 PM
  4. Mmk, I give up, lets try your way. (Resource Management)
    By Shamino in forum Game Programming
    Replies: 31
    Last Post: 01-18-2006, 09:54 AM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM