Epee Engine  0.40
The Epee Engine is an open source cross platform graphics engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
EEWidget.h
Go to the documentation of this file.
1 /*
2 * EEWidget.h
3 *
4 *
5 * Epee Engine
6 * Created by Alan Uthoff on 3/12/06.
7 Copyright (C) 2011
8 
9 This Code is free software; you can redistribute it and/or
10 modify it under the terms of the zlib/libpng License as published
11 by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13 This software is provided 'as-is', without any express or implied warranty.
14 
15 In no event will the authors be held liable for any damages arising from the use of this software.
16 
17 Permission is granted to anyone to use this software for any purpose,
18 including commercial applications, and to alter it and redistribute
19 it freely, subject to the following restrictions:
20 
21 1. The origin of this software must not be misrepresented;
22 you must not claim that you wrote the original software.
23 If you use this software in a product, an acknowledgment
24 in the product documentation would be appreciated but is not required.
25 
26 2. Altered source versions must be plainly marked as such,
27 and must not be misrepresented as being the original software.
28 
29 3. This notice may not be removed or altered from any source distribution.
30 
31 
32 */
33 
34 #ifndef EEWIDGET_H
35 #define EEWIDGET_H
36 
37 
38 #include "EpeeEngineError.h"
39 
41 
42 //***********************Begin Of Sprocket Class***************************
43 class EEWidget //Base Class
44 {
45 protected:
46  int m_iz;
47  std::string m_sName;
49  bool m_bDraw;
52  bool m_bblit;
54 
55 
56 protected:
57  double m_iRotation;
58  double m_iScaleX;
59  double m_iScaleY;
60  bool m_bactive;
63  SDL_Rect m_cBox;
64  unsigned int m_iTextureH;
65  unsigned int m_iTextureW;
66  SDL_Surface *m_porignalSurface;
67  SDL_Surface *m_pModifySurface;
68  GLuint m_GLTexture;
69  virtual void Render();
70  EEWidget();
71 
72 public:
73  EEWidget(std::string _NameMain,int _TypeMain);
74  EEWidget(std::string _NameMain,int _TypeMain, int _x, int _y,int _z);
75 
76  virtual ~EEWidget();
77  virtual void Init();
78  friend class EpeeEngine;
79  friend class RenderList;
80  virtual void LoadTexture();
81  virtual void UnloadSurface();
82  virtual SDL_Surface * LoadSurface();
83  virtual void UnLoadTexture();
84  virtual bool IsLoaded();
85  virtual void SDL_GL_SurfaceToTexture(SDL_Surface * surface);
86  virtual void CreateTexture(SDL_Surface * _baseSurface,SDL_Surface * _image);
87  int NearestPowerOfTwo(int i);
88  void SetLocation(int _x,int _y);
89  int GetLocationX();
90  int GetLocationY();
91  std::string GetName();
92  int GetLocationZ ();
93  virtual void SetHeightWidth(unsigned int _Height,unsigned int _Width);
94  unsigned int GetHeight();
95  unsigned int GetWidth ();
96  bool SetDraw(bool _Draw);
97  bool GetDraw();
98  int GetType();
99  bool SetScalingFactor(double _ScalingX,double _ScalingY);
100  bool SetScalingFactorY(double _ScalingY);
101  bool SetScalingFactorX(double _ScalingX);
102  double GetScalingFactorX();
103  double GetScalingFactorY();
104  bool SetRotation(double _Degrees );
105  double GetRotation();
106  bool SetAntiAliased(bool _AntiAliased );
107  bool GetAntiAliased();
109  virtual EEWidget * WasClicked(int _mouselocationX, int _mouselocationY);
110  void DisableClick();
111  void EnableClick();
112  bool GetIsClickEnabled();
113  void DisableAndTurnOffDraw();
114  void EnableAndTurnOnDraw();
115  void SetDontMoveOnClick(bool _flag);
116  bool GetDontMoveOnClick();
117  bool WasLastSprocketClicked();
118  void ShowOutLine();
119  void HideOutLine();
120  bool GetOutLine();
121 protected:
122 
123  bool GetBlit();
124  virtual SDL_Surface * SetSurface();
125  virtual SDL_Surface * GetEEWidgeturface();
126  SDL_Rect * GetRect();
127  bool SetCurrentArrayPostion(int _newPostion);
128  void SetType(int _type);
129  void SetLocationZ(int _z);//DO NOT call this function call ChangeSprocketZ instead
130  void SetBlit(bool _blit);
131  virtual void SetModifySurFace(SDL_Surface * _ModifySurface);
132  SDL_Surface * GetModifySurFace();
133 
134 
135 };
136 //***********************End Of Sprocket Class*******************************
137 
138 #endif // EEWIDGET_H
virtual void CreateTexture(SDL_Surface *_baseSurface, SDL_Surface *_image)
Definition: EEWidget.cpp:236
double m_iScaleX
Definition: EEWidget.h:58
virtual void Render()
Definition: EEWidget.cpp:352
SDL_Surface * m_porignalSurface
Definition: EEWidget.h:66
bool GetOutLine()
Definition: EEWidget.cpp:697
SDL_Surface * m_pModifySurface
Definition: EEWidget.h:67
bool SetCurrentArrayPostion(int _newPostion)
Definition: EEWidget.cpp:627
bool SetRotation(double _Degrees)
Definition: EEWidget.cpp:502
GLuint m_GLTexture
Definition: EEWidget.h:68
double GetRotation()
Definition: EEWidget.cpp:519
bool SetScalingFactorX(double _ScalingX)
Definition: EEWidget.cpp:474
bool SetScalingFactor(double _ScalingX, double _ScalingY)
Definition: EEWidget.cpp:435
void SetDontMoveOnClick(bool _flag)
Definition: EEWidget.cpp:593
bool m_bDontMoveButton
Definition: EEWidget.h:61
Definition: EpeeEngine.h:101
int GetLocationZ()
Definition: EEWidget.cpp:160
void SetType(int _type)
Definition: EEWidget.cpp:638
virtual void LoadTexture()
Definition: EEWidget.cpp:331
bool m_iAntiAliased
Definition: EEWidget.h:51
virtual EEWidget * WasClicked(int _mouselocationX, int _mouselocationY)
Definition: EEWidget.cpp:543
void EnableClick()
Definition: EEWidget.cpp:571
double GetScalingFactorY()
Definition: EEWidget.cpp:497
double m_iScaleY
Definition: EEWidget.h:59
SDL_Rect * GetRect()
Definition: EEWidget.cpp:622
unsigned int m_iTextureH
Definition: EEWidget.h:64
bool GetBlit()
Definition: EEWidget.cpp:606
bool SetScalingFactorY(double _ScalingY)
Definition: EEWidget.cpp:457
bool GetDontMoveOnClick()
Definition: EEWidget.cpp:598
virtual SDL_Surface * LoadSurface()
Definition: EEWidget.cpp:326
virtual void Init()
Definition: EEWidget.cpp:115
bool SetDraw(bool _Draw)
Definition: EEWidget.cpp:269
std::string GetName()
Definition: EEWidget.cpp:156
bool m_bShowSurfaceOutline
Definition: EEWidget.h:53
void DisableAndTurnOffDraw()
Definition: EEWidget.cpp:580
virtual SDL_Surface * SetSurface()
Definition: EEWidget.cpp:611
double m_iRotation
Definition: EEWidget.h:57
EEWidget()
Definition: EEWidget.cpp:107
void SetBlit(bool _blit)
Definition: EEWidget.cpp:647
virtual void SDL_GL_SurfaceToTexture(SDL_Surface *surface)
Definition: EEWidget.cpp:183
int GetLocationY()
Definition: EEWidget.cpp:152
void EnableAndTurnOnDraw()
Definition: EEWidget.cpp:586
void SetLocationZ(int _z)
Definition: EEWidget.cpp:642
SDL_Rect m_cBox
Definition: EEWidget.h:63
int m_iCurrentPostion
Definition: EEWidget.h:50
virtual void UnLoadTexture()
Definition: EEWidget.cpp:289
std::string m_sName
Definition: EEWidget.h:47
virtual ~EEWidget()
Definition: EEWidget.cpp:120
virtual SDL_Surface * GetEEWidgeturface()
Definition: EEWidget.cpp:616
int m_iz
Definition: EEWidget.h:46
bool WasLastSprocketClicked()
Definition: EEWidget.cpp:134
bool m_bblit
Definition: EEWidget.h:52
virtual bool IsLoaded()
Definition: EEWidget.cpp:315
void SetLocation(int _x, int _y)
Definition: EEWidget.cpp:140
virtual void UnloadSurface()
Definition: EEWidget.cpp:300
double GetScalingFactorX()
Definition: EEWidget.cpp:492
Definition: EEWidget.h:43
Definition: EESceneGraph.h:41
void ShowOutLine()
Definition: EEWidget.cpp:679
int NearestPowerOfTwo(int i)
Definition: EEWidget.cpp:172
int GetType()
Definition: EEWidget.cpp:283
int m_iSprocketType
Definition: EEWidget.h:48
void HideOutLine()
Definition: EEWidget.cpp:684
int GetLocationX()
Definition: EEWidget.cpp:147
bool GetIsClickEnabled()
Definition: EEWidget.cpp:575
bool SetAntiAliased(bool _AntiAliased)
Definition: EEWidget.cpp:524
unsigned int m_iTextureW
Definition: EEWidget.h:65
bool GetAntiAliased()
Definition: EEWidget.cpp:533
virtual void SetHeightWidth(unsigned int _Height, unsigned int _Width)
Definition: EEWidget.cpp:165
unsigned int GetHeight()
Definition: EEWidget.cpp:260
bool m_bactive
Definition: EEWidget.h:60
bool m_bDraw
Definition: EEWidget.h:49
bool m_bCurrentlySelected
Definition: EEWidget.h:62
bool GetDraw()
Definition: EEWidget.cpp:278
void DisableClick()
Definition: EEWidget.cpp:566
virtual void SetModifySurFace(SDL_Surface *_ModifySurface)
Definition: EEWidget.cpp:660
SDL_Surface * GetModifySurFace()
Definition: EEWidget.cpp:674
unsigned int GetWidth()
Definition: EEWidget.cpp:264
int GetCurrentVectorPostion()
Definition: EEWidget.cpp:538