#include <SFML/Graphics.hpp>
#include <cmath>
#include "Gwen/Renderers/SFML2.h"
#include "Gwen/Input/SFML.h"
#include "Gwen/Skins/Simple.h"
#include "Gwen/Skins/TexturedBase.h"
#include "Gwen/Controls.h"
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600), "test");
Gwen::Renderer::SFML2 GwenRenderer(App);
Gwen::Skin::TexturedBase skin(&GwenRenderer);
skin.Init("DefaultSkin.png");
skin.SetDefaultFont(L"Raleway Thin.ttf", 24);
Gwen::Controls::Canvas* pCanvas = new Gwen::Controls::Canvas(&skin);
pCanvas->SetSize(App.getSize().x, App.getSize().y);
pCanvas->SetDrawBackground(true);
pCanvas->SetBackgroundColor(Gwen::Color(150, 170, 170, 255));
Gwen::Controls::Button* pButton = new Gwen::Controls::Button(&pCanvas);
pButton->SetText(L"yyggjjppqq");
pButton->SetBounds(400, 200, 200, 200);
Gwen::Input::SFML GwenInput;
GwenInput.Initialize(pCanvas);
while(App.isOpen())
{
sf::Event Event;
while(App.pollEvent(Event))
{
if((Event.type == sf::Event::Closed))
{
App.close();
break;
}
else if(Event.type == sf::Event::Resized)
{
pCanvas->SetSize(Event.size.width, Event.size.height);
}
GwenInput.ProcessMessage(Event);
}
App.clear();
pCanvas->RenderCanvas();
App.display();
}
return 0;
}
Much like the GWEN SFML2 example.
I don't see any need to rebuild SFML as it works totally fine if I use SFML directly...