Skip to content

PhuwadonV/WinFW

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Visual Studio

  • Version : Visual Studio Community 2017
  • Platform Toolset : Visual Studio 2017(v141)
  • Windows SDK Version : 10.0.14393.0
  • Build : Release (x86, x64)

LibGen.bat

Automatic create Library folder and copy files from project folder

.
└── Library
    │
    ├── bin
    │   ├── x64
    │   │   └── WinFW.lib
    │   └── x86
    │       └── WinFW.dll
    │
    ├── include
    │   └── WinFW.hpp
    │
    └── lib
        ├── x64
        │   └── WinFW.lib
        └── x86
            └── WinFW.lib

Example

#define USE_MAIN
#include <WinFW.hpp>

#pragma comment(lib, "WinFW.lib")

using WinFW::EventLoop;
using WinFW::IPtr;
using WinFW::Window;
using WinFW::WindowConfig;
using WinFW::WinClass;
using WinFW::WinClassConfig;

IPtr<Window> window;

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

constexpr int width = 800;
constexpr int height = 600;
constexpr wchar_t const*title = L"Test";

int main(HINSTANCE hInstance, char *lpCmdLine, int nCmdShow) {
	window = Window::New(WindowConfig::New(WinClass::New(WinClassConfig::New(L"Class1", WndProc)), width, height));
	window->setTitle(title);
	window->show();

	EventLoop::init();
	while (EventLoop::isActive()) {
		if (EventLoop::fps(30)) {

		}
	}

	return 0;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
	switch (uMsg) {
	case WM_DESTROY:
		EventLoop::destroy();
		break;
	}
	return DefWindowProc(hWnd, uMsg, wParam, lParam);
}

Releases

No releases published

Packages

No packages published