source: network-game/client/Client/Window.cpp@ 1a3c42d

Last change on this file since 1a3c42d was 1a1aebd, checked in by dportnoy <dmp1488@…>, 12 years ago

Updated client Visual Studio files

  • Property mode set to 100644
File size: 773 bytes
Line 
1#include "Window.h"
2
3Window::Window(int x, int y, int width, int height) :
4 GuiComponent(x, y, width, height, NULL)
5{
6}
7
8Window::~Window(void)
9{
10 for(unsigned int x=0; x<this->vctGui.size(); x++)
11 delete this->vctGui[x];
12}
13
14void Window::addComponent(GuiComponent *comp)
15{
16 this->vctGui.push_back(comp);
17}
18
19GuiComponent* Window::getComponent(int x)
20{
21 return this->vctGui[x];
22}
23
24void Window::draw(ALLEGRO_DISPLAY *display)
25{
26 al_clear_to_color(al_map_rgb(0, 0, 0));
27
28 for(unsigned int x=0; x<this->vctGui.size(); x++)
29 this->vctGui[x]->draw(display);
30}
31
32bool Window::handleEvent(ALLEGRO_EVENT& e)
33{
34 for(unsigned int x=0; x<this->vctGui.size(); x++) {
35 if(this->vctGui[x]->handleEvent(e)) {
36 return true;
37 }
38 }
39
40 return false;
41}
Note: See TracBrowser for help on using the repository browser.