Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Zeven  (Read 9187 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 42
    • View Profile
« Reply #15 on: December 03, 2010, 01:14:46 am »
I have to say that this doesn't look very useful to someone who is not looking for a robust and flexible structure to their code, which may be why Ceylo doesn't get the point in it.

Or it may be the fact that the need to append your event structure with every event received and the update methods, as he pointed out, make the solution slightly less robust.

What exactly do these update functions do?


  • Full Member
  • ***
  • Posts: 127
    • View Profile
« Reply #16 on: December 06, 2010, 01:10:28 pm »
Sorry if I don't have responded earlier, but the method of update has just been improved. For the moment, it is just an overlay of the current public interface, and the performances are lower than before. If you approve the new system, I will adapt the code to no longer use the Events class, and the performances should return to the normal. Here are the changes :

Code: [Select]

/// Headers
#include <SFML/Graphics.hpp>
#include <iostream>
#include <Zeven/sfZeven/sfZeven.hpp>

void Hello()
   std::cout << "Hello world" << std::endl;

/// Entry point of the application
int main()

// Creation and settings of the SFML rendering window
   sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Zeven sample");
// Limitation of the framerate

// Creation of the area
   sf::FloatRect area(0, 0, 100, 100);

// Creation of a shape which represent the area
   sf::Shape::Rectangle rectangle(area.Left, area.Top, area.Width, area.Height, sf::Color::Red);

// Get the event handler
   zin::sfEventHandler<zin::sfListener>& EventHandler = zin::sfEventHandler::GetInstance();

// Creation of the mouse over listener
   zin::sfMouseOverListener mouseOver(area);

// Connection to the function Hello

// Register the listener

// Main process loop
   while( App.IsOpened() )
   // Rest of the processor
   // Create an empty event
      sf::Event Event;

   // Event loop
      while( App.GetEvent(Event) )
      // Send an SFML event to the event handler
      // Close window to exit the program
         if( Event.Type == sf::Event::Closed )
      // Esc to exit the program
         if( Event.Type == sf::Event::KeyPressed && Event.Key.Code == sf::Key::Escape )

   // Send the mouse position
      EventHandler.Recept(App.ConvertCoords(App.GetInput().GetMouseX(), App.GetInput().GetMouseY()));

   // Update the event handler

   // Clear the screen
   // Add drawable in the stack
   // Displaying in the rendering window

   return EXIT_SUCCESS;
Zoost & Zoom libraries : An easy way to create and handle geometric objets, animate and use them for better graphics !