File: dfont.h

package info (click to toggle)
openssn 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,340 kB
  • sloc: cpp: 10,973; makefile: 80
file content (46 lines) | stat: -rw-r--r-- 894 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// $Id: dfont.h,v 1.3 2003/04/14 05:51:03 mbridak Exp $
#ifndef DFONT_H
#define DFONT_H

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>

#include <iostream>
using std::ios;

#include <fstream>
using std::istream;
using std::ostream;
using std::ofstream;
using std::ifstream;
using std::cerr;
using std::cin;
using std::cout;

#include <map>



class DFont
{
 protected:
  std::map <char, SDL_Rect> fonts;
  SDL_Surface *fontSurface;
  int gap;

 private:
  void initMap (char *);	
  void loadMap (char *);
  void loadImage (char *);
  Uint32 GetPixel (SDL_Surface *, Sint32, Sint32);

 public:
  DFont (char *, char * );		
  ~DFont ();
  void PutString(SDL_Surface *, Sint16 , Sint16 , char * );
  void PutChar(SDL_Surface *, Sint16, Sint16, char);
};

ostream& operator << (ostream & , SDL_Rect const &);//output a record
istream& operator >> (istream & , SDL_Rect &);//input a record
#endif