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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Zinlibs

Pages: 1 2 [3] 4
31
General discussions / A new logo for SFML
« on: July 09, 2011, 06:12:04 pm »
Oh great job, the 5° variation is really awesome !

33
General discussions / A new logo for SFML
« on: June 18, 2011, 03:04:03 am »
And what do you think about this one ?



I've just trying another color for the ellipse and the logo's site integration seems better. I let you judge by yourself : click here

34
General discussions / A new logo for SFML
« on: June 18, 2011, 01:30:55 am »
I took some free and open icons, and try to improve the Gregouar's logo. This is the result :

35
General discussions / A new logo for SFML
« on: June 17, 2011, 08:40:35 pm »
I really think that the Gregouar's logo is the best compromize (from Cpl.Bator) ! Simple, with green & blue colors, and very modern; Greg, you have my vote !

36
General discussions / [SFML 2] I need your help for the ATI fix
« on: March 02, 2011, 11:11:48 am »
Yes, I agree with Mjonir, Sf::(Draw?)Init is the easiest to understand solution.

37
SFML projects / Trasporter: Object Oriented project of a double conveyer AI
« on: February 05, 2011, 02:29:42 am »
Just download the video on your disk and open it with VLC

38
SFML projects / Zeven
« 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
   App.SetFramerateLimit(40);

// 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
    mouseOver.ConnectTo(sigc::ptr_fun(&Hello));

// Register the listener
    EventHandler.Register(mouseOver);

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

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

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

   // Update the event handler
      EventHandler.Update();

   // Clear the screen
      App.Clear();
       
   // Add drawable in the stack
      App.Draw(rectangle);
       
   // Displaying in the rendering window
      App.Display();
   }

   return EXIT_SUCCESS;
}

39
SFML projects / Zeven
« on: December 01, 2010, 02:41:45 pm »
This is a good observation and remark, and need answer point by point :

Quote
1. You need to call Update() for each listener.


Yes, in this case, but you can also use Trigger to register an input listener, connected to a potential listeners network. If a listener is listened, its targets (some other listeners connected) will be updated at their turn. But if one of them is listened, the other will be no longer updated. The same applies to Behavior and Trigger. Finaly, you just have to update one Behavior, one Trigger, or one Listener, that depends only of you needs.

Quote
2. You need to manually append each event to your events' container.
3. You need to go through your own container to do the Update() call.


I concede that an events' container is not an elegant and clean solution. This is a temporary one since the begining. I'm currently working on it.

Quote
What's your thought about this ?


I like it. Danman submit another one. At this time, no choice is made. I just trying to find the best solution and avoid new problems. Concider for example there aren't just sf::Event listeners in the sfListener, you have sfTimeReachedListener (with an internal clock), sfMouseOver/OutListener too, and those ones need a real-time update.

It might take an undefined time, but It's sure, I will improve the current updating system as best I can. Thanks a lot for your interest Ceylo.

40
SFML projects / Zeven
« on: December 01, 2010, 12:16:47 pm »
Translation done.

41
SFML projects / Zeven
« on: December 01, 2010, 08:22:22 am »
OK, I will do this as soon as possible.

42
SFML projects / Zeven
« on: December 01, 2010, 12:57:38 am »
Zeven for dummies :  :lol:

Code: [Select]
////////////////////////////////////////////////////////////
/// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <iostream>
#include <sfModule/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
App.SetFramerateLimit(40);

// 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);

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

// Connection to the function Hello
    mouseOver.ConnectTo(PtrFun(&Hello));

// Main process loop
while( App.IsOpened() )
{

// Rest of the processor
sf::Sleep(0.02);

// Create an empty event
sf::Event Event;

// Create an event container
zin::sfEvents Events;
Events.SendMousePos(App.ConvertCoords(App.GetInput().GetMouseX(), App.GetInput().GetMouseY()));

// Event loop
while( App.GetEvent(Event) )
{
// Add the event into the container
Events+=Event;

// Close window to exit the program
if( Event.Type == sf::Event::Closed )
App.Close();

// Esc to exit the program
if( Event.Type == sf::Event::KeyPressed && Event.Key.Code == sf::Key::Escape )
App.Close();
}

// Send the events to the listener
mouseOver.Update(Events);

// Clear the screen
App.Clear();

// Add drawable in the stack
App.Draw(rectangle);

// Displaying in the rendering window
App.Display();
}

return EXIT_SUCCESS;
}

43
SFML projects / Zeven
« on: December 01, 2010, 12:21:37 am »
Ha peuchère, I'm really complicated, I know ! :D
A very tiny example for you this time :

Code: [Select]
  void Hello()
   {
      std::cout << "Hello world !" << std::endl;
   }

   sf::FloatRect area(0, 0, 100, 100);

   zin::sfMouseOverListener mouseOver(area);
   mouseOver.ConnectTo(PtrFun(&Hello));

   mouseOver.Update(...);


Is this enough short for you ?  :P

44
SFML projects / Zeven
« on: November 30, 2010, 11:33:57 pm »
Quote from: "Ceylo"
Could you provide a simpler example ? (even with fewer features shown)

It's hard to get an idea of how good it is with the sample code you gave.


Of course, this is a smaller example :
Code: [Select]

   sf::FloatRect area(50, 50, 100, 100);

   zin::sfMouseOverListener mouseOver(area);
   mouseOver.ConnectTo(myMouseOverFunction);

   zin::sfMouseOutListener mouseOut(area);
   mouseOut.ConnectTo(myMouseOutFunction);

// Connect each other :
   mouseOver.ConnectTo(mouseOut);
   mouseOut.ConnectTo(mouseOver);

   zin::sfTextEnteredListener textEntered;
   textEntered.ConnectTo(PtrFun(&myTextEnteredFunction));

   mouseOver.ConnectTo(textEntered);

   zin::sfTrigger trigger;
   trigger.SetInput(mouseOver);
   trigger.SetOutput(textEntered);

   trigger.SetRepeat(true);

   zin::Behavior behavior;
   behavior.ConnectTo(trigger);


With this code you can define an area which is reactive to the mouse hovering, and call function for each state. If the mouse is over the area, you can also press a key and another function will be called. The trigger is repeated to the infinite.

45
SFML projects / Zeven
« on: November 30, 2010, 08:46:00 pm »
Thanks a lot.

To answer you, I though to be clear : Zeven is not a signal and slot library, it just uses one, called sigc++. The libs which you are talking about are very heavy, and for the people who want make a GUI library or just for someone who programs a game, that is most interesting to use a tiny library like Zeven to interpret the user's events and throw actions in return. In addition, Zeven allow you to build complex listener and trigger networks, I don't think this feature is very common.

Pages: 1 2 [3] 4