#include "../include/Channel.hpp" #include "../include/ChannelSidePanel.hpp" #include "../include/Cache.hpp" #include "../include/ResourceCache.hpp" #include "../include/Video.hpp" #include #include #include #include #include using namespace std; using namespace dchat; using namespace TinyProcessLib; int main(int argc, char **argv) { /* boost::filesystem::path programPath(argv[0]); auto parentPath = programPath.parent_path(); printf("parent path: %s\n", parentPath.string().c_str()); boost::filesystem::current_path(parentPath); // Ensures loading of resources works no matter which path we run this executable from */ XInitThreads(); sf::RenderWindow window(sf::VideoMode(1920, 1080), "dchat"); window.setVerticalSyncEnabled(false); window.setFramerateLimit(60); //odhtdb::Database database("bootstrap.ring.cx", 4222, Cache::getDchatDir()); //Video video(500, 500, "https://www.youtube.com/watch?v=bs0-EX9mJmg"); Cache cache; Channel channel("latenightshiendjs"); ChannelSidePanel channelSidePanel(300.0f); channelSidePanel.addChannel(&channel); sf::Event event; while (window.isOpen()) { 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, sf::Vector2f(channelSidePanel.width, 0.0f), cache); channelSidePanel.draw(window); //video.draw(window); window.display(); } return 0; }