ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
point.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) by Fred Klaus *
3  * development@fkweb.de *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 #ifndef SDLTK_POINT_H
21 #define SDLTK_POINT_H
22 
23 #include "SDL.h"
24 
25 namespace sdltk
26 {
28  class Point
29  {
30 
31  public:
35  Point(Sint16 x, Sint16 y) {mX = x; mY = y;}
37  Point(const Point & p) {mX = p.x(); mY = p.y();}
38 
41 
43  Point & operator=(const Point & p)
44  {if (this == &p) return *this; mX=p.x(); mY=p.y(); return *this;}
45 
46  bool operator==(const Point & p) const
47  {return (mX == p.x() && mY == p.y()) ? true : false;}
48 
49  bool operator!=(const Point & p) const
50  {return (mX != p.x() || mY != p.y()) ? true : false;}
51 
52  Sint16 x() const {return mX;}
53  Sint16 y() const {return mY;}
54 
55  void setX(Sint16 x) {mX = x;}
56  void setY(Sint16 y) {mY = y;}
57  void set(const Point & p) {mX = p.x(); mY = p.y();}
58  void set(Sint16 x, Sint16 y) {mX = x; mY = y;}
59 
60  void qX(const Point & p) {mX ^= p.x();}
61  void qY(const Point & p) {mY ^= p.y();}
62 
63  private:
64  Sint16 mX = 0;
65  Sint16 mY = 0;
66  };
67 
68 } // sdltk
69 
70 
71 #endif // SDLTK_POINT_H
~Point() ROLAND_DEFAULT Point &operator
Standard Destructor. Does nothing.
Point(const Point &p)
Copyconstructor. It is save to init Point with itself.
Definition: point.h:37
GLuint GLfloat GLenum cap GLsizei GLuint *textures GLenum GLint *params void GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid *pixels GLenum GLint GLint GLint GLsizei GLsizei GLenum GLenum const GLvoid *pixels GLfloat x
Definition: glfunclist.h:25
Point() ROLAND_DEFAULT Point(Sint16 x
Standard Constructor. Initializes x and y to 0.
#define ROLAND_DEFAULT
Definition: compspec.h:46
Defines a 2D point (x, y)
Definition: point.h:28
mY
Definition: point.h:35
Sint16 y
Definition: point.h:35
the SDL based Stuff
Definition: audio.cpp:22