Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up multi-platform generic Window and Graphics objects #23

Open
7 tasks
hnkb opened this issue Oct 5, 2019 · 0 comments
Open
7 tasks

Set up multi-platform generic Window and Graphics objects #23

hnkb opened this issue Oct 5, 2019 · 0 comments

Comments

@hnkb
Copy link
Owner

hnkb commented Oct 5, 2019

  • Windows basic window implementation (mostly refactor available code)
  • X11 basic window implementation
  • Provide generic interface for both, probably with a pimpl pattern?
  • Provide rudimentary platform-agnostic basic text rendering for bootstrapping
  • Basic facilities for connection to graphics contexts
  • Generic event system, for keyboard and mouse events
  • Rendering to bitmap is useful, also for unit tests

What about window*impl?

This approach also limits following options

  1. onMouse, onKeyboard, ... as virtual members that you inherit and customize
    This means you cannot do a js style
    Window w;
    w.onclick = lambda;
  1. onMouse, kbd, ... As vector of lambda
  2. single eventproc with minimal translation of messages
    This enables a camera object with sophisticated key and mouse events to be easily added

I shouldn't make this decision in a vacuum. I need a reasonably complex project in both x11 and windows and see what is actually needed and works best.

One related thing is: if I have multiple boxes (not necessarily windows), for example two textboxes, I probably do not want to create a class for handling each, and just provide a lambda for each of their event handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant