graphcis.h

/***************************************************************************
                          graphics.h  -  description
                             -------------------
    begin                : Sat Jul 21 2001
    copyright            : (C) 2001 by Sam "Criswell" Hart
    email                : criswell@geekcomix.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License version 2 as     *
 *   published by the Free Software Foundation                             *
 *                                                                         *
 ***************************************************************************/

#ifndef __GRAPHICS_H__
#define __GRAPHICS_H__

#include <unistd.h>

#define MAX_UPDATES 100
#define DEFAULT_FPS 50

class graphicInit
{
    public:
        graphicInit();
        ~graphicInit();

        /* Lib init constructor */
        graphicInit(Uint32 lib_flags, bool verb);

        /* Screen methods */
        SDL_Surface *setVideoMode(int w, int h, int bpp, Uint32 vid_flags);
        void restartVideo(void);
        SDL_Surface *getScreen(void);
        void setFPS(int newfps);
        int getFPS(void);
        void centerWindow();
        void draw(SDL_Rect *rect);
        void update(void);
        void update(bool tf);
        void waitFrame(int i);

        /* Image Loading methods */
        SDL_Surface *loadImage(char *datafile);
        SDL_Surface *loadImage(char *datafile, bool alpha);
        SDL_Surface *loadImage(char *datafile, Uint32 alphackey);

        /* Other misc image methods */
        SDL_Rect *overlap(SDL_Rect *object1, SDL_Rect *object2);

        /* Text Loading methods */
        char *loadTextLine(char *datafile, int max);

        /* TTF utils */
        void ttfInit(void);
        TTF_Font *loadFont(char *datafile, int ptsize);

        /* Load Prefix Items */
        void setLoadPrefix(char *prefix, bool tf);
    private:
        bool verbose;
        SDL_Surface *screen;
        int PID;
        char *data_prefix;
        bool use_prefix;
        bool use_ttf;

        SDL_Rect blits[MAX_UPDATES];
        int numupdates;

        int fps;
};

#endif
/* __GRAPHICS_H__ */ 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值