blob: 3ca986f23e3043c72135a9c50c0c3832e4ce6b06 (
plain)
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
|
#include "../include/Channel.hpp"
#include "../include/ChannelSidePanel.hpp"
#include "../include/Cache.hpp"
#include <string>
#include <SFML/Graphics.hpp>
#include <cstring>
#include <X11/Xlib.h>
using namespace std;
using namespace dchat;
using namespace TinyProcessLib;
int main()
{
XInitThreads();
sf::RenderWindow window(sf::VideoMode(1920, 1080), "dchat");
window.setVerticalSyncEnabled(false);
window.setFramerateLimit(60);
//odhtdb::Database database("bootstrap.ring.cx", 4222, Cache::getDchatDir());
Cache cache;
Channel channel;
ChannelSidePanel channelSidePanel;
channelSidePanel.addChannel(&channel);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
else if(event.type == sf::Event::Resized)
{
sf::View view(sf::FloatRect(0.0f, 0.0f, event.size.width, event.size.height));
window.setView(view);
}
channel.processEvent(event);
}
window.clear(sf::Color(40, 40, 40));
channel.draw(window, cache);
window.display();
}
return 0;
}
|