Day 4 complete

Going to have to fork win32 modular headers lib, they didn't do handle declares proper.

So far so good. Made a funny looking gradient
This commit is contained in:
2023-09-09 03:03:03 -04:00
parent 4c832f3353
commit 973936ac82
5 changed files with 181 additions and 55 deletions

View File

@ -5,3 +5,10 @@
#define local_persist static // Local Persisting variables
#define api_c extern "C"
// Casting
#define ccast( Type, Value ) ( * const_cast< Type* >( & (Value) ) )
#define pcast( Type, Value ) ( * reinterpret_cast< Type* >( & ( Value ) ) )
#define rcast( Type, Value ) reinterpret_cast< Type >( Value )
#define scast( Type, Value ) static_cast< Type >( Value )

View File

@ -2,9 +2,13 @@
Alternative header for windows.h
*/
// #include <windows.h>
#include "windows/windows_base.h"
#include "windows/window.h"
#include "windows/file.h"
#include "windows/io.h"
// #ifdef Build_Debug
# include "windows/dbghelp.h"
// #endif
@ -127,8 +131,9 @@ PatBlt( HDC hdc
constexpr auto DispatchMessage = DispatchMessageA;
#endif // !UNICODE
#pragma region Message Function Templates
// From WinUser.h, modular headers lib doesn't have.
#pragma region WinUser
HDC WINAPI GetDC( HWND hWnd );
BOOL WINAPI
GetMessageA(
@ -159,7 +164,7 @@ GetMessageW(
#else
constexpr auto RegisterClass = RegisterClassA;
#endif // !UNICODE
#pragma endregion Message Function Templates
#pragma endregion WinUser
// Class Style Constants
// https://learn.microsoft.com/en-us/windows/win32/winmsg/about-window-classes
@ -192,12 +197,21 @@ enum MB : UINT
MB_Icon_Information = MB_ICONINFORMATION,
};
#define WM_ACTIVATEAPP 0x001C
enum WS : UINT
enum Mem : DWORD
{
WS_Overlapped_Window = WS_OVERLAPPEDWINDOW,
WS_Initially_Visible = WS_VISIBLE,
Mem_Commit_Zeroed = 0x00001000,
Mem_Reserve = 0x00002000,
Mem_Release = 0x00008000,
};
enum Page : DWORD
{
Page_Read_Write = 0x04,
};
enum PM : UINT
{
PM_Remove_Messages_From_Queue = PM_REMOVE,
};
enum RasterOps : DWORD
@ -207,6 +221,14 @@ enum RasterOps : DWORD
RO_Whiteness = (DWORD)0x00FF0062,
};
#define WM_ACTIVATEAPP 0x001C
enum WS : UINT
{
WS_Overlapped_Window = WS_OVERLAPPEDWINDOW,
WS_Initially_Visible = WS_VISIBLE,
};
WIN_LIBRARY_API_END
NS_WIN32_END