Compare commits
10 Commits
335166ea00
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 1aeac2fa34 | |||
| f377d4c1be | |||
| d52356ec02 | |||
| b9cc8348db | |||
| c923b0985b | |||
| 86a31b270d | |||
| 1e1a33f3f9 | |||
| 05ffe20bb4 | |||
| 2c41974460 | |||
| ba16cd4bd4 |
@@ -0,0 +1,2 @@
|
|||||||
|
# SDLPongCPP
|
||||||
|
A simple Pong Game build with my complex and unfinished TrooperEngine.
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 101 KiB |
Binary file not shown.
Binary file not shown.
@@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
wget -c http://www.machinaesupremacy.com/downloads/machinae_supremacy_-_masquerade.ogg
|
|
||||||
ln -s machinae_supremacy_-_masquerade.ogg game-music.ogg
|
|
||||||
wget -c http://www.machinaesupremacy.com/downloads/machinae_supremacy_-_arcade.ogg
|
|
||||||
ln -s machinae_supremacy_-_arcade.ogg menu-music.ogg
|
|
||||||
clear
|
|
||||||
echo The music is now downloaded.
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -63,26 +63,6 @@ void cEventControl::CheckEvents()
|
|||||||
for (it = m_children.begin(); it < m_children.end(); it++) {
|
for (it = m_children.begin(); it < m_children.end(); it++) {
|
||||||
(*it)->OnEvent(event);
|
(*it)->OnEvent(event);
|
||||||
}
|
}
|
||||||
// iVector2 location = { 0, 0 };
|
|
||||||
// switch (event.type)
|
|
||||||
// {
|
|
||||||
// case SDL_KEYUP:
|
|
||||||
// case SDL_KEYDOWN:
|
|
||||||
// case SDL_JOYAXISMOTION:
|
|
||||||
// case SDL_JOYBALLMOTION:
|
|
||||||
// case SDL_JOYHATMOTION:
|
|
||||||
// case SDL_JOYBUTTONDOWN:
|
|
||||||
// case SDL_JOYBUTTONUP:
|
|
||||||
// InputEngine::cInput::Inst().CheckInputs(event);
|
|
||||||
// break;
|
|
||||||
// case SDL_MOUSEBUTTONDOWN:
|
|
||||||
//
|
|
||||||
// SDL_GetMouseState(&location.x, &location.y);
|
|
||||||
// GUIEngine::cGUI::Inst().Event(location, GUIEngine::cGUI::eGUIEventType::MouseButton1);
|
|
||||||
// break;
|
|
||||||
// case SDL_MOUSEBUTTONUP:
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#ifndef _EVENT_H_
|
||||||
|
#define _EVENT_H_
|
||||||
|
|
||||||
|
/*** Custom Header Files ***/
|
||||||
|
|
||||||
|
/*** DLL Header File ***/
|
||||||
|
#include "dllExport.h"
|
||||||
|
|
||||||
|
#define CLASS(X)
|
||||||
|
|
||||||
|
#endif/// END IFNDEF _EVENT_H_
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#include "cButtonEvent.hpp"
|
||||||
|
|
||||||
|
#include "../../MathEngine/cInside.hpp"
|
||||||
|
|
||||||
|
using GUIEventEngine::cButtonEvent;
|
||||||
|
|
||||||
|
/// protected:
|
||||||
|
cButtonEvent::cButtonEvent( const unsigned int id )
|
||||||
|
: cGUIEvent(GUIHelpers::eEventType::BUTTON, id)
|
||||||
|
{}
|
||||||
|
|
||||||
|
/*virtual*/ cButtonEvent::~cButtonEvent()
|
||||||
|
{}
|
||||||
|
|
||||||
|
/// public:
|
||||||
|
/*virtual*/ void cButtonEvent::OnLButtonDown( int mX, int mY )
|
||||||
|
{
|
||||||
|
// if (MathEngine::cInside::isInside(mX, mY, m_button->getArea()) == true)
|
||||||
|
// ;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#ifndef _CBUTTONEVENT_HPP_
|
||||||
|
#define _CBUTTONEVENT_HPP_
|
||||||
|
|
||||||
|
/*** Custom Header Files ***/
|
||||||
|
#include "../../EventEngine/cEvent.hpp"
|
||||||
|
|
||||||
|
//#include "../cButton.hpp"
|
||||||
|
#include "cGUIEvent.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
/*** DLL Header File ***/
|
||||||
|
#include "dllExport.h"
|
||||||
|
|
||||||
|
namespace GUIEventEngine {
|
||||||
|
class EXPORT_FROM_MYDLL cButtonEvent : public cGUIEvent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cButtonEvent( const unsigned int id );
|
||||||
|
virtual ~cButtonEvent();
|
||||||
|
|
||||||
|
//bool operator == ( const cButtonEvent& other );
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// Functions
|
||||||
|
virtual void OnLButtonDown( int mX, int mY );
|
||||||
|
|
||||||
|
/// Sets
|
||||||
|
|
||||||
|
/// Gets
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Variables
|
||||||
|
//GUIEngine::cButton* m_button;
|
||||||
|
};/// END CLASS DEFINITION cButtonEvent
|
||||||
|
}/// END NAMESPACE DEFINITION GUIEventEngine
|
||||||
|
#endif/// END IFNDEF _CBUTTONEVENT_HPP_
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
#include "cGUIEvent.hpp"
|
||||||
|
|
||||||
|
using GUIEventEngine::cGUIEvent;
|
||||||
|
|
||||||
|
cGUIEvent::cGUIEvent( const GUIHelpers::eEventType eventType, const unsigned int id )
|
||||||
|
: m_eventType(eventType), m_id(id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ cGUIEvent::~cGUIEvent()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnEvent(const SDL_Event& event)
|
||||||
|
{
|
||||||
|
switch (event.type)
|
||||||
|
{
|
||||||
|
case SDL_WINDOWEVENT:
|
||||||
|
OnWindowsEvent(event);
|
||||||
|
break;
|
||||||
|
case SDL_KEYDOWN:
|
||||||
|
OnKeyDown(event.key.keysym.sym, event.key.keysym.mod);// , Event->key.keysym.unicode);
|
||||||
|
break;
|
||||||
|
case SDL_KEYUP:
|
||||||
|
OnKeyUp(event.key.keysym.sym, event.key.keysym.mod);//, Event->key.keysym.unicode);
|
||||||
|
break;
|
||||||
|
case SDL_MOUSEMOTION:
|
||||||
|
OnMouseMove(event.motion.x, event.motion.y, event.motion.xrel, event.motion.yrel, (event.motion.state&SDL_BUTTON(SDL_BUTTON_LEFT)) != 0, (event.motion.state&SDL_BUTTON(SDL_BUTTON_RIGHT)) != 0, (event.motion.state&SDL_BUTTON(SDL_BUTTON_MIDDLE)) != 0);
|
||||||
|
break;
|
||||||
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
|
OnMouseButtonDown(event);
|
||||||
|
break;
|
||||||
|
case SDL_MOUSEBUTTONUP:
|
||||||
|
OnMouseButtonUp(event);
|
||||||
|
break;
|
||||||
|
case SDL_JOYAXISMOTION:
|
||||||
|
OnJoyAxis(event.jaxis.which, event.jaxis.axis, event.jaxis.value);
|
||||||
|
break;
|
||||||
|
case SDL_JOYBALLMOTION:
|
||||||
|
OnJoyBall(event.jball.which, event.jball.ball, event.jball.xrel, event.jball.yrel);
|
||||||
|
break;
|
||||||
|
case SDL_JOYHATMOTION:
|
||||||
|
OnJoyHat(event.jhat.which, event.jhat.hat, event.jhat.value);
|
||||||
|
break;
|
||||||
|
case SDL_JOYBUTTONDOWN:
|
||||||
|
OnJoyButtonDown(event.jbutton.which, event.jbutton.button);
|
||||||
|
break;
|
||||||
|
case SDL_JOYBUTTONUP:
|
||||||
|
OnJoyButtonUp(event.jbutton.which, event.jbutton.button);
|
||||||
|
break;
|
||||||
|
case SDL_QUIT:
|
||||||
|
OnExit();
|
||||||
|
break;
|
||||||
|
case SDL_SYSWMEVENT:
|
||||||
|
//Ignore
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
OnUser(event.user.type, event.user.code, event.user.data1, event.user.data2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnInputFocus()
|
||||||
|
{
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnInputBlur()
|
||||||
|
{
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnKeyDown(SDL_Keycode sym, Uint16 mod)//, Uint16 unicode)
|
||||||
|
{
|
||||||
|
sym, mod;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnKeyUp(SDL_Keycode sym, Uint16 mod)//, Uint16 unicode)
|
||||||
|
{
|
||||||
|
sym, mod;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnMouseFocus()
|
||||||
|
{
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnMouseBlur()
|
||||||
|
{
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnMouseMove(int mX, int mY, int relX, int relY, bool Left, bool Right, bool Middle)
|
||||||
|
{
|
||||||
|
mX, mY, relX, relY, Left, Right, Middle;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnMouseWheel(bool Up, bool Down)
|
||||||
|
{
|
||||||
|
Up, Down;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnLButtonDown(int mX, int mY)
|
||||||
|
{
|
||||||
|
mX, mY;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnLButtonUp(int mX, int mY)
|
||||||
|
{
|
||||||
|
mX, mY;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnRButtonDown(int mX, int mY)
|
||||||
|
{
|
||||||
|
mX, mY;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnRButtonUp(int mX, int mY)
|
||||||
|
{
|
||||||
|
mX, mY;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnMButtonDown(int mX, int mY)
|
||||||
|
{
|
||||||
|
mX, mY;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnMButtonUp(int mX, int mY)
|
||||||
|
{
|
||||||
|
mX, mY;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnJoyAxis(SDL_JoystickID which, Uint8 axis, Sint16 value)
|
||||||
|
{
|
||||||
|
which, axis, value;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnJoyButtonDown(SDL_JoystickID which, Uint8 button)
|
||||||
|
{
|
||||||
|
which, button;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnJoyButtonUp(SDL_JoystickID which, Uint8 button)
|
||||||
|
{
|
||||||
|
which, button;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnJoyHat(SDL_JoystickID which, Uint8 hat, Uint8 value)
|
||||||
|
{
|
||||||
|
which, hat, value;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnJoyBall(SDL_JoystickID which, Uint8 ball, Sint16 xrel, Sint16 yrel)
|
||||||
|
{
|
||||||
|
which, ball, xrel, yrel;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnMinimize()
|
||||||
|
{
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnRestore()
|
||||||
|
{
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnResize(int w, int h)
|
||||||
|
{
|
||||||
|
w, h;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnExpose()
|
||||||
|
{
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnExit()
|
||||||
|
{
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnUser(Uint32 type, int code, void* data1, void* data2)
|
||||||
|
{
|
||||||
|
type, code, data1, data2;
|
||||||
|
//Pure virtual, do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnWindowsEvent(const SDL_Event& event)
|
||||||
|
{
|
||||||
|
switch (event.window.event)
|
||||||
|
{
|
||||||
|
case SDL_WINDOWEVENT_SHOWN:
|
||||||
|
SDL_Log("Window %d shown", event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_HIDDEN:
|
||||||
|
SDL_Log("Window %d hidden", event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_EXPOSED:
|
||||||
|
SDL_Log("Window %d exposed", event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_MOVED:
|
||||||
|
SDL_Log("Window %d moved to %d,%d",
|
||||||
|
event.window.windowID, event.window.data1,
|
||||||
|
event.window.data2);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_RESIZED:
|
||||||
|
SDL_Log("Window %d resized to %dx%d",
|
||||||
|
event.window.windowID, event.window.data1,
|
||||||
|
event.window.data2);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
||||||
|
SDL_Log("Window %d size changed to %dx%d",
|
||||||
|
event.window.windowID, event.window.data1,
|
||||||
|
event.window.data2);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_MINIMIZED:
|
||||||
|
SDL_Log("Window %d minimized", event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_MAXIMIZED:
|
||||||
|
SDL_Log("Window %d maximized", event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_RESTORED:
|
||||||
|
SDL_Log("Window %d restored", event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_ENTER:
|
||||||
|
SDL_Log("Mouse entered window %d",
|
||||||
|
event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_LEAVE:
|
||||||
|
SDL_Log("Mouse left window %d", event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||||
|
SDL_Log("Window %d gained keyboard focus",
|
||||||
|
event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||||
|
SDL_Log("Window %d lost keyboard focus",
|
||||||
|
event.window.windowID);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_CLOSE:
|
||||||
|
SDL_Log("Window %d closed", event.window.windowID);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SDL_Log("Window %d got unknown event %d",
|
||||||
|
event.window.windowID, event.window.event);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnMouseButtonDown(const SDL_Event& event)
|
||||||
|
{
|
||||||
|
switch (event.button.button)
|
||||||
|
{
|
||||||
|
case SDL_BUTTON_LEFT:
|
||||||
|
OnLButtonDown(event.button.x, event.button.y);
|
||||||
|
break;
|
||||||
|
case SDL_BUTTON_RIGHT:
|
||||||
|
OnRButtonDown(event.button.x, event.button.y);
|
||||||
|
break;
|
||||||
|
case SDL_BUTTON_MIDDLE:
|
||||||
|
OnMButtonDown(event.button.x, event.button.y);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*virtual*/ void cGUIEvent::OnMouseButtonUp(const SDL_Event& event)
|
||||||
|
{
|
||||||
|
switch (event.button.button)
|
||||||
|
{
|
||||||
|
case SDL_BUTTON_LEFT:
|
||||||
|
OnLButtonUp(event.button.x, event.button.y);
|
||||||
|
break;
|
||||||
|
case SDL_BUTTON_RIGHT:
|
||||||
|
OnRButtonUp(event.button.x, event.button.y);
|
||||||
|
break;
|
||||||
|
case SDL_BUTTON_MIDDLE:
|
||||||
|
OnMButtonUp(event.button.x, event.button.y);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
#ifndef _CGUIEVENT_HPP_
|
||||||
|
#define _CGUIEVENT_HPP_
|
||||||
|
|
||||||
|
/*** Custom Header Files ***/
|
||||||
|
#include "../../EventEngine/cEvent.hpp"
|
||||||
|
#include "../GUIHelpers/Enums.hpp"
|
||||||
|
|
||||||
|
/*** DLL Header File ***/
|
||||||
|
#include "dllExport.h"
|
||||||
|
|
||||||
|
#include "../GUIHelpers/cObject.hpp"
|
||||||
|
|
||||||
|
namespace GUIEventEngine {
|
||||||
|
class EXPORT_FROM_MYDLL cGUIEvent : public EventEngine::cEvent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cGUIEvent( const GUIHelpers::eEventType eventType, const unsigned int id );
|
||||||
|
virtual ~cGUIEvent();
|
||||||
|
|
||||||
|
bool operator == (const cGUIEvent& other);
|
||||||
|
|
||||||
|
/// Functions
|
||||||
|
virtual void OnEvent(const SDL_Event& event);
|
||||||
|
|
||||||
|
virtual void OnInputFocus();
|
||||||
|
|
||||||
|
virtual void OnInputBlur();
|
||||||
|
|
||||||
|
virtual void OnKeyDown(SDL_Keycode sym, Uint16 mod);//, Uint16 unicode);
|
||||||
|
|
||||||
|
virtual void OnKeyUp(SDL_Keycode sym, Uint16 mod);//, Uint16 unicode);
|
||||||
|
|
||||||
|
virtual void OnMouseFocus();
|
||||||
|
|
||||||
|
virtual void OnMouseBlur();
|
||||||
|
|
||||||
|
virtual void OnMouseMove(int mX, int mY, int relX, int relY, bool Left, bool Right, bool Middle);
|
||||||
|
|
||||||
|
virtual void OnMouseWheel(bool Up, bool Down); //Not implemented
|
||||||
|
|
||||||
|
virtual void OnLButtonDown(int mX, int mY);
|
||||||
|
|
||||||
|
virtual void OnLButtonUp(int mX, int mY);
|
||||||
|
|
||||||
|
virtual void OnRButtonDown(int mX, int mY);
|
||||||
|
|
||||||
|
virtual void OnRButtonUp(int mX, int mY);
|
||||||
|
|
||||||
|
virtual void OnMButtonDown(int mX, int mY);
|
||||||
|
|
||||||
|
virtual void OnMButtonUp(int mX, int mY);
|
||||||
|
|
||||||
|
virtual void OnJoyAxis(SDL_JoystickID which, Uint8 axis, Sint16 value);
|
||||||
|
|
||||||
|
virtual void OnJoyButtonDown(SDL_JoystickID which, Uint8 button);
|
||||||
|
|
||||||
|
virtual void OnJoyButtonUp(SDL_JoystickID which, Uint8 button);
|
||||||
|
|
||||||
|
virtual void OnJoyHat(SDL_JoystickID which, Uint8 hat, Uint8 value);
|
||||||
|
|
||||||
|
virtual void OnJoyBall(SDL_JoystickID which, Uint8 ball, Sint16 xrel, Sint16 yrel);
|
||||||
|
|
||||||
|
virtual void OnMinimize();
|
||||||
|
|
||||||
|
virtual void OnRestore();
|
||||||
|
|
||||||
|
virtual void OnResize(int w, int h);
|
||||||
|
|
||||||
|
virtual void OnExpose();
|
||||||
|
|
||||||
|
virtual void OnExit();
|
||||||
|
|
||||||
|
virtual void OnUser(Uint32 type, int code, void* data1, void* data2);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void OnWindowsEvent(const SDL_Event& event);
|
||||||
|
void OnMouseButtonDown(const SDL_Event& event);
|
||||||
|
void OnMouseButtonUp(const SDL_Event& event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Variables
|
||||||
|
signed int m_id;// = 0
|
||||||
|
GUIHelpers::eEventType m_eventType;
|
||||||
|
};/// END CLASS DEFINITION cGUIEvent
|
||||||
|
}/// END NAMESPACE DEFINITION GUIEventEngine
|
||||||
|
#endif/// END IFNDEF _CGUIEVENT_HPP_
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
#include "cGUIEventHandler.hpp"
|
||||||
|
|
||||||
|
using GUIEventEngine::cGUIEventHandler;
|
||||||
|
|
||||||
|
cGUIEventHandler::cGUIEventHandler()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
cGUIEventHandler::~cGUIEventHandler()
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < m_events.size(); ++i) {
|
||||||
|
delete m_events[i];
|
||||||
|
m_events[i] = nullptr;
|
||||||
|
}
|
||||||
|
m_events.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Functions
|
||||||
|
void cGUIEventHandler::CheckEvents()
|
||||||
|
{
|
||||||
|
SDL_Event event;
|
||||||
|
while (SDL_PollEvent(&event)) {
|
||||||
|
std::vector<GUIEventEngine::cGUIEvent*>::iterator it;
|
||||||
|
|
||||||
|
for (it = m_events.begin(); it < m_events.end(); it++) {
|
||||||
|
(*it)->OnEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cGUIEventHandler::AddEvents(GUIEventEngine::cGUIEvent* event )
|
||||||
|
{
|
||||||
|
m_events.push_back(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets
|
||||||
|
|
||||||
|
/// Gets
|
||||||
|
std::vector<GUIEventEngine::cGUIEvent*>& cGUIEventHandler::getEvents()
|
||||||
|
{
|
||||||
|
return m_events;
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#ifndef _CGUIEVENTHANDLER_HPP_
|
||||||
|
#define _CGUIEVENTHANDLER_HPP_
|
||||||
|
|
||||||
|
/*** C++ STL Files ***/
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
/*** Custom Header Files ***/
|
||||||
|
#include "../GUIHelpers/Enums.hpp"
|
||||||
|
|
||||||
|
/*** DLL Header File ***/
|
||||||
|
#include "dllExport.h"
|
||||||
|
|
||||||
|
#include "cGUIEvent.hpp"
|
||||||
|
|
||||||
|
namespace GUIEventEngine {
|
||||||
|
class EXPORT_FROM_MYDLL cGUIEventHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cGUIEventHandler();
|
||||||
|
virtual ~cGUIEventHandler();
|
||||||
|
|
||||||
|
bool operator == (const cGUIEventHandler& other);
|
||||||
|
|
||||||
|
/// Functions
|
||||||
|
virtual void CheckEvents();
|
||||||
|
|
||||||
|
void AddEvents( GUIEventEngine::cGUIEvent* event );
|
||||||
|
|
||||||
|
/// Sets
|
||||||
|
|
||||||
|
/// Gets
|
||||||
|
std::vector<GUIEventEngine::cGUIEvent*>& getEvents();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Variables
|
||||||
|
std::vector<GUIEventEngine::cGUIEvent*> m_events;
|
||||||
|
};/// END CLASS DEFINITION cGUIEvent
|
||||||
|
}/// END NAMESPACE DEFINITION GUIEventEngine
|
||||||
|
#endif/// END IFNDEF _CGUIEVENTHANDLER_HPP_
|
||||||
@@ -42,5 +42,12 @@ namespace GUIHelpers {
|
|||||||
BOTTOM,
|
BOTTOM,
|
||||||
LEFT
|
LEFT
|
||||||
};/// END enum DEFINITION eAlign
|
};/// END enum DEFINITION eAlign
|
||||||
|
|
||||||
|
enum EXPORT_FROM_MYDLL eEventType : unsigned int
|
||||||
|
{
|
||||||
|
DEFAULT_EVENT = 0,
|
||||||
|
/// cButton Press
|
||||||
|
BUTTON
|
||||||
|
};/// END enum DEFINITION eEventType
|
||||||
}/// END NAMESPACE DEFINITION GUIEngine
|
}/// END NAMESPACE DEFINITION GUIEngine
|
||||||
#endif/// END IFNDEF _ENUMS_HPP_
|
#endif/// END IFNDEF _ENUMS_HPP_
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#ifndef _CGUIEVENT_HPP_
|
||||||
|
#define _CGUIEVENT_HPP_
|
||||||
|
|
||||||
|
/*** Custom Header Files ***/
|
||||||
|
#include "Enums.hpp"
|
||||||
|
|
||||||
|
/*** DLL Header File ***/
|
||||||
|
#include "dllExport.h"
|
||||||
|
|
||||||
|
namespace GUIHelpers {
|
||||||
|
class EXPORT_FROM_MYDLL cGUIEvent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cGUIEvent( const GUIHelpers::eEventType eventType );
|
||||||
|
virtual ~cGUIEvent();
|
||||||
|
|
||||||
|
bool operator == ( const cGUIEvent& other );
|
||||||
|
|
||||||
|
/// Functions
|
||||||
|
|
||||||
|
/// Sets
|
||||||
|
|
||||||
|
/// Gets
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Variables
|
||||||
|
GUIHelpers::eEventType m_eventType;
|
||||||
|
};/// END CLASS DEFINITION cGUIEvent
|
||||||
|
}/// END NAMESPACE DEFINITION GUIEngine
|
||||||
|
#endif/// END IFNDEF _CGUIEVENT_HPP_
|
||||||
@@ -12,12 +12,10 @@ using MathEngine::iVector4;
|
|||||||
|
|
||||||
/*static*/ const cString cButton::sNAME = "button";
|
/*static*/ const cString cButton::sNAME = "button";
|
||||||
|
|
||||||
cButton::cButton()
|
cButton::cButton( cWindow* parent, const signed int id, const GUIHelpers::eAlign align /*= sALIGN*/, const GUIHelpers::eLayout layout /*= sLAYOUT*/,
|
||||||
{}
|
|
||||||
|
|
||||||
cButton::cButton( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/,
|
|
||||||
const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding/* = sPADDING*/,
|
const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding/* = sPADDING*/,
|
||||||
const cString& name /*= sNAME*/, VideoEngine::cImage** image /*= nullptr*/ )
|
const cString& name /*= sNAME*/, VideoEngine::cImage** image /*= nullptr*/ )
|
||||||
|
: GUIEventEngine::cButtonEvent(id)
|
||||||
{
|
{
|
||||||
Create(parent, id, align, layout, pos, size, padding, name, image);
|
Create(parent, id, align, layout, pos, size, padding, name, image);
|
||||||
// mp_texture = nullptr;
|
// mp_texture = nullptr;
|
||||||
@@ -39,7 +37,7 @@ cButton::cButton( cWindow* parent, const signed int id, const GUIHelpers::eAlign
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/,
|
void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign align /*= sALIGN*/, const GUIHelpers::eLayout layout /*= sLAYOUT*/,
|
||||||
const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
|
const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
|
||||||
const cString& name /*= sNAME*/, VideoEngine::cImage** image /*= nullptr*/ )
|
const cString& name /*= sNAME*/, VideoEngine::cImage** image /*= nullptr*/ )
|
||||||
{
|
{
|
||||||
@@ -57,7 +55,7 @@ void cButton::Display()
|
|||||||
|
|
||||||
m_sprite.setPosition(cWindow::getPosition());
|
m_sprite.setPosition(cWindow::getPosition());
|
||||||
m_sprite.Draw();
|
m_sprite.Draw();
|
||||||
m_sprite.SaveImage("test.bmp", "xml/");
|
//m_sprite.SaveImage("test.bmp", "xml/");
|
||||||
cWindow::Display();
|
cWindow::Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,24 +19,23 @@
|
|||||||
/*** Custom Header Files ***/
|
/*** Custom Header Files ***/
|
||||||
#include "cLayout.hpp"
|
#include "cLayout.hpp"
|
||||||
#include "../UtilityEngine/cString.hpp"
|
#include "../UtilityEngine/cString.hpp"
|
||||||
#include "../EventEngine/cEvent.hpp"
|
#include "GUIEventEngine/cButtonEvent.hpp"
|
||||||
|
|
||||||
using UtilityEngine::cString;
|
using UtilityEngine::cString;
|
||||||
|
|
||||||
namespace GUIEngine {
|
namespace GUIEngine {
|
||||||
class EXPORT_FROM_MYDLL cButton : public cLayout, public EventEngine::cEvent
|
class EXPORT_FROM_MYDLL cButton : public cLayout, public GUIEventEngine::cButtonEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const cString sNAME; /*= "button";*/
|
static const cString sNAME; /*= "button";*/
|
||||||
|
|
||||||
cButton();
|
cButton( cWindow* parent, const signed int id, const GUIHelpers::eAlign align = sALIGN, const GUIHelpers::eLayout layout = sLAYOUT,
|
||||||
cButton( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
|
|
||||||
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
||||||
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
|
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
|
||||||
virtual ~cButton();
|
virtual ~cButton();
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
|
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign align = sALIGN, const GUIHelpers::eLayout layout = sLAYOUT,
|
||||||
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
||||||
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
|
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
|
||||||
|
|
||||||
@@ -53,7 +52,6 @@ namespace GUIEngine {
|
|||||||
virtual const GUIHelpers::RGBA& getDebugColour() const;
|
virtual const GUIHelpers::RGBA& getDebugColour() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateLabel();
|
|
||||||
void GenerateImage();
|
void GenerateImage();
|
||||||
void GenerateTexture();
|
void GenerateTexture();
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "../UtilityEngine/cUtility.hpp"
|
#include "../UtilityEngine/cUtility.hpp"
|
||||||
#include "GUIHelpers/Enums.hpp"
|
#include "GUIHelpers/Enums.hpp"
|
||||||
#include "cButton.hpp"
|
|
||||||
|
|
||||||
#include "GUIHelpers/cXMLoader.hpp"
|
#include "GUIHelpers/cXMLoader.hpp"
|
||||||
|
|
||||||
@@ -66,7 +65,7 @@ const bool cGUI::Initialize( const cString& filename, const cString& dir /*= ""*
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cGUI::Event( const MathEngine::iVector2& location, const eGUIEventType& type )
|
void cGUI::Event( const MathEngine::iVector2& location, const eGUIEventType type )
|
||||||
{
|
{
|
||||||
location;
|
location;
|
||||||
type;
|
type;
|
||||||
@@ -154,7 +153,7 @@ void cGUI::setPadding( const unsigned int top /*= 5*/, const unsigned int right
|
|||||||
setPadding(GUIHelpers::Padding(top, right, bottom, left));
|
setPadding(GUIHelpers::Padding(top, right, bottom, left));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cGUI::setAlign( const GUIHelpers::eAlign& align /*= GUIHelpers::eAlign::CENTER*/ )
|
void cGUI::setAlign( const GUIHelpers::eAlign align /*= GUIHelpers::eAlign::CENTER*/ )
|
||||||
{
|
{
|
||||||
//cWindow::sALIGN = align;
|
//cWindow::sALIGN = align;
|
||||||
}
|
}
|
||||||
@@ -196,7 +195,7 @@ void cGUI::getPadding( unsigned int& top, unsigned int& right, unsigned int& bot
|
|||||||
// left = cWindow::sPADDING.w;
|
// left = cWindow::sPADDING.w;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GUIHelpers::eAlign& cGUI::getAlign() const
|
const GUIHelpers::eAlign cGUI::getAlign() const
|
||||||
{
|
{
|
||||||
/*return cWindow::sALIGN;*/
|
/*return cWindow::sALIGN;*/
|
||||||
return GUIHelpers::eAlign::CENTER;
|
return GUIHelpers::eAlign::CENTER;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace GUIEngine {
|
|||||||
|
|
||||||
const bool Initialize( const cString& filename, const cString& dir = "", const unsigned long int size = 16 );
|
const bool Initialize( const cString& filename, const cString& dir = "", const unsigned long int size = 16 );
|
||||||
|
|
||||||
void Event( const MathEngine::iVector2& location, const eGUIEventType& type );
|
void Event( const MathEngine::iVector2& location, const eGUIEventType type );
|
||||||
const MathEngine::iVector2 DisplayArea() const;
|
const MathEngine::iVector2 DisplayArea() const;
|
||||||
|
|
||||||
void AddObject( GUIEngine::cWindow* obj );
|
void AddObject( GUIEngine::cWindow* obj );
|
||||||
@@ -64,7 +64,7 @@ namespace GUIEngine {
|
|||||||
void setPadding( const GUIHelpers::Padding& padding );
|
void setPadding( const GUIHelpers::Padding& padding );
|
||||||
void setPadding( const unsigned int top = 5, const unsigned int right = 5, const unsigned int bottom = 5, const unsigned int left = 5 );
|
void setPadding( const unsigned int top = 5, const unsigned int right = 5, const unsigned int bottom = 5, const unsigned int left = 5 );
|
||||||
|
|
||||||
void setAlign( const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER );
|
void setAlign( const GUIHelpers::eAlign align = GUIHelpers::eAlign::CENTER );
|
||||||
|
|
||||||
/// Gets
|
/// Gets
|
||||||
const unsigned long int getDebugLevel() const;
|
const unsigned long int getDebugLevel() const;
|
||||||
@@ -77,7 +77,7 @@ namespace GUIEngine {
|
|||||||
const GUIHelpers::Padding& getPadding() const;
|
const GUIHelpers::Padding& getPadding() const;
|
||||||
void getPadding( unsigned int& top, unsigned int& right, unsigned int& bottom, unsigned int& left ) const;
|
void getPadding( unsigned int& top, unsigned int& right, unsigned int& bottom, unsigned int& left ) const;
|
||||||
|
|
||||||
const GUIHelpers::eAlign& getAlign() const;
|
const GUIHelpers::eAlign getAlign() const;
|
||||||
|
|
||||||
const bool IsInit() const;
|
const bool IsInit() const;
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ using GUIEngine::cLabel;
|
|||||||
/*static*/ const cString cLabel::sNAME = "label";
|
/*static*/ const cString cLabel::sNAME = "label";
|
||||||
/*static*/ const GUIHelpers::eLayout cLabel::sLAYOUT = GUIHelpers::eLayout::WRAP_CONTENT;
|
/*static*/ const GUIHelpers::eLayout cLabel::sLAYOUT = GUIHelpers::eLayout::WRAP_CONTENT;
|
||||||
|
|
||||||
cLabel::cLabel( cWindow* parent, const signed int id, const cString& label /*= ""*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
|
cLabel::cLabel( cWindow* parent, const signed int id, const cString& label /*= ""*/, const GUIHelpers::eAlign align /*= sALIGN*/,
|
||||||
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
const GUIHelpers::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
||||||
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
||||||
{
|
{
|
||||||
mp_text = new TextTypeEngine::cText(label);
|
mp_text = new TextTypeEngine::cText(label);
|
||||||
@@ -20,8 +20,8 @@ cLabel::cLabel( cWindow* parent, const signed int id, const cString& label /*= "
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
void cLabel::Create( cWindow* parent, const signed int id, const cString& label /*= ""*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
|
void cLabel::Create( cWindow* parent, const signed int id, const cString& label /*= ""*/, const GUIHelpers::eAlign align /*= sALIGN*/,
|
||||||
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
const GUIHelpers::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
||||||
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
||||||
{
|
{
|
||||||
cWindow::Create(parent, id, sORIENTATION, align, layout, pos, size, padding, name);
|
cWindow::Create(parent, id, sORIENTATION, align, layout, pos, size, padding, name);
|
||||||
@@ -107,7 +107,7 @@ const cString& cLabel::getText() const
|
|||||||
// cWindow::RePos();
|
// cWindow::RePos();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/*virtual*/ void cLabel::RebuildLayout( const GUIHelpers::eLayout& layout )
|
/*virtual*/ void cLabel::RebuildLayout( const GUIHelpers::eLayout layout )
|
||||||
{
|
{
|
||||||
SetSize();
|
SetSize();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ namespace GUIEngine {
|
|||||||
static const cString sNAME; /*= "label";*/
|
static const cString sNAME; /*= "label";*/
|
||||||
static const GUIHelpers::eLayout sLAYOUT;/* = GUIHelpers::eLayout::WRAP_CONTENT;*/
|
static const GUIHelpers::eLayout sLAYOUT;/* = GUIHelpers::eLayout::WRAP_CONTENT;*/
|
||||||
|
|
||||||
cLabel( cWindow* parent, const signed int id, const cString& label = "", const GUIHelpers::eAlign& align = sALIGN,
|
cLabel( cWindow* parent, const signed int id, const cString& label = "", const GUIHelpers::eAlign align = sALIGN,
|
||||||
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
const GUIHelpers::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
||||||
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
||||||
virtual ~cLabel();
|
virtual ~cLabel();
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
void Create( cWindow* parent, const signed int id, const cString& label = "", const GUIHelpers::eAlign& align = sALIGN,
|
void Create( cWindow* parent, const signed int id, const cString& label = "", const GUIHelpers::eAlign align = sALIGN,
|
||||||
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
const GUIHelpers::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
||||||
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
||||||
|
|
||||||
virtual void Display();
|
virtual void Display();
|
||||||
@@ -49,7 +49,7 @@ namespace GUIEngine {
|
|||||||
|
|
||||||
|
|
||||||
//virtual void Resize();
|
//virtual void Resize();
|
||||||
virtual void RebuildLayout( const GUIHelpers::eLayout& layout );
|
virtual void RebuildLayout( const GUIHelpers::eLayout layout );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetSize();
|
void SetSize();
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ using GUIEngine::cLayout;
|
|||||||
/*static*/ const cString cLayout::sNAME = "layout";
|
/*static*/ const cString cLayout::sNAME = "layout";
|
||||||
/*static*/ const GUIHelpers::eOrientation cLayout::sORIENTATION = GUIHelpers::eOrientation::VERTICAL;
|
/*static*/ const GUIHelpers::eOrientation cLayout::sORIENTATION = GUIHelpers::eOrientation::VERTICAL;
|
||||||
|
|
||||||
cLayout::cLayout( cWindow* parent, const signed int id, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
|
cLayout::cLayout( cWindow* parent, const signed int id, const GUIHelpers::eOrientation orientation /*= sORIENTATION*/, const GUIHelpers::eAlign align /*= sALIGN*/,
|
||||||
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
const GUIHelpers::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
||||||
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
||||||
{
|
{
|
||||||
Create(parent, id, orientation, align, layout, pos, size, padding, name);
|
Create(parent, id, orientation, align, layout, pos, size, padding, name);
|
||||||
@@ -16,8 +16,8 @@ cLayout::cLayout( cWindow* parent, const signed int id, const GUIHelpers::eOrien
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
/*virtual*/ void cLayout::Create( cWindow* parent, const signed int id, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
|
/*virtual*/ void cLayout::Create( cWindow* parent, const signed int id, const GUIHelpers::eOrientation orientation /*= sORIENTATION*/, const GUIHelpers::eAlign align /*= sALIGN*/,
|
||||||
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
const GUIHelpers::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
||||||
const GUIHelpers::Padding& padding/* = sPADDING*/, const cString& name /*= sNAME*/ )
|
const GUIHelpers::Padding& padding/* = sPADDING*/, const cString& name /*= sNAME*/ )
|
||||||
{
|
{
|
||||||
GUIHelpers::eOrientation ori = orientation;
|
GUIHelpers::eOrientation ori = orientation;
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ namespace GUIEngine {
|
|||||||
static const cString sNAME; /*= "layout";*/
|
static const cString sNAME; /*= "layout";*/
|
||||||
static const GUIHelpers::eOrientation sORIENTATION; /*= GUIHelpers::eOrientation::VERTICAL;*/
|
static const GUIHelpers::eOrientation sORIENTATION; /*= GUIHelpers::eOrientation::VERTICAL;*/
|
||||||
|
|
||||||
cLayout( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
|
cLayout( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation orientation = sORIENTATION, const GUIHelpers::eAlign align = sALIGN,
|
||||||
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
const GUIHelpers::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
||||||
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
||||||
virtual ~cLayout();
|
virtual ~cLayout();
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
virtual void Create( cWindow* parent, const signed int id, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
|
virtual void Create( cWindow* parent, const signed int id, const GUIHelpers::eOrientation orientation = sORIENTATION, const GUIHelpers::eAlign align = sALIGN,
|
||||||
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
const GUIHelpers::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
||||||
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
||||||
|
|
||||||
virtual void Display();
|
virtual void Display();
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ using GUIEngine::cPanel;
|
|||||||
|
|
||||||
/*static*/ const UtilityEngine::cString cPanel::sNAME = "panel";
|
/*static*/ const UtilityEngine::cString cPanel::sNAME = "panel";
|
||||||
|
|
||||||
cPanel::cPanel( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
|
cPanel::cPanel( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation orientation /*= sORIENTATION*/, const GUIHelpers::eAlign align /*= sALIGN*/,
|
||||||
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
const GUIHelpers::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
||||||
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
||||||
{
|
{
|
||||||
Create( parent, id, orientation, align, layout, pos, size, padding, name );
|
Create( parent, id, orientation, align, layout, pos, size, padding, name );
|
||||||
@@ -16,8 +16,8 @@ cPanel::cPanel( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, con
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
/*virtual*/ void cPanel::Create( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
|
/*virtual*/ void cPanel::Create( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation orientation /*= sORIENTATION*/, const GUIHelpers::eAlign align /*= sALIGN*/,
|
||||||
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
const GUIHelpers::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
||||||
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
||||||
{
|
{
|
||||||
padding;
|
padding;
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ namespace GUIEngine {
|
|||||||
static const UtilityEngine::cString sNAME; /*= "panel";*/
|
static const UtilityEngine::cString sNAME; /*= "panel";*/
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cPanel( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
|
cPanel( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation orientation = sORIENTATION, const GUIHelpers::eAlign align = sALIGN,
|
||||||
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
const GUIHelpers::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
||||||
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
||||||
virtual ~cPanel();
|
virtual ~cPanel();
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
virtual void Create( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
|
virtual void Create( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation orientation = sORIENTATION, const GUIHelpers::eAlign align = sALIGN,
|
||||||
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
const GUIHelpers::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
||||||
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
||||||
|
|
||||||
virtual void Display();
|
virtual void Display();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using GUIEngine::cSizer;
|
|||||||
/*static*/ const cString cSizer::sNAME = "sizer";
|
/*static*/ const cString cSizer::sNAME = "sizer";
|
||||||
/*static*/ GUIHelpers::Size cSizer::sSIZE = { 5, 5 };
|
/*static*/ GUIHelpers::Size cSizer::sSIZE = { 5, 5 };
|
||||||
|
|
||||||
cSizer::cSizer( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/,
|
cSizer::cSizer( cWindow* parent, const signed int id, const GUIHelpers::eAlign align /*= sALIGN*/, const GUIHelpers::eLayout layout /*= sLAYOUT*/,
|
||||||
const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
|
const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
|
||||||
const cString& name /*= sNAME*/ )
|
const cString& name /*= sNAME*/ )
|
||||||
{
|
{
|
||||||
@@ -16,7 +16,7 @@ cSizer::cSizer( cWindow* parent, const signed int id, const GUIHelpers::eAlign&
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
void cSizer::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/,
|
void cSizer::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign align /*= sALIGN*/, const GUIHelpers::eLayout layout /*= sLAYOUT*/,
|
||||||
const GUIHelpers::Position& pos/* = sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
|
const GUIHelpers::Position& pos/* = sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
|
||||||
const cString& name /*= sNAME*/ )
|
const cString& name /*= sNAME*/ )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ namespace GUIEngine {
|
|||||||
static const cString sNAME; /*= "sizer";*/
|
static const cString sNAME; /*= "sizer";*/
|
||||||
static GUIHelpers::Size sSIZE; /*= { 5, 5 }*/
|
static GUIHelpers::Size sSIZE; /*= { 5, 5 }*/
|
||||||
|
|
||||||
cSizer( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
|
cSizer( cWindow* parent, const signed int id, const GUIHelpers::eAlign align = sALIGN, const GUIHelpers::eLayout layout = sLAYOUT,
|
||||||
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
||||||
const cString& name = sNAME );
|
const cString& name = sNAME );
|
||||||
virtual ~cSizer();
|
virtual ~cSizer();
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
|
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign align = sALIGN, const GUIHelpers::eLayout layout = sLAYOUT,
|
||||||
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
|
||||||
const cString& name = sNAME );
|
const cString& name = sNAME );
|
||||||
|
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
#include "cTextButton.hpp"
|
|
||||||
|
|
||||||
using GUIEngine::cTextButton;
|
|
||||||
|
|
||||||
/*static*/ const cString cTextButton::sNAME = "textButton";
|
|
||||||
|
|
||||||
cTextButton::cTextButton( cWindow* parent, const signed int id, const cString& text, const GUIHelpers::eAlign& align /*= GUIHelpers::eAlign::CENTER*/,
|
|
||||||
const GUIHelpers::eLayout& layout /*= GUIHelpers::eLayout::FILL_PARENT*/, const GUIHelpers::Position& pos /*= POSITION*/,
|
|
||||||
const GUIHelpers::Size& size /*= SIZE*/, const GUIHelpers::Padding& padding /*= PADDING*/, const cString& name /*= NAME*/ )
|
|
||||||
: m_label(this, -1, text)
|
|
||||||
{
|
|
||||||
Create(parent, id, text, align, layout, pos, size, padding, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*virtual*/ cTextButton::~cTextButton()
|
|
||||||
{}
|
|
||||||
|
|
||||||
///Functions
|
|
||||||
void cTextButton::Create( cWindow* parent, const signed int id, const cString& text, const GUIHelpers::eAlign& align /*= GUIHelpers::eAlign::CENTER*/,
|
|
||||||
const GUIHelpers::eLayout& layout /*= GUIHelpers::eLayout::FILL_PARENT*/, const GUIHelpers::Position& pos /*= POSITION*/,
|
|
||||||
const GUIHelpers::Size& size /*= SIZE*/, const GUIHelpers::Padding& padding /*= PADDING*/, const cString& name /*= NAME*/ )
|
|
||||||
{
|
|
||||||
cButton::Create(parent, id, align, layout, pos, size, padding, name);
|
|
||||||
setText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Sets
|
|
||||||
void cTextButton::setText( const cString& text )
|
|
||||||
{
|
|
||||||
m_label.setText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void cTextButton::setTextColour( const GUIHelpers::RGBA& colour )
|
|
||||||
{
|
|
||||||
m_label.setFontColour(colour);
|
|
||||||
}
|
|
||||||
|
|
||||||
void cTextButton::setTextSize( const unsigned long int size )
|
|
||||||
{
|
|
||||||
m_label.setSize(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Gets
|
|
||||||
const cString& cTextButton::getText() const
|
|
||||||
{
|
|
||||||
return m_label.getText();
|
|
||||||
}
|
|
||||||
|
|
||||||
const GUIHelpers::RGBA& cTextButton::getTextColour()
|
|
||||||
{
|
|
||||||
return m_label.getFontColour();
|
|
||||||
}
|
|
||||||
|
|
||||||
const unsigned long int cTextButton::getTextSize()
|
|
||||||
{
|
|
||||||
return m_label.getFontSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*virtual*/ const GUIHelpers::eType cTextButton::getType() const
|
|
||||||
{
|
|
||||||
return GUIHelpers::eType::CTEXTBUTTON;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Private
|
|
||||||
void CreateLabel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
void GenerateImage()
|
|
||||||
{}
|
|
||||||
|
|
||||||
void GenerateTexture()
|
|
||||||
{}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
#ifndef _CTEXTBUTTON_HPP_
|
|
||||||
#define _CTEXTBUTTON_HPP_
|
|
||||||
|
|
||||||
/*** SDL Header Files ***/
|
|
||||||
#include <SDL.h>
|
|
||||||
|
|
||||||
/*** Custom Header Files ***/
|
|
||||||
#include "cButton.hpp"
|
|
||||||
#include "cLabel.hpp"
|
|
||||||
|
|
||||||
#include "GUIHelpers/Enums.hpp"
|
|
||||||
#include "GUIHelpers/GUIUtility.hpp"
|
|
||||||
#include "../VideoEngine/cSprite.hpp"
|
|
||||||
#include "../VideoEngine/cImage.hpp"
|
|
||||||
#include "../MathEngine/iVector/iVector2.hpp"
|
|
||||||
|
|
||||||
/*** DLL Header File ***/
|
|
||||||
#include "dllExport.h"
|
|
||||||
|
|
||||||
/*** Custom Header Files ***/
|
|
||||||
#include "../UtilityEngine/cString.hpp"
|
|
||||||
|
|
||||||
using UtilityEngine::cString;
|
|
||||||
|
|
||||||
namespace GUIEngine {
|
|
||||||
class EXPORT_FROM_MYDLL cTextButton : public cButton
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static const cString sNAME; /*= "button";*/
|
|
||||||
|
|
||||||
cTextButton( cWindow* parent, const signed int id, const cString& text, const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER,
|
|
||||||
const GUIHelpers::eLayout& layout = GUIHelpers::eLayout::FILL_PARENT, const GUIHelpers::Position& pos = sPOSITION,
|
|
||||||
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
|
||||||
virtual ~cTextButton();
|
|
||||||
|
|
||||||
/// Functions
|
|
||||||
void Create( cWindow* parent, const signed int id, const cString& text, const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER,
|
|
||||||
const GUIHelpers::eLayout& layout = GUIHelpers::eLayout::FILL_PARENT, const GUIHelpers::Position& pos = sPOSITION,
|
|
||||||
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
|
||||||
|
|
||||||
/// Sets
|
|
||||||
void setText( const cString& text );
|
|
||||||
void setTextColour( const GUIHelpers::RGBA& colour );
|
|
||||||
void setTextSize( const unsigned long int size );
|
|
||||||
|
|
||||||
/// Gets
|
|
||||||
const cString& getText() const;
|
|
||||||
const GUIHelpers::RGBA& getTextColour();
|
|
||||||
const unsigned long int getTextSize();
|
|
||||||
|
|
||||||
virtual const GUIHelpers::eType getType() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void CreateLabel();
|
|
||||||
void GenerateImage();
|
|
||||||
void GenerateTexture();
|
|
||||||
|
|
||||||
private:
|
|
||||||
/// Variables
|
|
||||||
cLabel m_label;/// = nullptr
|
|
||||||
};/// END CLASS DEFINITION cButton
|
|
||||||
}/// END NAMESPACE DEFINITION GUIEngine
|
|
||||||
#endif/// END IFNDEF _CBUTTON_HPP_
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
#include "cWindow.hpp"
|
#include "cWindow.hpp"
|
||||||
|
|
||||||
|
|
||||||
#include "../FXEngine/cGFX.hpp"
|
#include "../FXEngine/cGFX.hpp"
|
||||||
#include "../UtilityEngine/cUtility.hpp"
|
#include "../UtilityEngine/cUtility.hpp"
|
||||||
|
|
||||||
@@ -20,8 +19,8 @@ using GUIEngine::cWindow;
|
|||||||
/*static*/ GUIHelpers::eLayout cWindow::sLAYOUT = GUIHelpers::eLayout::FILL_PARENT;
|
/*static*/ GUIHelpers::eLayout cWindow::sLAYOUT = GUIHelpers::eLayout::FILL_PARENT;
|
||||||
/*static*/ GUIHelpers::eOrientation cWindow::sORIENTATION = GUIHelpers::eOrientation::NONE;
|
/*static*/ GUIHelpers::eOrientation cWindow::sORIENTATION = GUIHelpers::eOrientation::NONE;
|
||||||
|
|
||||||
cWindow::cWindow( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
|
cWindow::cWindow( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation orientation /*= sORIENTATION*/, const GUIHelpers::eAlign align /*= sALIGN*/,
|
||||||
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
const GUIHelpers::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
||||||
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
||||||
: cObject(id)
|
: cObject(id)
|
||||||
{
|
{
|
||||||
@@ -37,8 +36,8 @@ cWindow::cWindow( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, c
|
|||||||
m_children.clear();
|
m_children.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ void cWindow::Create( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
|
/*virtual*/ void cWindow::Create( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation orientation /*= sORIENTATION*/, const GUIHelpers::eAlign align /*= sALIGN*/,
|
||||||
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
const GUIHelpers::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
|
||||||
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
|
||||||
{
|
{
|
||||||
mp_parent = parent;
|
mp_parent = parent;
|
||||||
@@ -119,25 +118,25 @@ const bool cWindow::RemoveChild( cWindow* obj )
|
|||||||
sPADDING = pad;
|
sPADDING = pad;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ void cWindow::AlignDefault( const GUIHelpers::eAlign& align )
|
/*static*/ void cWindow::AlignDefault( const GUIHelpers::eAlign align )
|
||||||
{
|
{
|
||||||
if (align != GUIHelpers::eAlign::DEFAULT_ALIGN)
|
if (align != GUIHelpers::eAlign::DEFAULT_ALIGN)
|
||||||
sALIGN = align;
|
sALIGN = align;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ void cWindow::LayoutDefault( const GUIHelpers::eLayout& layout )
|
/*static*/ void cWindow::LayoutDefault( const GUIHelpers::eLayout layout )
|
||||||
{
|
{
|
||||||
if (layout != GUIHelpers::eLayout::DEFAULT_LAYOUT)
|
if (layout != GUIHelpers::eLayout::DEFAULT_LAYOUT)
|
||||||
sLAYOUT = layout;
|
sLAYOUT = layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ void cWindow::OrientationDefault( const GUIHelpers::eOrientation& orientation )
|
/*static*/ void cWindow::OrientationDefault( const GUIHelpers::eOrientation orientation )
|
||||||
{
|
{
|
||||||
if (orientation != GUIHelpers::eOrientation::DEFAULT_ORIENTATION)
|
if (orientation != GUIHelpers::eOrientation::DEFAULT_ORIENTATION)
|
||||||
sORIENTATION = orientation;
|
sORIENTATION = orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cWindow::setOrientation( const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/ )
|
void cWindow::setOrientation( const GUIHelpers::eOrientation orientation /*= sORIENTATION*/ )
|
||||||
{
|
{
|
||||||
if (orientation == GUIHelpers::eOrientation::DEFAULT_ORIENTATION)
|
if (orientation == GUIHelpers::eOrientation::DEFAULT_ORIENTATION)
|
||||||
m_orientation = cWindow::sORIENTATION;
|
m_orientation = cWindow::sORIENTATION;
|
||||||
@@ -145,7 +144,7 @@ void cWindow::setOrientation( const GUIHelpers::eOrientation& orientation /*= sO
|
|||||||
m_orientation = orientation;
|
m_orientation = orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cWindow::setAlign( const GUIHelpers::eAlign& align /*= sALIGN*/ )
|
void cWindow::setAlign( const GUIHelpers::eAlign align /*= sALIGN*/ )
|
||||||
{
|
{
|
||||||
if (align == GUIHelpers::eAlign::DEFAULT_ALIGN)
|
if (align == GUIHelpers::eAlign::DEFAULT_ALIGN)
|
||||||
m_align = cWindow::sALIGN;
|
m_align = cWindow::sALIGN;
|
||||||
@@ -154,7 +153,7 @@ void cWindow::setAlign( const GUIHelpers::eAlign& align /*= sALIGN*/ )
|
|||||||
RebuildPos();
|
RebuildPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cWindow::setLayout( const GUIHelpers::eLayout& layout /*= sLAYOUT*/ )
|
void cWindow::setLayout( const GUIHelpers::eLayout layout /*= sLAYOUT*/ )
|
||||||
{
|
{
|
||||||
if (layout == GUIHelpers::eLayout::DEFAULT_LAYOUT)
|
if (layout == GUIHelpers::eLayout::DEFAULT_LAYOUT)
|
||||||
m_layout = cWindow::sLAYOUT;
|
m_layout = cWindow::sLAYOUT;
|
||||||
@@ -214,17 +213,17 @@ const GUIHelpers::Position cWindow::getCenter( const bool pad /*= true*/ ) const
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GUIHelpers::eOrientation& cWindow::getOrientation() const
|
const GUIHelpers::eOrientation cWindow::getOrientation() const
|
||||||
{
|
{
|
||||||
return m_orientation;
|
return m_orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GUIHelpers::eAlign& cWindow::getAlign() const
|
const GUIHelpers::eAlign cWindow::getAlign() const
|
||||||
{
|
{
|
||||||
return m_align;
|
return m_align;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GUIHelpers::eLayout& cWindow::getLayout() const
|
const GUIHelpers::eLayout cWindow::getLayout() const
|
||||||
{
|
{
|
||||||
if (m_layout == GUIHelpers::eLayout::MATCH_PARENT) {
|
if (m_layout == GUIHelpers::eLayout::MATCH_PARENT) {
|
||||||
if (mp_parent != nullptr)
|
if (mp_parent != nullptr)
|
||||||
@@ -257,6 +256,21 @@ const GUIHelpers::Size cWindow::getSize( const bool pad /*= true*/ ) const
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GUIHelpers::Area cWindow::getArea( const bool pad /*= false*/ ) const
|
||||||
|
{
|
||||||
|
GUIHelpers::Area rtn = { 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
GUIHelpers::Position tmp = getPosition(false);
|
||||||
|
rtn.x = tmp.x;
|
||||||
|
rtn.y = tmp.y;
|
||||||
|
|
||||||
|
GUIHelpers::Size tmp2 = getSize(false);
|
||||||
|
rtn.w = tmp2.x;
|
||||||
|
rtn.h = tmp2.y;
|
||||||
|
|
||||||
|
return rtn;
|
||||||
|
}
|
||||||
|
|
||||||
const GUIHelpers::Padding& cWindow::getPadding() const
|
const GUIHelpers::Padding& cWindow::getPadding() const
|
||||||
{
|
{
|
||||||
return m_padding;
|
return m_padding;
|
||||||
@@ -343,7 +357,7 @@ const unsigned long int cWindow::getFillParentSize()
|
|||||||
RePos();
|
RePos();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ void cWindow::RebuildLayout( const GUIHelpers::eLayout& layout )
|
/*virtual*/ void cWindow::RebuildLayout( const GUIHelpers::eLayout layout )
|
||||||
{
|
{
|
||||||
GUIHelpers::Size mySize = { 0, 0 };
|
GUIHelpers::Size mySize = { 0, 0 };
|
||||||
std::vector<cWindow*>::iterator it;
|
std::vector<cWindow*>::iterator it;
|
||||||
@@ -510,7 +524,7 @@ std::vector<cWindow*>& cWindow::getChildren()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// private
|
/// private
|
||||||
void cWindow::Rebuild(cWindow * const parent, const GUIHelpers::eLayout & layout)
|
void cWindow::Rebuild(cWindow * const parent, const GUIHelpers::eLayout layout)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
#ifndef _CWINDOW_HPP_
|
#ifndef _CWINDOW_HPP_
|
||||||
#define _CWINDOW_HPP_
|
#define _CWINDOW_HPP_
|
||||||
|
|
||||||
|
/*** C++ STL Files ***/
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
/*** SDL Header Files ***/
|
/*** SDL Header Files ***/
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
@@ -32,16 +35,16 @@ namespace GUIEngine {
|
|||||||
static GUIHelpers::eOrientation sORIENTATION; /*= GUIHelpers::eOrientation::NONE;*/
|
static GUIHelpers::eOrientation sORIENTATION; /*= GUIHelpers::eOrientation::NONE;*/
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cWindow( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
|
cWindow( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation orientation = sORIENTATION, const GUIHelpers::eAlign align = sALIGN,
|
||||||
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
const GUIHelpers::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
||||||
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~cWindow();
|
virtual ~cWindow();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void Create( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
|
virtual void Create( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation orientation = sORIENTATION, const GUIHelpers::eAlign align = sALIGN,
|
||||||
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
const GUIHelpers::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
|
||||||
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -58,13 +61,13 @@ namespace GUIEngine {
|
|||||||
static void PositionDefault( const GUIHelpers::Position& pos );
|
static void PositionDefault( const GUIHelpers::Position& pos );
|
||||||
static void SizeDefault( const GUIHelpers::Size& size );
|
static void SizeDefault( const GUIHelpers::Size& size );
|
||||||
static void PaddingDefault( const GUIHelpers::Padding& pad );
|
static void PaddingDefault( const GUIHelpers::Padding& pad );
|
||||||
static void AlignDefault( const GUIHelpers::eAlign& align );
|
static void AlignDefault( const GUIHelpers::eAlign align );
|
||||||
static void LayoutDefault( const GUIHelpers::eLayout& layout );
|
static void LayoutDefault( const GUIHelpers::eLayout layout );
|
||||||
static void OrientationDefault( const GUIHelpers::eOrientation& orientation );
|
static void OrientationDefault( const GUIHelpers::eOrientation orientation );
|
||||||
|
|
||||||
void setOrientation( const GUIHelpers::eOrientation& orientation = sORIENTATION );
|
void setOrientation( const GUIHelpers::eOrientation orientation = sORIENTATION );
|
||||||
void setAlign( const GUIHelpers::eAlign& align = sALIGN );
|
void setAlign( const GUIHelpers::eAlign align = sALIGN );
|
||||||
void setLayout( const GUIHelpers::eLayout& layout = sLAYOUT );
|
void setLayout( const GUIHelpers::eLayout layout = sLAYOUT );
|
||||||
void setPosition( const GUIHelpers::Position& pos = sPOSITION );
|
void setPosition( const GUIHelpers::Position& pos = sPOSITION );
|
||||||
void setSize( const GUIHelpers::Size& size = sSIZE );
|
void setSize( const GUIHelpers::Size& size = sSIZE );
|
||||||
void setPadding( const GUIHelpers::Padding& padding = sPADDING );
|
void setPadding( const GUIHelpers::Padding& padding = sPADDING );
|
||||||
@@ -76,11 +79,12 @@ namespace GUIEngine {
|
|||||||
/// Gets
|
/// Gets
|
||||||
const GUIHelpers::Position getCenter( const bool pad = true ) const;
|
const GUIHelpers::Position getCenter( const bool pad = true ) const;
|
||||||
|
|
||||||
const GUIHelpers::eOrientation& getOrientation() const;
|
const GUIHelpers::eOrientation getOrientation() const;
|
||||||
const GUIHelpers::eAlign& getAlign() const;
|
const GUIHelpers::eAlign getAlign() const;
|
||||||
const GUIHelpers::eLayout& getLayout() const;
|
const GUIHelpers::eLayout getLayout() const;
|
||||||
const GUIHelpers::Position getPosition( const bool pad = true ) const;
|
const GUIHelpers::Position getPosition( const bool pad = true ) const;
|
||||||
const GUIHelpers::Size getSize( const bool pad = true ) const;
|
const GUIHelpers::Size getSize( const bool pad = true ) const;
|
||||||
|
const GUIHelpers::Area getArea( const bool pad = false ) const;
|
||||||
const GUIHelpers::Padding& getPadding() const;
|
const GUIHelpers::Padding& getPadding() const;
|
||||||
const GUIHelpers::Size& getContentSize() const;
|
const GUIHelpers::Size& getContentSize() const;
|
||||||
const cString& getName() const;
|
const cString& getName() const;
|
||||||
@@ -94,7 +98,7 @@ namespace GUIEngine {
|
|||||||
virtual const GUIHelpers::eType getType() const;
|
virtual const GUIHelpers::eType getType() const;
|
||||||
|
|
||||||
virtual void Resize();
|
virtual void Resize();
|
||||||
virtual void RebuildLayout( const GUIHelpers::eLayout& layout );
|
virtual void RebuildLayout( const GUIHelpers::eLayout layout );
|
||||||
|
|
||||||
virtual void RePos();
|
virtual void RePos();
|
||||||
virtual void RebuildPos();
|
virtual void RebuildPos();
|
||||||
@@ -105,7 +109,7 @@ namespace GUIEngine {
|
|||||||
std::vector<cWindow*>& getChildren();
|
std::vector<cWindow*>& getChildren();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Rebuild( cWindow* const parent, const GUIHelpers::eLayout& layout );
|
void Rebuild( cWindow* const parent, const GUIHelpers::eLayout layout );
|
||||||
|
|
||||||
void AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const;
|
void AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,136 @@
|
|||||||
|
#include "cInside.hpp"
|
||||||
|
|
||||||
|
using MathEngine::cInside;
|
||||||
|
using MathEngine::Vector4;
|
||||||
|
using MathEngine::Vector2;
|
||||||
|
using MathEngine::iVector4;
|
||||||
|
using MathEngine::iVector2;
|
||||||
|
|
||||||
|
cInside::cInside()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
cInside::~cInside()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Functions
|
||||||
|
/*static*/ const Vector2 cInside::Inside(const Vector4& a, const Vector4& b)
|
||||||
|
{
|
||||||
|
Vector2 rtn;
|
||||||
|
rtn.x = 0.0f;
|
||||||
|
rtn.y = 0.0f;
|
||||||
|
|
||||||
|
/// Check if left side of b is inside of a
|
||||||
|
if (b.x < a.x)
|
||||||
|
rtn.x = a.x - b.x;
|
||||||
|
/// Check if right side of b is inside of a
|
||||||
|
if ((b.x + b.z) > (a.x + a.z))
|
||||||
|
rtn.x = (a.x + a.z) - (b.x + b.z);
|
||||||
|
/// Check if top side of b is inside of a
|
||||||
|
if (b.y < a.y)
|
||||||
|
rtn.y = a.y - b.y;
|
||||||
|
/// Check if bottom side of b is inside of a
|
||||||
|
if ((b.y + b.w) > (a.y + a.w))
|
||||||
|
rtn.y = (a.y + a.w) - (b.y + b.w);
|
||||||
|
|
||||||
|
return rtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const Vector2 cInside::Inside(const SDL_Rect& a, const Vector4& b)
|
||||||
|
{
|
||||||
|
Vector4 temp = a;
|
||||||
|
|
||||||
|
return cInside::Inside(temp, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const Vector2 cInside::Inside(const Vector4& a, const SDL_Rect& b)
|
||||||
|
{
|
||||||
|
Vector4 temp = b;
|
||||||
|
|
||||||
|
return cInside::Inside(a, temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const bool cInside::isInside(const signed long int x, const signed long int y, const SDL_Rect& inside)
|
||||||
|
{
|
||||||
|
iVector4 temp = inside;
|
||||||
|
return cInside::isInside(x, y, temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const bool cInside::isInside(const signed long int x, const signed long int y, const iVector4& inside)
|
||||||
|
{
|
||||||
|
bool rtn = false;
|
||||||
|
if ((inside.x < x) && (inside.w > x)) {
|
||||||
|
if ((inside.y < y) && (inside.z > y))
|
||||||
|
rtn = true;
|
||||||
|
}
|
||||||
|
return rtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const iVector2 cInside::Inside(const SDL_Rect& a, const SDL_Rect& b)
|
||||||
|
{
|
||||||
|
iVector2 rtn;
|
||||||
|
rtn.x = 0.0f;
|
||||||
|
rtn.y = 0.0f;
|
||||||
|
|
||||||
|
/// Check if left side of b is inside of a
|
||||||
|
if (b.x < a.x)
|
||||||
|
rtn.x = (float)(b.x - a.x);
|
||||||
|
/// Check if right side of b is inside of a
|
||||||
|
if ((b.x + b.w) > (a.x + a.w))
|
||||||
|
rtn.x = (float)((b.x + b.w) - (a.x + a.w));
|
||||||
|
/// Check if top side of b is inside of a
|
||||||
|
if (b.y < a.y)
|
||||||
|
rtn.y = (float)(b.y - a.y);
|
||||||
|
/// Check if bottom side of b is inside of a
|
||||||
|
if ((b.y + b.h) > (a.y + a.h))
|
||||||
|
rtn.y = (float)((b.y + b.h) - (a.y + a.h));
|
||||||
|
|
||||||
|
return rtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const iVector2 cInside::Inside(const iVector4& a, const iVector4& b)
|
||||||
|
{
|
||||||
|
iVector2 rtn;
|
||||||
|
rtn.x = 0;
|
||||||
|
rtn.y = 0;
|
||||||
|
|
||||||
|
/// Check if left side of b is inside of a
|
||||||
|
if (b.x < a.x)
|
||||||
|
rtn.x = b.x - a.x;
|
||||||
|
/// Check if right side of b is inside of a
|
||||||
|
if ((b.x + b.z) > (a.x + a.z))
|
||||||
|
rtn.x = (b.x + b.z) - (a.x + a.z);
|
||||||
|
/// Check if top side of b is inside of a
|
||||||
|
if (b.y < a.y)
|
||||||
|
rtn.y = b.y - a.y;
|
||||||
|
/// Check if bottom side of b is inside of a
|
||||||
|
if ((b.y + b.w) > (a.y + a.w))
|
||||||
|
rtn.y = (b.y + b.w) - (a.y + a.w);
|
||||||
|
|
||||||
|
return rtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const iVector2 cInside::Inside(const SDL_Rect& a, const iVector4& b)
|
||||||
|
{
|
||||||
|
iVector4 temp = a;
|
||||||
|
|
||||||
|
return cInside::Inside(temp, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const iVector2 cInside::Inside(const iVector4& a, const SDL_Rect& b)
|
||||||
|
{
|
||||||
|
return cInside::Inside(b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const Vector2 cInside::Inside(const iVector4& a, const Vector4& b)
|
||||||
|
{
|
||||||
|
Vector4 temp = a;
|
||||||
|
|
||||||
|
return cInside::Inside(temp, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static*/ const Vector2 cInside::Inside(const Vector4& a, const iVector4& b)
|
||||||
|
{
|
||||||
|
return cInside::Inside(b, a);
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
#ifndef _CINSIDE_HPP_
|
||||||
|
#define _CINSIDE_HPP_
|
||||||
|
|
||||||
|
/*** SDL Header Files ***/
|
||||||
|
#include <SDL.h>
|
||||||
|
|
||||||
|
/*** DLL Header File ***/
|
||||||
|
#include "dllExport.h"
|
||||||
|
|
||||||
|
/*** Custom Header File ***/
|
||||||
|
#include "Vector/Vector2.hpp"
|
||||||
|
#include "iVector/iVector2.hpp"
|
||||||
|
|
||||||
|
#include "Vector/Vector4.hpp"
|
||||||
|
#include "iVector/iVector4.hpp"
|
||||||
|
|
||||||
|
namespace MathEngine {
|
||||||
|
class EXPORT_FROM_MYDLL cInside
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
cInside();
|
||||||
|
~cInside();
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// Functions
|
||||||
|
/* returns the Vector2 were a over laps b */
|
||||||
|
static const Vector2 Inside(const Vector4& a, const Vector4& b);
|
||||||
|
/* returns the Vector2 were a over laps b */
|
||||||
|
static const Vector2 Inside(const SDL_Rect& a, const Vector4& b);
|
||||||
|
/* returns the Vector2 were a over laps b */
|
||||||
|
static const Vector2 Inside(const Vector4& a, const SDL_Rect& b);
|
||||||
|
|
||||||
|
/* returns true if xy are inside SDL_Rect */
|
||||||
|
static const bool isInside(const signed long int x, const signed long int y, const SDL_Rect& inside);
|
||||||
|
/* returns true if xy are inside iVector4 */
|
||||||
|
static const bool isInside(const signed long int x, const signed long int y, const iVector4& inside);
|
||||||
|
|
||||||
|
/* returns the iVector2 were a over laps b */
|
||||||
|
static const iVector2 Inside(const SDL_Rect& a, const SDL_Rect& b);
|
||||||
|
/* returns the iVector2 were a over laps b */
|
||||||
|
static const iVector2 Inside(const iVector4& a, const iVector4& b);
|
||||||
|
/* returns the iVector2 were a over laps b */
|
||||||
|
static const iVector2 Inside(const SDL_Rect& a, const iVector4& b);
|
||||||
|
/* returns the iVector2 were a over laps b */
|
||||||
|
static const iVector2 Inside(const iVector4& a, const SDL_Rect& b);
|
||||||
|
|
||||||
|
static const Vector2 Inside(const iVector4& a, const Vector4& b);
|
||||||
|
static const Vector2 Inside(const Vector4& a, const iVector4& b);
|
||||||
|
};/// END CLASS DEFINITION cInside
|
||||||
|
}/// END NAMESPACE DEFINITION MathEngine
|
||||||
|
#endif/// END IFNDEF _CINSIDE_HPP_
|
||||||
@@ -132,8 +132,11 @@
|
|||||||
<ClInclude Include="TrooperEngine\GUIEngine\cLayout.hpp" />
|
<ClInclude Include="TrooperEngine\GUIEngine\cLayout.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\GUIEngine\cPanel.hpp" />
|
<ClInclude Include="TrooperEngine\GUIEngine\cPanel.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\GUIEngine\cLabel.hpp" />
|
<ClInclude Include="TrooperEngine\GUIEngine\cLabel.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\GUIEngine\cTextButton.hpp" />
|
|
||||||
<ClInclude Include="TrooperEngine\GUIEngine\cWindow.hpp" />
|
<ClInclude Include="TrooperEngine\GUIEngine\cWindow.hpp" />
|
||||||
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIEventEngine\cButtonEvent.hpp" />
|
||||||
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIEventEngine\cGUIEvent.hpp" />
|
||||||
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIEventEngine\cGUIEventHandler.hpp" />
|
||||||
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIEventEngine\Event.h" />
|
||||||
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cTexture.hpp" />
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cTexture.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cObject.hpp" />
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cObject.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.hpp" />
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.hpp" />
|
||||||
@@ -146,6 +149,7 @@
|
|||||||
<ClInclude Include="TrooperEngine\InputEngine\cMouse.hpp" />
|
<ClInclude Include="TrooperEngine\InputEngine\cMouse.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\InputEngine\cTextInput.hpp" />
|
<ClInclude Include="TrooperEngine\InputEngine\cTextInput.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\MathEngine\cCollision.hpp" />
|
<ClInclude Include="TrooperEngine\MathEngine\cCollision.hpp" />
|
||||||
|
<ClInclude Include="TrooperEngine\MathEngine\cInside.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\MathEngine\iVector\iVector2.hpp" />
|
<ClInclude Include="TrooperEngine\MathEngine\iVector\iVector2.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\MathEngine\iVector\iVector3.hpp" />
|
<ClInclude Include="TrooperEngine\MathEngine\iVector\iVector3.hpp" />
|
||||||
<ClInclude Include="TrooperEngine\MathEngine\iVector\iVector4.hpp" />
|
<ClInclude Include="TrooperEngine\MathEngine\iVector\iVector4.hpp" />
|
||||||
@@ -184,8 +188,10 @@
|
|||||||
<ClCompile Include="TrooperEngine\GUIEngine\cLayout.cpp" />
|
<ClCompile Include="TrooperEngine\GUIEngine\cLayout.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\GUIEngine\cLabel.cpp" />
|
<ClCompile Include="TrooperEngine\GUIEngine\cLabel.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\GUIEngine\cPanel.cpp" />
|
<ClCompile Include="TrooperEngine\GUIEngine\cPanel.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\GUIEngine\cTextButton.cpp" />
|
|
||||||
<ClCompile Include="TrooperEngine\GUIEngine\cWindow.cpp" />
|
<ClCompile Include="TrooperEngine\GUIEngine\cWindow.cpp" />
|
||||||
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIEventEngine\cButtonEvent.cpp" />
|
||||||
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIEventEngine\cGUIEvent.cpp" />
|
||||||
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIEventEngine\cGUIEventHandler.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cObject.cpp" />
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cObject.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cTexture.cpp" />
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cTexture.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.cpp" />
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.cpp" />
|
||||||
@@ -197,6 +203,7 @@
|
|||||||
<ClCompile Include="TrooperEngine\InputEngine\cMouse.cpp" />
|
<ClCompile Include="TrooperEngine\InputEngine\cMouse.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\InputEngine\cTextInput.cpp" />
|
<ClCompile Include="TrooperEngine\InputEngine\cTextInput.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\MathEngine\cCollision.cpp" />
|
<ClCompile Include="TrooperEngine\MathEngine\cCollision.cpp" />
|
||||||
|
<ClCompile Include="TrooperEngine\MathEngine\cInside.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\MathEngine\iVector\iVector2.cpp" />
|
<ClCompile Include="TrooperEngine\MathEngine\iVector\iVector2.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\MathEngine\iVector\iVector3.cpp" />
|
<ClCompile Include="TrooperEngine\MathEngine\iVector\iVector3.cpp" />
|
||||||
<ClCompile Include="TrooperEngine\MathEngine\iVector\iVector4.cpp" />
|
<ClCompile Include="TrooperEngine\MathEngine\iVector\iVector4.cpp" />
|
||||||
|
|||||||
@@ -58,6 +58,9 @@
|
|||||||
<Filter Include="TrooperEngine\TextTypeEngine\TextTypeHelpers">
|
<Filter Include="TrooperEngine\TextTypeEngine\TextTypeHelpers">
|
||||||
<UniqueIdentifier>{b13cf78d-bfda-4467-9cdc-79dcb63fd8a9}</UniqueIdentifier>
|
<UniqueIdentifier>{b13cf78d-bfda-4467-9cdc-79dcb63fd8a9}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="TrooperEngine\GUIEngine\GUIEventEngine">
|
||||||
|
<UniqueIdentifier>{ecc37f2c-0d3c-425e-9db6-deed712faacd}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="dllExportFiles\dllExport.h">
|
<ClInclude Include="dllExportFiles\dllExport.h">
|
||||||
@@ -198,9 +201,6 @@
|
|||||||
<ClInclude Include="TrooperEngine\GUIEngine\cLabel.hpp">
|
<ClInclude Include="TrooperEngine\GUIEngine\cLabel.hpp">
|
||||||
<Filter>TrooperEngine\GUIEngine</Filter>
|
<Filter>TrooperEngine\GUIEngine</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="TrooperEngine\GUIEngine\cTextButton.hpp">
|
|
||||||
<Filter>TrooperEngine\GUIEngine</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.hpp">
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.hpp">
|
||||||
<Filter>TrooperEngine\GUIEngine\GUIHelpers</Filter>
|
<Filter>TrooperEngine\GUIEngine\GUIHelpers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -219,6 +219,21 @@
|
|||||||
<ClInclude Include="TrooperEngine\GUIEngine\cSizer.hpp">
|
<ClInclude Include="TrooperEngine\GUIEngine\cSizer.hpp">
|
||||||
<Filter>TrooperEngine\GUIEngine</Filter>
|
<Filter>TrooperEngine\GUIEngine</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIEventEngine\cButtonEvent.hpp">
|
||||||
|
<Filter>TrooperEngine\GUIEngine\GUIEventEngine</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="TrooperEngine\MathEngine\cInside.hpp">
|
||||||
|
<Filter>TrooperEngine\MathEngine</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIEventEngine\Event.h">
|
||||||
|
<Filter>TrooperEngine\GUIEngine\GUIEventEngine</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIEventEngine\cGUIEvent.hpp">
|
||||||
|
<Filter>TrooperEngine\GUIEngine\GUIEventEngine</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="TrooperEngine\GUIEngine\GUIEventEngine\cGUIEventHandler.hpp">
|
||||||
|
<Filter>TrooperEngine\GUIEngine\GUIEventEngine</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="TrooperEngine\AudioEngine\cAudio.cpp">
|
<ClCompile Include="TrooperEngine\AudioEngine\cAudio.cpp">
|
||||||
@@ -344,9 +359,6 @@
|
|||||||
<ClCompile Include="TrooperEngine\GUIEngine\cLabel.cpp">
|
<ClCompile Include="TrooperEngine\GUIEngine\cLabel.cpp">
|
||||||
<Filter>TrooperEngine\GUIEngine</Filter>
|
<Filter>TrooperEngine\GUIEngine</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="TrooperEngine\GUIEngine\cTextButton.cpp">
|
|
||||||
<Filter>TrooperEngine\GUIEngine</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.cpp">
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIHelpers\cXMLoader.cpp">
|
||||||
<Filter>TrooperEngine\GUIEngine\GUIHelpers</Filter>
|
<Filter>TrooperEngine\GUIEngine\GUIHelpers</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -368,5 +380,17 @@
|
|||||||
<ClCompile Include="TrooperEngine\GUIEngine\cSizer.cpp">
|
<ClCompile Include="TrooperEngine\GUIEngine\cSizer.cpp">
|
||||||
<Filter>TrooperEngine\GUIEngine</Filter>
|
<Filter>TrooperEngine\GUIEngine</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="TrooperEngine\MathEngine\cInside.cpp">
|
||||||
|
<Filter>TrooperEngine\MathEngine</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIEventEngine\cButtonEvent.cpp">
|
||||||
|
<Filter>TrooperEngine\GUIEngine\GUIEventEngine</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIEventEngine\cGUIEvent.cpp">
|
||||||
|
<Filter>TrooperEngine\GUIEngine\GUIEventEngine</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="TrooperEngine\GUIEngine\GUIEventEngine\cGUIEventHandler.cpp">
|
||||||
|
<Filter>TrooperEngine\GUIEngine\GUIEventEngine</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -70,7 +70,6 @@
|
|||||||
#include "../TrooperEngine/GUIEngine/cLayout.hpp"
|
#include "../TrooperEngine/GUIEngine/cLayout.hpp"
|
||||||
#include "../TrooperEngine/GUIEngine/cLabel.hpp"
|
#include "../TrooperEngine/GUIEngine/cLabel.hpp"
|
||||||
#include "../TrooperEngine/GUIEngine/cButton.hpp"
|
#include "../TrooperEngine/GUIEngine/cButton.hpp"
|
||||||
#include "../TrooperEngine/GUIEngine/cTextButton.hpp"
|
|
||||||
#include "../TrooperEngine/GUIEngine/cSizer.hpp"
|
#include "../TrooperEngine/GUIEngine/cSizer.hpp"
|
||||||
|
|
||||||
/*** GUIHelper ***/
|
/*** GUIHelper ***/
|
||||||
|
|||||||
Reference in New Issue
Block a user