Hello, I have compiled SFML and MyGUI, but I not find for get image at MyGUI for drawing with SFML
For event, I have a idea, exemple : MyGUI::Gui.injectMousePress()
But, for get the image, I not find :x
My code is :
#include <MyGUI.h>
#include <MyGUI_DataManager.h>
#include <MyGUI_OpenGLImageLoader.h>
#include <MyGUI_OpenGLDataManager.h>
#include <MyGUI_OpenGLPlatform.h>
#include <MyGUI_OpenGLRenderManager.h>
#include "OpenGLImageLoader_Devil.hpp"
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <string>
#include <iostream>
using namespace std;
int main()
{
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
MyGUI::Gui* mGUI;
OpenGLImageLoader_Devil* mIL = new OpenGLImageLoader_Devil();
MyGUI::OpenGLPlatform* mPlatform = new MyGUI::OpenGLPlatform();
mPlatform->initialise(mIL, "mIL");
mPlatform->getDataManagerPtr()->addResourceLocation("Media\MyGUI_Media", false);
mGUI = new MyGUI::Gui();
mGUI->initialise("MyGUI_Core.xml");
MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>("Button", 10, 10, 300, 26, MyGUI::Align::Default, "Main");
button->setCaption("Hello World!");
// Start the game loop
while (window.IsOpen())
{
// Process events
sf::Event event;
while (window.PollEvent(event))
{
// Close window : exit
if (event.Type == sf::Event::Closed)
window.Close();
}
// Clear screen
window.Clear(sf::Color(255,200,0));
mPlatform->getRenderManagerPtr()->drawOneFrame();
// Now, how I get image at MyGUI and how I draw in sfml ?
// Update the window
window.Display();
}
return EXIT_SUCCESS;
}
Plyz, help me to creat a button Hello World!
Thanks !