Working on lexer first

This commit is contained in:
Krzosa Karol
2022-04-28 13:49:32 +02:00
commit d462892e14
7 changed files with 645 additions and 0 deletions

27
os.cpp Normal file
View File

@@ -0,0 +1,27 @@
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <windows.h>
#include "types.h"
function S32 os_main();
LRESULT CALLBACK
WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){
return DefWindowProcW(hwnd, uMsg, wParam, lParam);;
}
int
WinMain(HINSTANCE hInstance, HINSTANCE a, LPSTR b, int nShowCmd){
wchar_t *CLASS_NAME = L"Cool window class";
wchar_t *WINDOW_NAME = L"Have a good day!";
WNDCLASSW wc = { };
wc.lpfnWndProc = WindowProc;
wc.hInstance = hInstance;
wc.lpszClassName = CLASS_NAME;
RegisterClassW(&wc);
HWND window_handle = CreateWindowExW(0, CLASS_NAME, WINDOW_NAME, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, hInstance, 0);
ShowWindow(window_handle, nShowCmd);
return os_main();
}