-
Notifications
You must be signed in to change notification settings - Fork 1
/
GCP.h
77 lines (75 loc) · 3.13 KB
/
GCP.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////Ñèñòåìà SDL GUI CHECK POINT
/////////////////////////////////////Èíòåðôåéñ äëÿ SDL
////////////////////////////////////////////////////////////////////////////////////////////
//////Ìîäóëü îòâå÷àåò çà îáðàáîòêó ñîáûòèé SDL è ïåðåäàåò èõ ñâîåìó êîìïîíåíòó: _mainForm
//////Êîíòðîëëåð äîëæåí çíàòü ìàêñèìàëüíóþ øèðèíó è âûñîòó áóôåðà ÷òîáû îãðàíè÷åòü ïåðåäâèæåíèå ôîðìû
//////Äëÿ ðàáîòû êîíòðîëëåðà íàäî âûçâàòü ôóíêöèè handleEvents è draw â öèêëå ïðîãðàììû
//////ÏÐÈÌÅÐ:
//////=====ON CREATE
//////GCP_Controller *Interface = new GCP_Controller(sdlRenderer,SCREEN_WIDTH,SCREEN_HEIGHT);
//////Interface->setFont(font_path.str()); // ïóòü ê ôàéëó øðèôòîâ
//////GCP_Form *MainInterfaceForm = Interface->createForm(sdlRenderer); // ãëàâíàÿ ôîðìà èíòåðôåéñà
//////=====MAIN WHILE
//////SDL_RenderClear(sdlRenderer);
//////while( SDL_PollEvent( &event ) ) //Îáðàáîò÷èê âñåõ ñîáûòèé îò SDL
//////{
////// Interface->handleEvents(event); //Îáðàáàòûâàåì èíòåðôåéñ
////// if( event.type == SDL_QUIT )
////// return -1;
//////}
//////draw(); //Ðèñóåì íàøó ëîãèêó
//////Interface->draw(); //Ðèñóåì èíòåðôåéñ
//////SDL_RenderPresent(sdlRenderer); //Âûâîäèì íà ýêðàí
//////================
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
#ifndef GCP_MainH
#define GCP_MainH
#define GCP_VERSION "1.02a"
#pragma region CHANGELOG
//!NEW
//!"1.02 -> 1.02a"
//Locking form bug fixes
//Vector find function
//toggle top right buttons on form
//!"1.01d -> 1.02"
//GCP_Graph minor style changes
//GCP_Vector constructors defined for GCP_Vector of GCP_Vector is now fine
//added gfx dependence for drawing
//text on buttons and messages align centered
//right button click does not pass to form header
//add uniqueValue64 and GCP_UID
//fixed text input for Russian characters
//add getComponent(string name) to Forms;
//!"1.01c -> 1.01d"
//GCP_Graph Added X (index) legend to the bottom
//Slight Refactoring
#pragma endregion
#include "GCP_Form.h"
#include "GCP_Button.h"
#include "SDL.h"
namespace gcp
{
class GCP_Controller : public GCP_SPointerBase
{
protected:
int _width, _height; //ðàçìåð áóôåðà ýêðàíà. íåêîòîðûå ñèñòåìû âàëÿòñÿ åñëè ïðîáóåøü íàðèñîâàòü çà áóôåð. GCP áóäåò ó÷èòûâàòü ýòî.
GCP_SPointer<GCP_Form> _mainForm; //Ãëàâíàÿ ôîðìà èíòåðôåéñà
bool _isLeftHold; //ïåðåêëþ÷àòåëü äëÿ ñîáûòèÿ äðàã åí äðîï
public:
GCP_Controller(SDL_Renderer *sdlRenderer, int width, int height);
~GCP_Controller();
void setFont(const string &directory_path_string);
GCP_SPointer<GCP_Form> createForm();
void handleEvents(const SDL_Event &event);
void draw();
void deInit()
{
GCP_Draw::DeInit();
}
};
}
#endif