Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

andycbriggs/win32-experiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

win32-experiments

A sketchbook of approaches to working with the win32 api using modern c++.

Why?

Experimentation, curiosity and some motivation to make writing native win32 applications fun and expressive.

The following snippet is from an early test:

std::shared_ptr<Window> window = std::make_shared<Window>();
window->setTitle(L"Server!");
window->show();

std::shared_ptr<TextComponent> status = std::make_shared<TextComponent>();
status->setPosition(10, 10);
status->setFontSize(32);
status->setColor(236, 240, 241);
status->setText(L"Ready!");

window->addUIComponent(status);

std::shared_ptr<TCPSocket> socket = std::make_shared<TCPSocket>();
socket->on(SocketEvent::Error, [=] (SocketEvent ev) {
  status->setText(ev.error);
});
socket->on(SocketEvent::Connection, [=] (SocketEvent ev) {
  status->setText(L"Connection Received");
  ev.socket->on(SocketEvent::Data, [=] (SocketEvent ev) {
    status->setText(data);
  });
});
socket->bind("127.0.0.1", 1337);
socket->listen();

About

A collection of useful classes for building win32 applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors