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 - dips

Pages: [1]
Window / Re: Window resizing problem
« on: March 01, 2019, 05:32:59 pm »
It seems that you already know why this happens, and have found one solution to this problem. Other (simpler) solutions can be found in the other similar threads on this forum (use the search box).
Sorry, I can't find any decissions of that problem in forum.What do you mean?May be you can show me the concrette post?
 And I have one problem with fork, I can't normally destroy more than one window.

Window / Re: Window resizing problem
« on: February 27, 2019, 03:30:13 pm »
First, I think you should see source code of the library, and after that offer your 2cents. Without it, it is just void talkings.I'm gave you concrette places of performans pitfalls,but you still solve philosophical problems.Didn't want to be rude.

Window / Re: Window resizing problem
« on: February 23, 2019, 06:50:24 pm »
That is not 'explicit event polling', that is implicit, because you have additional layer as your own event queue processing. And it is not callbacks it is direct calls from swith/case noodles of processEvent method. And you uses yet another swith/case noodles in 'main' function.
Two performance pitfalls with sf::Events design: First - additional queue,  Second - additional switch/case in 'main'.

My variant is  'S'imple 'F'ast  :) :)  and more C++ idiomatic.
I'm not expect somthing from you, a have my fork. It's enough for me. But I advise to recall my words when you wil write SFML-3.

Window / Re: Window resizing problem
« on: February 22, 2019, 08:18:08 pm »
Code is best judge. It is real code from my repo. Do you have spoilers?

Window.cpp file
#include "Window.hpp"

int main()
    sf::EventLoop loop;

    sf::ContextSettings settings;
    settings.depthBits = 24;
    settings.majorVersion = 2;
    settings.minorVersion = 1;

    Window window(sf::VideoMode(800, 600), "SFML window", sf::Style::Default, settings);
    Window window2(sf::VideoMode(300, 300), "SFML window with OpenGL", sf::Style::Default, settings);

    return loop.Run();
Window.hpp file
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>

class Window : public sf::Window

    Window(sf::VideoMode mode, const sf::String& title, sf::Uint32 style, const sf::ContextSettings& settings) :
        sf::Window(mode, title, style, settings)

    void onKeyPressed() override

    void onResized(int x, int y, int width, int height) override

    void onDraw() override

    void onIdle() override
};//class MainWindow

I hate switch/case operator. And event loop must be hided as much as possible.My code it is traditional C++ code for any GUI program. sf::Event is redundant entity, each kind of it replaced with approriate virtual handler method.
Switch/case/if noodles hided inside processEvent method of platform dependent class.

Window / Re: Window resizing problem
« on: February 22, 2019, 06:16:02 pm »
I should test my code before make PR. How long will it take? I don't know.
I don't have any Apple device, therefore I can't programming for this devices.
Anyway, my githab repo url you can see above. 'noevents2' branch is mix of sf::Events and virtual handlers. 'noevents3' will be branch without events at all.

Window / Re: Window resizing problem
« on: February 22, 2019, 07:02:02 am »
Yes, it is hard work. Of corse, first I'm will make working version for my platform. And I can make it for Linux, although X11 is dark forest for me. May'be Android. But not Apple company.
sf::Events replaced by direct handler call from process event  method.
I will post example in nearly future.
PR is no plan for me now.I'm need working version now.

Window / Re: Window resizing problem
« on: February 21, 2019, 11:11:16 am »
Anyway, I want to make new branch, last is just proof of concept.
I want remove sf::Event at all. But I think community will not understand me. And I can do compromise
variant when sf::Event is still used with virtual handlers.

Window / Window resizing problem
« on: February 21, 2019, 10:52:03 am »
Hallo people!
I'm newbie in SFML, and sorry for my english.
I'm use Windows.
My problem is resizing of window by it's edge. Picture in window not updated while left mouse button hold down.
Tell me please how can I do content updating of window when I drag the edge of window.

I guess problem is additional event handling inside SFML. Yet another event queue? Why? OS made all jobs.
sf::Event is redundant entity. In general I made fork that uses direct calls from platform event processing subroutine. I.e. you make descendant of sf::Window and in overriden methods do your job. Additionally you must create MessageLoop object in 'main' function and call 'Run' method.
After this all works fine and fast.
https://github.com/vgui/SFML/tree/noevents It is my fork, 'noevents' branch.

Pages: [1]