0 Members and 1 Guest are viewing this topic.
std::cout<< "debutExport" <<std::endl; m_app->canvasWindow->canvas->getFlattenedImage(); std::cout<< "finExport" <<std::endl;
sf::Image CE_Group::getFlattenedImage(){ std::cout<< "start" <<std::endl; sf::RenderImage RI; RI.Create(800,600); RI.Clear(sf::Color(200,200,200)); RI.Display(); sf::Image img = RI.GetImage(); std::cout<< "end" <<std::endl; return img;}
debut export. total of frames:1000debutExportstartendSegmentation fault
sf::RenderImage* RI = new sf::RenderImage();
find_package(SFML REQUIRED COMPONENTS graphics window system)target_link_libraries(Programme ${SFML_SYSTEM_LIBRARY} ${SFML_AUDIO_LIBRARY} ${SFML_GRAPHICS_LIBRARY} ${SFML_WINDOW_LIBRARY} ${GTKMM_LIBRARIES})
target_link_libraries(Programme ${SFML_SYSTEM_LIBRARY} ${SFML_AUDIO_LIBRARY} ${SFML_GRAPHICS_LIBRARY_DEBUG} ${SFML_WINDOW_LIBRARY} ${GTKMM_LIBRARIES})
ok, I did that, but it doesn't change anything...
[...]target_link_libraries(Programme ${SFML_SYSTEM_LIBRARY_DEBUG} ${SFML_AUDIO_LIBRARY_DEBUG} ${SFML_GRAPHICS_LIBRARY_DEBUG} ${SFML_WINDOW_LIBRARY_DEBUG} ${GTKMM_LIBRARIES})[...]
(gdb) backtrace#0 0x0166d675 in xcb_writev () from /usr/lib/libxcb.so.1#1 0x01488dec in _XSend () from /usr/lib/libX11.so.6#2 0x01488f90 in _XReply () from /usr/lib/libX11.so.6#3 0x0147c867 in XSync () from /usr/lib/libX11.so.6#4 0x013ac205 in ?? () from /usr/lib/fglrx/libGL.so.1Backtrace stopped: previous frame inner to this frame (corrupt stack?)
#include <SFML/Graphics.hpp>#include <SFML/System.hpp>#include <iostream>sf::Image getFlatennedImage(){ std::cout<< "debutFonction" <<std::endl; sf::RenderImage RI; RI.Create(800,600); RI.SetActive(); RI.Clear(); RI.Display(); std::cout<< "finFonction" <<std::endl; return RI.GetImage();}int main(){ // Create the main window sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window"); // Start main loop bool Running = true; while (Running) { std::cout<< "avant appel" <<std::endl; getFlatennedImage(); std::cout<< "apres appel" <<std::endl; App.Display(); } return EXIT_SUCCESS;}
# explications qt = http://www.marcossantamaria.com/tutorialdata.php?id=3cmake_minimum_required(VERSION 2.8)set(CMAKE_CXX_FLAGS "-Wall -W -ansi -pedantic -g")set(CMAKE_BUILD_TYPE CMAKE_CXX_FLAGS_DEBUG)#Déclaration du projetproject(Programme)find_package(SFML REQUIRED COMPONENTS graphics window system)#Déclaration de l'exécutableadd_executable( Programme main.cpp)target_link_libraries(Programme ${SFML_SYSTEM_LIBRARY_DEBUG} ${SFML_AUDIO_LIBRARY_DEBUG} ${SFML_GRAPHICS_LIBRARY_DEBUG} ${SFML_WINDOW_LIBRARY_DEBUG})INSTALL_TARGETS( /bin Programme)
$ ./Programme avant appeldebutFonctionfinFonctionSegmentation fault
sf::Event Event; while (App.GetEvent(Event)) { // Process event }