~ubuntu-branches/ubuntu/precise/pingus/precise

« back to all changes in this revision

Viewing changes to src/gui/display_graphic_context.hxx

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-02-28 19:44:25 UTC
  • mfrom: (4.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20080228194425-e8ilohlijv02kgcf
Tags: 0.7.2-2
* Fix FTBFS with gcc-4.3 by adding the missing include in
  src/input/evdev_device.cpp (Closes: #462238):
   + debian/patches/20_fix_FTBFS_with_gcc-4.3.
* Rename former patch so that the filename reflects the order in which
  the patches are applied:
   - debian/patches/data_dir.patch
   + debian/patches/10_fix_data_directory.
* Bump Standards-Version from 3.7.2 to 3.7.3, no changes needed.
* Add a dh_desktop call in the arch-dep part of debian/rules.
* Adjust the “missing-dep-for-interpreter guile” override since lintian
  now lists an alternative for that dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//  $Id: display_graphic_context.hxx,v 1.2 2003/03/16 23:07:02 grumbel Exp $
2
 
// 
3
 
//  Pingus - A free Lemmings clone
4
 
//  Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
5
 
//
6
 
//  This program is free software; you can redistribute it and/or
7
 
//  modify it under the terms of the GNU General Public License
8
 
//  as published by the Free Software Foundation; either version 2
9
 
//  of the License, or (at your option) any later version.
10
 
//
11
 
//  This program is distributed in the hope that it will be useful,
12
 
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
//  GNU General Public License for more details.
15
 
// 
16
 
//  You should have received a copy of the GNU General Public License
17
 
//  along with this program; if not, write to the Free Software
18
 
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
 
 
20
 
#ifndef HEADER_DISPLAY_GRAPHIC_CONTEXT_HXX
21
 
#define HEADER_DISPLAY_GRAPHIC_CONTEXT_HXX
22
 
 
23
 
#include "../vector.hxx"
24
 
#include <ClanLib/Core/Math/rect.h>
25
 
 
26
 
#include "graphic_context.hxx"
27
 
 
28
 
/** A GraphicContext which represents the display and allows you to
29
 
    paint on it */
30
 
class DisplayGraphicContext : public GraphicContext
31
 
{
32
 
private:
33
 
  /** Position of the display on the screen */
34
 
  int x1, y1, x2, y2;
35
 
 
36
 
  /** scroll offset */
37
 
  Vector offset;
38
 
 
39
 
  /** center of the display */
40
 
  Vector center;
41
 
 
42
 
public:
43
 
  DisplayGraphicContext (int x1, int y1, int x2, int y2, 
44
 
                         int /*x_offset*/, int /*y_offset*/);
45
 
  virtual ~DisplayGraphicContext ();
46
 
  
47
 
  Vector get_offset ();
48
 
 
49
 
  float get_x_offset ();
50
 
  float get_y_offset ();
51
 
 
52
 
  void  set_offset (float x, float y);
53
 
 
54
 
  CL_Rect get_clip_rect();
55
 
 
56
 
  int   get_width ();
57
 
  int   get_height ();
58
 
 
59
 
  float get_zoom ();
60
 
  void  set_zoom (float new_zoom);
61
 
 
62
 
  /** Set the current zoom and offset, so that the given rectangle is
63
 
      completly visible on the screen and maximally zoomed. */
64
 
  void zoom_to (const CL_Rect & rect);
65
 
 
66
 
  /// Scroll the view by the given delta
67
 
  void move (const Vector & delta);
68
 
 
69
 
  /** Converts a given screen coordinate, as returned by
70
 
      CL_Mouse::get_x(), into the world coordinate system. */
71
 
  Vector screen_to_world (Vector pos);
72
 
  Vector world_to_screen (Vector pos);
73
 
 
74
 
  void clear (float r, float g, float b);
75
 
 
76
 
  void draw (Sprite& sprite, const Vector& pos);
77
 
  void draw (Sprite& sprite, const Vector& pos, int frame);
78
 
  void draw (CL_Surface& sur, const Vector& pos);
79
 
  void draw (CL_Surface& sur, const Vector& pos, int frame);
80
 
 
81
 
  void draw (CL_Surface& sur, int x_pos, int y_pos);
82
 
  void draw (CL_Surface& sur, int x_pos, int y_pos, int frame);
83
 
 
84
 
  /** Draw a scaled surface */
85
 
  void draw (CL_Surface& sur, int x_pos, int y_pos, 
86
 
             float size_x, float size_y, int frame);
87
 
 
88
 
  /** Draw a line */
89
 
  void draw_line (const Vector& pos1, const Vector& pos2,
90
 
                  float r, float g, float b, float a = 1.0f);
91
 
  /** Draw a line */
92
 
  void draw_line (int x1, int y1, int x2, int y2, 
93
 
                  float r, float g, float b, float a = 1.0f);
94
 
 
95
 
  /** Draw a filled rectangle (FIXME: [x1,x2] or [x1,x2[ ?) */
96
 
  void draw_fillrect (int x1, int y1, int x2, int y2, 
97
 
                      float r, float g, float b, float a = 1.0f);
98
 
 
99
 
  /** Draw an unfilled rectangle (FIXME: [x1,x2] or [x1,x2[ ?) */
100
 
  void draw_rect (int x1, int y1, int x2, int y2, 
101
 
                  float r, float g, float b, float a = 1.0f);
102
 
 
103
 
  /** Draw a singel pixel */
104
 
  void draw_pixel (int x_pos, int y_pos, 
105
 
                   float r, float g, float b, float a = 1.0f);
106
 
 
107
 
  /** Draw a circle */
108
 
  void draw_circle (int x_pos, int y_pos, int radius,
109
 
                    float r, float g, float b, float a = 1.0f);
110
 
 
111
 
  void print_left (FontHandle font, int x_pos, int y_pos, const std::string& str);
112
 
  
113
 
  void print_center (FontHandle font, int x_pos, int y_pos, const std::string& str);
114
 
  
115
 
  void print_right (FontHandle font, int x_pos, int y_pos, const std::string& str);
116
 
 
117
 
private:
118
 
  DisplayGraphicContext (const DisplayGraphicContext&);
119
 
  DisplayGraphicContext& operator= (const DisplayGraphicContext&);
120
 
};
121
 
 
122
 
#endif
123
 
 
124
 
/* EOF */